mapss.dif.csdf.sdf
Class SDFGraphs

java.lang.Object
  extended by mapss.dif.csdf.sdf.SDFGraphs

public class SDFGraphs
extends java.lang.Object

Utilities for working with SDF graphs.

Version:
$Id: SDFGraphs.java 406 2007-05-10 14:27:07Z plishker $
Author:
Ming-Yung Ko
See Also:
Graph, SDFGraph

Method Summary
static SDFGraph clusterNodes(SDFGraph graph, java.util.Collection nodeCollection, mocgraph.Node superNode)
          Given a collection of nodes in a SDF graph, replace the subgraph induced by the nodes with a single node N.
static java.util.List clusterNodesComplete(SDFGraph graph, java.util.Collection nodeCollection, mocgraph.Node superNode)
          Given a collection of nodes in a SDF graph, replace the subgraph induced by the nodes with a single node N.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clusterNodes

public static SDFGraph clusterNodes(SDFGraph graph,
                                    java.util.Collection nodeCollection,
                                    mocgraph.Node superNode)
Given a collection of nodes in a SDF graph, replace the subgraph induced by the nodes with a single node N. Besides topological clustering, this method also adjusts the token exchanging rates on affected edges and smartly computes repetitions of the newly created super node.

Parameters:
graph - The SDF graph.
nodeCollection - The collection of nodes.
superNode - The SDF node that replaces the subgraph.
Returns:
The subgraph that is replaced.

clusterNodesComplete

public static java.util.List clusterNodesComplete(SDFGraph graph,
                                                  java.util.Collection nodeCollection,
                                                  mocgraph.Node superNode)
Given a collection of nodes in a SDF graph, replace the subgraph induced by the nodes with a single node N. This method returns both the subgraph and a map from newly created edges to old edges replaced. The map is important for cluster status tracking.

Parameters:
graph - The SDF graph.
nodeCollection - The collection of nodes.
superNode - The SDF node that replaces the subgraph.
Returns:
A list with the first element the subgraph and the second element a map of edges.