annas.graph.util
Class Prim<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.util.Prim<N,A>
Type Parameters:
N - Node type
A - Arc type

public class Prim<N,A extends ArcInterface<N>>
extends java.lang.Object

Determines a minimal spanning tree for an Undirected graph, as described here

Author:
Sam Wilson

Constructor Summary
Prim(GraphInterface<N,A> graph)
           
 
Method Summary
 GraphInterface<N,DefaultArc<N>> execute()
          Executes Prim's algorithm
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Prim

public Prim(GraphInterface<N,A> graph)
Method Detail

execute

public GraphInterface<N,DefaultArc<N>> execute()
Executes Prim's algorithm

Returns:
An Undirected Graph representing the minimal spanning tree of the specified graph.