Package org.neo4j.gds.api
Interface Degrees
-
- All Known Implementing Classes:
CSRGraphAdapter
,GraphAdapter
,HugeGraph
,NodeFilteredGraph
,UnionGraph
public interface Degrees
The Degree interface is intended to return the degree of a given node.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
degree(long nodeId)
Returns the number of relationships connected to that node.int
degreeInverse(long nodeId)
Returns the number of relationships connected to that node.int
degreeWithoutParallelRelationships(long nodeId)
Much slower than just degree() because it may have to look up all relationships.
-
-
-
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. CheckGraph.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 useRelationshipIterator.concurrentCopy()
.- See Also:
Graph.isMultiGraph()
-
-