Analysis
0
Relaxations
O(0)
Complexity (V X E)
Tap individual nodes to see the shortest paths from the source node
Negative Cycle Detection:
for (const { u, v, w } of edges)
if (dist[u] + w < dist[v]) → Negative cycle!
After V-1 iterations, if any edge can still be relaxed, the graph contains a negative cycle.