|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.graph.analysis.strategy.Strategy
ptolemy.graph.analysis.strategy.CachedStrategy
ptolemy.graph.analysis.strategy.FloydWarshallStrategy
ptolemy.graph.analysis.strategy.FloydWarshallTransitiveClosureStrategy
public class FloydWarshallTransitiveClosureStrategy
Computation of transitive closure of a directed graph using the Floyd-Warshall algorithm described in: Thomas H. Cormen, Charles E. Leiserson and Ronald L. Rivest: Introduction to Algorithms. Cambridge: MIT Press, 1990.
The complexity of this algorithm is O(N^3), where N is the number of nodes.
Graph.nodeLabel(ptolemy.graph.Node)
,
TransitiveClosureAnalysis
Red (ssb) |
Red (shahrooz) |
Field Summary | |
---|---|
private boolean[][] |
_transitiveClosure
|
Constructor Summary | |
---|---|
FloydWarshallTransitiveClosureStrategy(Graph graph)
Construct a transitive closure analysis for a given directed graph. |
Method Summary | |
---|---|
protected java.lang.Object |
_compute()
The computation associated with the Floyd-Warshall algorithm. |
protected void |
_floydWarshallComputation(int k,
int i,
int j)
Overrides the computation associated with the implementation of the Floyd-Warshall algorithm, for the purpose of computing the transitive closure. |
boolean |
pathExistence(Node startNode,
Node endNode)
Check if there exist a path between a starting node and an ending node on the analyzer's graph. |
java.lang.String |
toString()
Return a description of the analyzer. |
boolean[][] |
transitiveClosureMatrix()
Compute the transitive closure of the graph under analysis in the form of two dimensional array. |
boolean |
valid()
Check for validity of this strategy. |
Methods inherited from class ptolemy.graph.analysis.strategy.CachedStrategy |
---|
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.graph.analysis.analyzer.GraphAnalyzer |
---|
graph |
Field Detail |
---|
private boolean[][] _transitiveClosure
Constructor Detail |
---|
public FloydWarshallTransitiveClosureStrategy(Graph graph)
graph
- The given directed graph.Method Detail |
---|
public boolean pathExistence(Node startNode, Node endNode)
pathExistence
in interface TransitiveClosureAnalyzer
startNode
- The starting node.endNode
- The ending node.
public java.lang.String toString()
toString
in interface Analyzer
toString
in class CachedStrategy
public boolean[][] transitiveClosureMatrix()
transitiveClosureMatrix
in interface TransitiveClosureAnalyzer
Graph.nodeLabel(ptolemy.graph.Node)
public boolean valid()
DirectedGraph
in order
to use this algorithm.
valid
in interface Analyzer
protected java.lang.Object _compute()
_compute
in class FloydWarshallStrategy
Object
in order to be stored in the result-cache.protected void _floydWarshallComputation(int k, int i, int j)
_floydWarshallComputation
in class FloydWarshallStrategy
k
- The counting parameter of the first loop of the Floyd-Warshall
computation.i
- The counting parameter of the second loop of the Floyd-Warshall
computation.j
- The counting parameter of the third and last loop of the
Floyd-Warshall computation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |