edu.uci.ics.jung.algorithms.shortestpath
Class PrimMinimumSpanningTree<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.shortestpath.PrimMinimumSpanningTree<V,E>
Type Parameters:
V -
E -

public class PrimMinimumSpanningTree<V,E>
extends Object

For the input Graph, creates a MinimumSpanningTree using a variation of Prim's algorithm.

Author:
Tom Nelson - tomnelson@dev.java.net

Field Summary
protected   treeFactory
           
protected   weights
           
 
Constructor Summary
PrimMinimumSpanningTree( factory)
           
PrimMinimumSpanningTree( factory,  weights)
           
 
Method Summary
protected  V findRoot(Graph<V,E> graph)
           
 Graph<V,E> transform(Graph<V,E> graph)
           
protected  void updateTree(Graph<V,E> tree, Graph<V,E> graph, Collection<E> unfinishedEdges)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treeFactory

protected  treeFactory

weights

protected  weights
Constructor Detail

PrimMinimumSpanningTree

public PrimMinimumSpanningTree( factory)

PrimMinimumSpanningTree

public PrimMinimumSpanningTree( factory,
                                weights)
Parameters:
factory -
weights -
Method Detail

transform

public Graph<V,E> transform(Graph<V,E> graph)
Parameters:
graph - the Graph to find MST in

findRoot

protected V findRoot(Graph<V,E> graph)

updateTree

protected void updateTree(Graph<V,E> tree,
                          Graph<V,E> graph,
                          Collection<E> unfinishedEdges)


Copyright © 2008 null. All Rights Reserved.