Dijkstra Questions
Dijkstra Questions
1. A railway company is considering opening some new lines between seven towns A G.
The possible lines and the cost of setting them up (in millions of pounds) are shown in the following network.
B 20 D
20 20
5
30
A 10 C 8 E
4 35
8 11
G 40 F
(a) Use Dijkstras algorithm on the diagram above to find the minimum cost of opening lines from A to E.
Show all your workings at each vertex.
(b) From your workings in part (a) write down the minimum cost of opening lines:
(i) from A to B
(ii) from A to F
(c) Use Kruskals algorithm to find the minimum cost of opening lines so that it is possible to travel
between any two of the towns by rail, and state the lines which should be opened in order to achieve
this minimum cost.
(d) The rail company wants to open some of the lines so that it is possible to travel by rail starting at one
town, finishing at another and passing through each of the other five towns exactly once. Which lines
should the rail company open in order to do this as cheaply as possible?
2. The network shows the distances, in miles, on main roads between eight towns AH.
B 8 D 6 F
7 6
A 3 11 4 5 4 H
5 5
C 5 E 10 G
(a) Use Dijkstras algorithm on the figure above to find the shortest route from A to H on these roads.
Show all your working.
(i) Calculate how many minutes the journey of shortest length from A to H will take.
(ii) A new major road is opened from A to D along which cars will be able to travel at 60 miles per
hour. This new road will enable the journey time from A to H to be reduced to 36 minutes.
Calculate the length of the new road from A to D.
1.
(a) 56 (million pounds)
(b) (i) 17
(ii) 45
Cost = 56
2.
(a) ACEDGH