Shortest paths that allow negative weights by relaxing every edge up to V times, at O(V·E).
If a V-th round still improves a distance, a negative cycle is reachable from the source.
Shortest paths that allow negative weights by relaxing every edge up to V times, at O(V·E).
If a V-th round still improves a distance, a negative cycle is reachable from the source.