Interface Degrees

    • Method Detail

      • degree

        int degree​(long nodeId)
        Returns the number of relationships connected to that node. For undirected graphs, this includes outgoing and incoming relationships. For directed graphs, this is the number of outgoing edges.
      • degreeInverse

        int degreeInverse​(long nodeId)
        Returns the number of relationships connected to that node. For directed graphs, this is the number of incoming edges. For undirected graphs, the behaviour of this method is undefined. Note, that this is an optional feature, and it is up to the implementation if this is actually supported. Check Graph.characteristics() before calling this method to verify that the graphs is inverse indexed.
      • degreeWithoutParallelRelationships

        int degreeWithoutParallelRelationships​(long nodeId)
        Much slower than just degree() because it may have to look up all relationships.
        This is not thread-safe, so if this is called concurrently please use RelationshipIterator.concurrentCopy().
        See Also:
        Graph.isMultiGraph()