1/15
Loading...
🚀Initialize Distances
Set source A distance to 0, others to infinity.
Loading...
Set source A distance to 0, others to infinity.
Bellman-Ford algorithm finds shortest distances from a single source to all other vertices. Unlike Dijkstra, it can handle negative edge weights and detect negative cycles.