Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

Update BellmanFordAdjacencyList.java

Open choprasaurav7 opened this issue 3 years ago • 1 comments
trafficstars

The relaxation should be running n-1 times. We don't need to run the algo again n-1 times but only once on each edge to see if the value decreases and then we can confirm a negative cycle

choprasaurav7 avatar Jul 16 '22 23:07 choprasaurav7

issue : https://github.com/williamfiset/Algorithms/issues/316

choprasaurav7 avatar Jul 16 '22 23:07 choprasaurav7