Start here · Essential guide
Dijkstra Algorithm vs. Bellman-Ford
Dijkstra and Bellman-Ford both find shortest paths from one start vertex. Compare their speed, edge weight limits, negative cycle handling and best uses.
Algorithms
How Dijkstra and Bellman-Ford find shortest paths, their limits and how Dijkstra differs from Prim.
Start here · Essential guide
Dijkstra and Bellman-Ford both find shortest paths from one start vertex. Compare their speed, edge weight limits, negative cycle handling and best uses.
Dijkstra and Prim's both use greedy steps, but they solve different problems: shortest paths versus a minimum spanning tree. See how they differ.
There is no single official list of algorithm types. Learn seven common design approaches, with a classic example of each and how they overlap.
Dijkstra's algorithm cannot handle negative edge weights or detect negative cycles. Here are its other limits, and when another method fits better.
Bellman-Ford finds shortest paths from one source vertex, even when some edges are negative. Learn how it relaxes edges and detects negative cycles.
Related topics