org.apache.commons.graph.spanning
Class Kruskal

java.lang.Object
  extended by org.apache.commons.graph.spanning.Kruskal

public final class Kruskal
extends Object

Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph.


Constructor Summary
Kruskal()
           
 
Method Summary
static
<V extends Vertex,WE extends WeightedEdge<V>>
Graph<V,WE>
minimumSpanningTree(WeightedGraph<V,WE> graph)
          Calculates the minimum spanning tree (or forest) of the input Graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kruskal

public Kruskal()
Method Detail

minimumSpanningTree

public static <V extends Vertex,WE extends WeightedEdge<V>> Graph<V,WE> minimumSpanningTree(WeightedGraph<V,WE> graph)
Calculates the minimum spanning tree (or forest) of the input Graph.

Type Parameters:
V - the Graph vertices type.
WE - the Graph weighted edges type.
Parameters:
graph - the Graph for which minimum spanning tree (or forest) has to be calculated.
Returns:
the minimum spanning tree (or forest) of the input Graph.


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.