public class BellmanFordAlgorithm extends WeightedSingleSourceSearchAlgorithm
Constructor and Description |
---|
BellmanFordAlgorithm(NumericalProperty weights) |
Modifier and Type | Method and Description |
---|---|
SearchResult |
compute(Grph graph,
int source,
Grph.DIRECTION d,
GraphSearchListener listener) |
protected SearchResult[] |
createArray(int n) |
boolean |
hasNegativeWeightCycles(Grph graph,
SearchResult r) |
static void |
main(java.lang.String[] args) |
getWeightProperty
compute, compute, compute, compute, compute, computeDistanceMatrix, computePredecessorMatrix
cacheResultForGraph, getSourceCode
public BellmanFordAlgorithm(NumericalProperty weights)
public SearchResult compute(Grph graph, int source, Grph.DIRECTION d, GraphSearchListener listener)
compute
in class SingleSourceSearchAlgorithm<SearchResult>
public boolean hasNegativeWeightCycles(Grph graph, SearchResult r)
protected SearchResult[] createArray(int n)
createArray
in class SingleSourceSearchAlgorithm<SearchResult>
public static void main(java.lang.String[] args)