Shortest Paths, Worked (Dijkstra, Bellman-Ford, A*)
Shortest Path Traced · Open board
The same five-town map traced three times, once for each algorithm’s own rule for which road to check next, with the running distance written on every town.
Before you start.Graphs (BFS, DFS, Dijkstra, topological sort) showed you BFS, which finds the shortest path by counting turns, one road at a time: it assumes every road takes the same effort to drive. This lesson breaks that assumption: roads get real lengths, and three different procedures each earn their keep by handling that in a different way.
Lesson 20 of 96 in DSA
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.