uk.ac.ed.computational_geometry.util
Class MinimalSpanningTree<Value>

java.lang.Object
  extended by uk.ac.ed.computational_geometry.util.MinimalSpanningTree<Value>

public class MinimalSpanningTree<Value>
extends Object

User: nix Date: 16-Mar-2005 Time: 15:53:50 To change this template use Options | File Templates.


Nested Class Summary
static class MinimalSpanningTree.Node<Value>
           
 
Field Summary
protected  UndirectedGraph<Value> graph
           
protected  HashMap<Value,MinimalSpanningTree.Node> nodes
           
protected  List<MinimalSpanningTree.Node> roots
           
protected  List<UndirectedGraph.Edge<Value>> tree_edges
           
 
Constructor Summary
MinimalSpanningTree(UndirectedGraph<Value> graph)
           
MinimalSpanningTree(UndirectedGraph<Value> graph, Value root_value)
           
 
Method Summary
protected  void buildUsingKruskalsAlgorithm()
           
protected  void buildUsingPrimsAlgorithm(Value root_value)
           
 List<UndirectedGraph.Edge<Value>> getEdges()
           
 List<MinimalSpanningTree.Node> getRoots()
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected UndirectedGraph<Value> graph

nodes

protected HashMap<Value,MinimalSpanningTree.Node> nodes

roots

protected List<MinimalSpanningTree.Node> roots

tree_edges

protected List<UndirectedGraph.Edge<Value>> tree_edges
Constructor Detail

MinimalSpanningTree

public MinimalSpanningTree(UndirectedGraph<Value> graph,
                           Value root_value)

MinimalSpanningTree

public MinimalSpanningTree(UndirectedGraph<Value> graph)
Method Detail

getRoots

public List<MinimalSpanningTree.Node> getRoots()

getEdges

public List<UndirectedGraph.Edge<Value>> getEdges()

buildUsingPrimsAlgorithm

protected void buildUsingPrimsAlgorithm(Value root_value)

buildUsingKruskalsAlgorithm

protected void buildUsingKruskalsAlgorithm()

main

public static void main(String[] args)