mascoptLib.algos.abstractalgos
Class PrimMST

java.lang.Object
  |
  +--mascoptLib.algos.abstractalgos.PrimMST

public class PrimMST
extends Object

This class computes the Minimum Spanning Tree of a graph G given a context. Two methods are provided, MSTEdgeSet computes the tree and outputs the AbstractEdgeSet containing the tree and MSTValue outputs the value of the tree. Please note that at this moment only integer are supported as values for the edges.

Author:
Yann Verhoeven

Constructor Summary
PrimMST(mascoptLib.abstractGraph.AbstractGraph g)
          Simple constructor.
 
Method Summary
 Iterator computeMST(String entryType)
          This method computes the Minimum Spanning Tree of the graph
 Iterator getMstEdgeSetIterator(String entryType)
          This method provides an iterator over the edges of the Minimum Spanning Tree of the graph.
 Double getMSTSize(String entryType)
          This method provides the value of the Minimum Spanning Tree of the graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimMST

public PrimMST(mascoptLib.abstractGraph.AbstractGraph g)
Simple constructor. Simply constructs the object, does not do any computation.

Method Detail

getMSTSize

public Double getMSTSize(String entryType)
This method provides the value of the Minimum Spanning Tree of the graph. The value is the one computed over the edges with the entry type entryType. It must be remarked that if the Minimum Spanning Tree has not been previously computed, it will be done now.

Parameters:
entryType - the entry type to consider when taking the values of the edges.
Returns:
the weight of the MST.

getMstEdgeSetIterator

public Iterator getMstEdgeSetIterator(String entryType)
This method provides an iterator over the edges of the Minimum Spanning Tree of the graph. The MST is the one computed over the edges with the entry type entryType. It must be remarked that if the Minimum Spanning Tree has not been previously computed, it will be done now. Otherwise, the stored value will be used. If the input graph has changed, one should consider to compute again the MST before calling this method.

Parameters:
entryType - the entry type to consider when taking the values of the edges.
Returns:
an iterator over the set of edges of the MST.
See Also:
computeMST(String entryType)

computeMST

public Iterator computeMST(String entryType)
This method computes the Minimum Spanning Tree of the graph

Parameters:
entryType - the entry type to consider when taking the values of the edges.
Returns:
an iterator over the set of edges of the MST.