Package org.neo4j.gds.spanningtree
Class Prim
- java.lang.Object
-
- org.neo4j.gds.Algorithm<SpanningTree>
-
- org.neo4j.gds.spanningtree.Prim
-
public class Prim extends org.neo4j.gds.Algorithm<SpanningTree>
Sequential Single-Source minimum weight spanning tree algorithm (PRIM).The algorithm computes the MST by traversing all nodes from a given startNodeId. It aggregates all transitions into a MinPriorityQueue and visits each (unvisited) connected node by following only the cheapest transition and adding it to a specialized form of undirected tree.
The algorithm also computes the minimum, maximum and sum of all weights in the MST.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.DoubleUnaryOperatorMAX_OPERATORstatic java.util.function.DoubleUnaryOperatorMIN_OPERATOR
-
Constructor Summary
Constructors Constructor Description Prim(org.neo4j.gds.api.Graph graph, java.util.function.DoubleUnaryOperator minMax, long startNodeId, org.neo4j.gds.core.utils.progress.tasks.ProgressTracker progressTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanningTreecompute()SpanningTreegetSpanningTree()voidrelease()
-
-
-
Method Detail
-
compute
public SpanningTree compute()
- Specified by:
computein classorg.neo4j.gds.Algorithm<SpanningTree>
-
getSpanningTree
public SpanningTree getSpanningTree()
-
release
public void release()
- Specified by:
releasein classorg.neo4j.gds.Algorithm<SpanningTree>
-
-