π LoopI sweep every single edge, in order, once per full loop. I don't stop early just because nothing changed this time β I always complete exactly V-1 full sweeps.
β οΈ DetectorAfter all V-1 loops are done, I run one more sweep just to check. If even one edge still wants to improve, that's impossible in a normal graph β it means a negative cycle exists.
Pick a level above to begin.