1.
Dijkstra's algorithm
Order of labelling, final values, working values — then trace the route back from the destination.
Question
Every step worked, with the reasoning.
- 1Label : order 1, final value . Working values: , .
Start at ; each vertex joined directly to it gets a working value equal to the edge weight.
- 2Label : order 2, final value . Update , , .
Make the smallest working value permanent, then replace a neighbour's working value only if the new route is shorter.
- 3Label : order 3, final value . Update .
now has the smallest working value; its only unlabelled neighbour is .
- 4Label : order 4, final value . Update , .
Both of 's unlabelled neighbours get new working values.
- 5Label : order 5, final value . Update . Label : order 6, final value .
Stop once the destination is permanently labelled.
- 6Trace back from : (), (), (), (), ().
Edge lies on the route when (final value at ) (final value at ) weight of .
Answer: Shortest route , length
Stuck on Dijkstra's algorithm?
Everything here stays free. If Dijkstra's algorithm is where the marks keep going, I teach it one to one from the mark schemes. Free intro call, then a free first lesson.