Settle the smallest first.
transcript
A courier map. Every road has a cost. Which junction do you settle next? The one you can reach soonest. Dijkstra's algorithm picks it with a min heap. Watch it run on this map.
Start at zero. It gets distance zero. Take it. Relax its roads. One gets four. Two gets one. The smallest entry is one. Junction two is final. One plus two is three. That beats four. Three is next. Junction one is final. Four for junction one is stale. Skip it.
A min heap hands out the smallest entry. Every time, whatever order they arrived in. That is why the smallest distance is final. Nothing waiting can beat it. Every road costs zero or more.
Breadth first search takes the oldest entry. Dijkstra takes the smallest distance. Same idea. A different rule for who goes next.
Take the smallest. Relax its roads. Skip any stale entry. Distances grow in order, like ripples. Full breakdown in the lecture.