org.enhydra.shark.xpdl
Class GraphChecker

java.lang.Object
  extended by org.enhydra.shark.xpdl.GraphChecker

public class GraphChecker
extends java.lang.Object

You can use this class to check if the graph is cyclic, or to find index of corresponding join node for the given split node index. When constructing class, you have to pass it the incidence matrix, which has to be the two-dimensional array of booleans , where the rows and column indexes represents the graph node indexes, and values represents if there is a connection between these nodes. If there is connection from node i to the node j it is represented by putting true into j'th column of the i'th row.


Constructor Summary
GraphChecker(boolean[][] matParam)
          Constructs the GraphChecker object.
 
Method Summary
 int[] getCyclicNodes()
           
 int getJoinIndex(int nodeX)
          Returns index of corresponding join node for the given split node index.
 boolean isGraphCyclic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphChecker

public GraphChecker(boolean[][] matParam)
Constructs the GraphChecker object.

Parameters:
matParam - The two dimensional array of booleans representing the graphs incidence matrix.
Method Detail

isGraphCyclic

public boolean isGraphCyclic()
Returns:
true if the graph is cyclic, and false otherwise.

getCyclicNodes

public int[] getCyclicNodes()
Returns:
The array of graph node indexes that are within some graph cycle. If the graph is not cyclic, returns null.

getJoinIndex

public int getJoinIndex(int nodeX)
Returns index of corresponding join node for the given split node index.

Parameters:
nodeX - The index of split node
Returns:
Index of corresponding join node if it exists, -1 otherwise.