V
- the graph vertex typeE
- the graph edge typepublic class BoruvkaMinimumSpanningTree<V,E> extends Object implements SpanningTreeAlgorithm<E>
See the article on wikipedia for more information on the history of the algorithm.
This implementation uses a union-find data structure (with union by rank and path compression heuristic) in order to track components. In graphs where edges have identical weights, edges with equal weights are ordered lexicographically. The running time is $O((E+V) \log V)$ under the assumption that the union-find uses path-compression.
SpanningTreeAlgorithm.SpanningTree<E>, SpanningTreeAlgorithm.SpanningTreeImpl<E>
Constructor and Description |
---|
BoruvkaMinimumSpanningTree(Graph<V,E> graph)
Construct a new instance of the algorithm.
|
Modifier and Type | Method and Description |
---|---|
SpanningTreeAlgorithm.SpanningTree<E> |
getSpanningTree()
Computes a spanning tree.
|
public SpanningTreeAlgorithm.SpanningTree<E> getSpanningTree()
getSpanningTree
in interface SpanningTreeAlgorithm<E>
Copyright © 2019. All rights reserved.