What is Dijkstra’s Algorithm?
Dijkstra’s algorithm finds least cost graph paths by expanding the smallest known cost from the start. It updates cheaper connections and reconstructs routes through parent links, without using a goal heuristic.
The key idea
Dijkstra’s algorithm requires nonnegative edge costs. It repeatedly selects the unvisited node with the smallest known cost from the start, then updates neighboring routes when a cheaper connection is found. A delivery robot can represent aisles as graph edges with travel costs. When an improved route reaches a node, its stored cost and parent change. Following parent links backward from the goal recovers the final path. Because Dijkstra’s algorithm does not estimate the distance still remaining, it may explore more nodes than a well guided A* search.
What to remember
- Expand the unvisited node with the lowest known cost.
- Update both cost and parent when a cheaper route is found.
- Nonnegative edge costs are required.
Check your understanding
How is the completed route recovered?
Show the explanation
Follow the stored parent links backward from the goal.