|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgrapht.alg.KruskalMinimumSpanningTree<V,E>
public class KruskalMinimumSpanningTree<V,E>
An implementation of Kruskal's minimum spanning tree algorithm. If the given graph is connected it computes the minimum spanning tree, otherwise it computes the minimum spanning forest. The algorithm runs in time O(E log E). This implementation uses the hashCode and equals method of the vertices.
Constructor Summary | |
---|---|
KruskalMinimumSpanningTree(Graph<V,E> graph)
Creates and executes a new KruskalMinimumSpanningTree algorithm instance. |
Method Summary | |
---|---|
java.util.Set<E> |
getEdgeSet()
Returns the edges making up the tree found. |
double |
getSpanningTreeCost()
Returns the cost of the minimum spanning tree or forest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KruskalMinimumSpanningTree(Graph<V,E> graph)
graph
- the graph to be searchedMethod Detail |
---|
public java.util.Set<E> getEdgeSet()
public double getSpanningTreeCost()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |