Data and algorithms · 5 min
Shortest paths
Learn Dijkstra's algorithm.
What the sources describe
In 1956, the Dutch computer scientist Edsger Dijkstra was shopping in Amsterdam with his fiancée. Resting on a café terrace, he designed a method for finding the shortest route between two places in about 20 minutes, without pen and paper. He wanted a problem ordinary people could understand to demonstrate a new computer.
His algorithm works by always exploring the closest place not yet settled. Starting from the beginning point, it records the shortest known distance to each neighbouring place, then repeatedly picks the nearest unsettled place and updates distances through it. When the destination is settled, its shortest route is known.
Dijkstra published the method in 1959. It works when all distances are zero or positive; other methods handle negative values. In 1968, researchers built on it with the A-star algorithm, which uses estimates of remaining distance to search faster.
Versions of these ideas help power route planning in navigation apps and the routing of data across the internet. Dijkstra later said that one reason the design was so elegant was that he had to avoid unnecessary complexity without pencil and paper.
Connecting the ideas
In 1956, Edsger Dijkstra designed a shortest-route algorithm in about 20 minutes at an Amsterdam café; it repeatedly settles the nearest unexplored place and helps power navigation and internet routing.
The big idea
Simple, step-by-step rules can solve problems that seem complicated.
Use it in real life
Draw a small map of five places you visit, such as home, school, shops and a park, with distances between them. Use Dijkstra's method by hand: start at home, settle the closest place and update distances. Find the shortest route to the furthest place, then check it against a map app.
Try it
Made-up example: How does Dijkstra's algorithm choose what to explore next?
A good answer: it always picks the closest place not yet settled.
Quick quiz
1. Why did Dijkstra choose a shortest-route problem for his demonstration?
2. When does Dijkstra's algorithm work correctly?
3. How does the A-star algorithm improve on it?
Finished reading?
Make this the next Doom video?
Vote for the lessons you'd most like to see turned into a short animated story.
How was this lesson?
No ratings yet — be the first.
Sign in to rateSources
Limitations
The original paper is linked (the publisher blocks automated reads, so only its listing was confirmed); other details rely on Wikipedia.
Voice: Debby — Soft and soothing (tap to change)
Debby narration · part 1 of 15
