public class FloydWarshallTransitiveClosureStrategy extends FloydWarshallStrategy implements TransitiveClosureAnalyzer
The complexity of this algorithm is O(N^3), where N is the number of nodes.
Graph.nodeLabel(ptolemy.graph.Node)
,
TransitiveClosureAnalysis
Constructor and Description |
---|
FloydWarshallTransitiveClosureStrategy(Graph graph)
Construct a transitive closure analysis for a given directed graph.
|
Modifier and Type | Method and Description |
---|---|
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.
|
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
graph
public FloydWarshallTransitiveClosureStrategy(Graph graph)
graph
- The given directed graph.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.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.