Lesson 02 of 05 · about 5 min

Shortest path

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Dijkstra grows a frontier of settled nodes. A node is settled when every path still outside the frontier is at least as long as the path you already have. Edge weights here are positive, so the first time you settle D, that distance is the shortest.

Edges: A→B 2, A→C 5, B→C 1, B→D 4, C→D 1. Enter the length of the shortest path from A to D.

On the Knowledge page

Resources