Package org.graph4j.spanning
Interface MinimumSpanningTreeAlgorithm
- All Known Implementing Classes:
BoruvkaMinimumSpanningTreeBase,BoruvkaMinimumSpanningTreeDefault,BoruvkaMinimumSpanningTreeParallel,KruskalMinimumSpanningTree,MinimumSpanningTreeBase,ParallelFilterKruskal,PrimMinimumSpanningTree
public interface MinimumSpanningTreeAlgorithm
A minimum spanning tree (MST) is an acyclic subgraph of an
edge-weighted undirected graph, that connects all the vertices, with the
minimum possible total edge weight.
If the graph is not connected, a minimum spanning forest is the
union of the minimum spanning trees for its connected components.
- Author:
- Cristian Frăsinaru
-
Method Summary
Modifier and TypeMethodDescriptiongetEdges()static MinimumSpanningTreeAlgorithmgetInstance(Graph graph) getTree()If the graph is disconnected, this is actually a spanning forest.double
-
Method Details
-
getEdges
EdgeSet getEdges()- Returns:
- the edges of the minimum spanning tree.
-
getTree
Graph getTree()If the graph is disconnected, this is actually a spanning forest.- Returns:
- a graph representing the minimum spanning tree.
-
getWeight
double getWeight()- Returns:
- the minimum weight of a spanning tree.
-
getInstance
- Parameters:
graph- the input graph.- Returns:
- the default implementation of this interface.
-