Maths topics › A level Further Maths › D1, algorithms and graphs
Find the shortest path between two vertices using Dijkstra's algorithm
A question
Free worksheet
10 questions on this objective, ready to print.
Download the worksheet (PDF)Worked solution
The working
- Start at U: order 1, final value 0. Each time, update the working values of the vertices joined to the vertex just made permanent, then make the smallest working value permanent.
- U gets permanent label 0 (order 1). Update the working values: K: \(0 + 10 = 10\); N: \(0 + 12 = 12\).
- K gets permanent label 10 (order 2). Update the working values: A: \(10 + 12 = 22\); J: \(10 + 11 = 21\); N: \(10 + 11 = 21\), not better than 12.
- N gets permanent label 12 (order 3). Update the working values: A: \(12 + 5 = 17\) (better than 22); L: \(12 + 2 = 14\).
- L gets permanent label 14 (order 4). Update the working values: A: \(14 + 17 = 31\), not better than 17; F: \(14 + 8 = 22\).
- A gets permanent label 17 (order 5). Update the working values: E: \(17 + 7 = 24\); J: \(17 + 18 = 35\), not better than 21.
- J gets permanent label 21 (order 6). Update the working values: E: \(21 + 9 = 30\), not better than 24.
- F gets permanent label 22 (order 7). Update the working values: E: \(22 + 8 = 30\), not better than 24.
- E gets permanent label 24 (order 8).
- Table: A order 5, final value 17; E order 8, final value 24; F order 7, final value 22; J order 6, final value 21; K order 2, final value 10; L order 4, final value 14; N order 3, final value 12; U order 1, final value 0.
- (a) The length of the shortest route is the final value of E: 24.
- (b) Trace back from E, using edges whose weight equals the difference of the final values: UNAE, \((12 + 5 + 7) = 24\).
- Answers: (a) 24; (b) UNAE.
Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →
Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.