mapss.dif.graph
Class MinimumSpanningTreeAnalysis

java.lang.Object
  extended by mocgraph.analysis.Analysis
      extended by mapss.dif.graph.MinimumSpanningTreeAnalysis

public class MinimumSpanningTreeAnalysis
extends mocgraph.analysis.Analysis

Computation of a minimum spanning tree in a graph.

The returned list cannot be modified when the client uses the default strategy.

Since:
Ptolemy II 2.0
Version:
$Id: MinimumSpanningTreeAnalysis.java 409 2007-05-13 19:47:16Z plishker $
Author:
Shuvra S. Bhattacharyya

Constructor Summary
MinimumSpanningTreeAnalysis(mocgraph.Graph graph, mocgraph.mapping.ToDoubleMapping edgeWeights)
          Construct an instance of this class for a given graph.
MinimumSpanningTreeAnalysis(MinimumSpanningTreeAnalyzer analyzer)
          Construct an instance of this class using a given analyzer.
 
Method Summary
 java.util.List edges()
          Return the edges in the computed minimum spanning tree.
 java.lang.String toString()
          Return a description of the analysis and the associated analyzer.
 boolean validAnalyzerInterface(mocgraph.analysis.analyzer.Analyzer analyzer)
          Check if a given analyzer is compatible with this analysis.
 double weight()
          Return the weight (sum of edge weights) of a minimal spanning tree.
 
Methods inherited from class mocgraph.analysis.Analysis
analyzer, changeAnalyzer, graph, valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MinimumSpanningTreeAnalysis

public MinimumSpanningTreeAnalysis(mocgraph.Graph graph,
                                   mocgraph.mapping.ToDoubleMapping edgeWeights)
Construct an instance of this class for a given graph.

Parameters:
graph - The given graph.
edgeWeights - The edge weights.

MinimumSpanningTreeAnalysis

public MinimumSpanningTreeAnalysis(MinimumSpanningTreeAnalyzer analyzer)
Construct an instance of this class using a given analyzer.

Parameters:
analyzer - The given analyzer.
Method Detail

edges

public java.util.List edges()
Return the edges in the computed minimum spanning tree. Each element of the list is an Edge.

Returns:
The spanning tree edges.

toString

public java.lang.String toString()
Return a description of the analysis and the associated analyzer.

Overrides:
toString in class mocgraph.analysis.Analysis
Returns:
A description of the analysis and the associated analyzer.

validAnalyzerInterface

public boolean validAnalyzerInterface(mocgraph.analysis.analyzer.Analyzer analyzer)
Check if a given analyzer is compatible with this analysis. In other words if it is possible to use it to compute the computation associated with this analysis.

Overrides:
validAnalyzerInterface in class mocgraph.analysis.Analysis
Parameters:
analyzer - The given analyzer.
Returns:
True if the given analyzer is valid for this analysis.

weight

public double weight()
Return the weight (sum of edge weights) of a minimal spanning tree.

Returns:
The weight of a minimal spanning tree.