Template Class negCycleFinder¶
Defined in File neg_cycle.hpp
Page Contents
Template Parameter Order¶
typename Graph
Class Documentation¶
-
template<typename Graph>
class negCycleFinder¶ negative cycle
Negative cycle detection for weighed graphs.
BF needs a source node.
BF detect whether there is a negative cycle at the fianl stage.
BF restarts the solution (dist[u]) every time.
- Template Parameters
Graph – Note: Bellman-Ford’s shortest-path algorithm (BF) is NOT the best way to detect negative cycles, because