public class FloydWarshallAllPairShortestPathStrategy extends FloydWarshallStrategy implements AllPairShortestPathAnalyzer
AllPairShortestPathAnalysis
Constructor and Description |
---|
FloydWarshallAllPairShortestPathStrategy(Graph graph,
ToDoubleMapping edgeLengths)
Construct an AllPairShortestPathAnalyzer which works using the
Floyd-Warshall strategy.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_compute()
Compute the all pair shortest path of the graph in the form of
two dimensional array (matrix).
|
protected void |
_floydWarshallComputation(int k,
int i,
int j)
The FloydWarshall computation associated with this,
analysis.
|
java.util.List |
shortestPath(Node startNode,
Node endNode)
Return the nodes on the shortest path from the node
startNode to the node endNode in the form of an ordered list.
|
double |
shortestPathLength(Node startNode,
Node endNode)
Return the length of the shortest path from the node
startNode to the node endNode.
|
double[][] |
shortestPathMatrix()
Return the all pair shortest path of the graph in the form of
two dimensional array (matrix).
|
java.lang.String |
toString()
Return a description of the analyzer.
|
boolean |
valid()
Check for compatibility between the analysis and the given
graph.
|
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
graph
public FloydWarshallAllPairShortestPathStrategy(Graph graph, ToDoubleMapping edgeLengths)
graph
- The given graph.edgeLengths
- The edge lengths.public java.util.List shortestPath(Node startNode, Node endNode)
shortestPath
in interface AllPairShortestPathAnalyzer
startNode
- The starting node of the path.endNode
- The ending node of the path.public double shortestPathLength(Node startNode, Node endNode)
shortestPathLength
in interface AllPairShortestPathAnalyzer
startNode
- The starting node of the path.endNode
- The end node of the path.public double[][] shortestPathMatrix()
shortestPathMatrix
in interface AllPairShortestPathAnalyzer
Graph.nodeLabel(ptolemy.graph.Node)
public java.lang.String toString()
toString
in interface Analyzer
toString
in class CachedStrategy
public boolean valid()
protected java.lang.Object _compute()
_compute
in class FloydWarshallStrategy
protected final 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.