How a map app finds your route, in 3 small steps · part 2 of 3 · Dijkstra's algorithm: relaxation and settling

How does a map app find the fastest route without trying them all?

Every junction gets a best time so far. Dijkstra’s algorithm locks the closest unfinished junction, offers new times to its neighbours (relaxation), and repeats until College is settled at 12 minutes. Then the came-from arrows give the route.

What you turn: Travel time on a road

The reel

The full lesson · 6:26

The long version

The same idea, slower: more examples, and pauses to try each step yourself.