A2 October 2021 Q6

EdexcelCurrent spec10 marksAlgorithmsShortest Path

6.

Figure 4: network on A to H with arcs AB 32, AC 16, AD 75, AF 95, BD 33, BE 15, CD 50, CF 70, CG 105, CH 113, DE 17, DG 50, EF 30, FG 25, FH 41, GH 10
Figure 4

In Figure 4 the weights on the arcs represent distances.

(a)
(i) Use Dijkstra’s algorithm to find the shortest path from A to H.
(ii) State the length of the shortest path from A to H. (6)

One application of Dijkstra’s algorithm has order \(n^2\), where \(n\) is the number of nodes in the network. A computer produces a table of shortest distances between any two different nodes by repeatedly applying Dijkstra’s algorithm from each node of the network.

It takes the computer 0.082 seconds to produce a table of shortest distances for a network of 10 nodes.

(b) Calculate approximately how long it will take, in seconds, for the computer to produce a table of shortest distances for a network with 200 nodes. You must give a reason for your answer. (3)
(c) Explain why your answer to part (b) can only be an approximation. (1)