Package ptolemy.graph.analysis
Class ClusterNodesAnalysis
- java.lang.Object
-
- ptolemy.graph.analysis.Analysis
-
- ptolemy.graph.analysis.ClusterNodesAnalysis
-
public class ClusterNodesAnalysis extends Analysis
Given a collection of nodes in a graph, replace the subgraph induced by the nodes with a single node N. Each edge that connects a node Z outside the subgraph a node inside the subgraph is replaced by an edge (with the same edge weight, if there is one) that connects Z to N. Return the subgraph that is replaced; that is, return the subgraph induced by the given collection of nodes.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Shahrooz Shahparnia based on a file by Shuvra S. Bhattacharyya and Ming-Yung Ko
- See Also:
Graph
- Pt.AcceptedRating:
- Red (ssb)
- Pt.ProposedRating:
- Red (shahrooz)
-
-
Constructor Summary
Constructors Constructor Description ClusterNodesAnalysis(ClusterNodesTransformer analyzer)
Construct an instance of this class with a given analyzer.ClusterNodesAnalysis(Graph graph, java.util.Collection nodeCollection, Node superNode)
Construct an instance of this class for a given graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Graph
clusterNodes()
Return the clustered Graph.java.lang.String
toString()
Return a description of the analysis and the associated analyzer.boolean
validAnalyzerInterface(Analyzer analyzer)
Check if a given analyzer is compatible with this analysis.-
Methods inherited from class ptolemy.graph.analysis.Analysis
analyzer, changeAnalyzer, graph, valid
-
-
-
-
Constructor Detail
-
ClusterNodesAnalysis
public ClusterNodesAnalysis(Graph graph, java.util.Collection nodeCollection, Node superNode)
Construct an instance of this class for a given graph. Given a collection of nodes in a graph, replace the subgraph induced by the nodes with a single node N. Each edge that connects a node Z outside the subgraph a node inside the subgraph is replaced by an edge (with the same edge weight, if there is one) that connects Z to N. Return the subgraph that is replaced; that is, return the subgraph induced by the given collection of nodes.- Parameters:
graph
- The graph.nodeCollection
- The collection of nodes.superNode
- The node that replaces the subgraph.
-
ClusterNodesAnalysis
public ClusterNodesAnalysis(ClusterNodesTransformer analyzer)
Construct an instance of this class with a given analyzer.- Parameters:
analyzer
- The default Analyzer.
-
-
Method Detail
-
clusterNodes
public Graph clusterNodes()
Return the clustered Graph.- Returns:
- Return the clustered Graph.
-
toString
public java.lang.String toString()
Return a description of the analysis and the associated analyzer.
-
validAnalyzerInterface
public boolean validAnalyzerInterface(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 classAnalysis
- Parameters:
analyzer
- The given analyzer.- Returns:
- True if the given analyzer is valid for this analysis.
-
-