public class FloydWarshallNegativeLengthCycleStrategy extends CachedStrategy implements NegativeLengthCycleAnalyzer
NegativeLengthCycleAnalysis
Constructor and Description |
---|
FloydWarshallNegativeLengthCycleStrategy(Graph graph,
ToDoubleMapping edgeLengths)
Constructs negative cycle detection analyzer for a given graph and
given edge values.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_compute()
The computation associated with the Floyd-Warshall algorithm.
|
boolean |
hasNegativeLengthCycle()
Return true if a negative cycle exists in the graph under analysis.
|
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 FloydWarshallNegativeLengthCycleStrategy(Graph graph, ToDoubleMapping edgeLengths)
graph
- The given graph.edgeLengths
- The lengths associated with the given graph.public boolean hasNegativeLengthCycle()
hasNegativeLengthCycle
in interface NegativeLengthCycleAnalyzer
public java.lang.String toString()
toString
in interface Analyzer
toString
in class CachedStrategy
public boolean valid()
protected java.lang.Object _compute()
_compute
in class CachedStrategy
Boolean
Object
if the graph has
a negative cycle.