0% found this document useful (0 votes)
167 views2 pages

Dijkstra Questions

The document presents two problems involving Dijkstra's algorithm and Kruskal's algorithm to solve optimization problems on networks. For the first problem, Dijkstra's algorithm finds the minimum cost of opening rail lines from town A to E is 56 million pounds. The minimum costs from A to B is 17 million pounds and from A to F is 45 million pounds. Kruskal's algorithm finds the minimum cost to connect all towns is 56 million pounds by opening lines CG, BC, AG, DF, EF, and BD. The second problem uses Dijkstra's algorithm to find the shortest route from town A to H is ACEDGH. With travel speeds, the journey would take 48 minutes. A

Uploaded by

Sam Hnatiuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views2 pages

Dijkstra Questions

The document presents two problems involving Dijkstra's algorithm and Kruskal's algorithm to solve optimization problems on networks. For the first problem, Dijkstra's algorithm finds the minimum cost of opening rail lines from town A to E is 56 million pounds. The minimum costs from A to B is 17 million pounds and from A to F is 45 million pounds. Kruskal's algorithm finds the minimum cost to connect all towns is 56 million pounds by opening lines CG, BC, AG, DF, EF, and BD. The second problem uses Dijkstra's algorithm to find the shortest route from town A to H is ACEDGH. With travel speeds, the journey would take 48 minutes. A

Uploaded by

Sam Hnatiuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

(b) Cars travel on the roads at 30 miles per hour.

(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.

Sir George Monoux Sixth Form College 1


Solutions

1.
(a) 56 (million pounds)

(b) (i) 17

(ii) 45

(c) CG, BC, AG, DF, EF, BD

Cost = 56

(d) AG, GC, CB, BD, DF, FE

2.

(a) ACEDGH

(b) (i) 48 minutes


(ii) New route consists of AD @ 60 mph + DGH @ 30mph
DGH takes 20 minutes

So first part takes 16 minutes and is therefore 16 miles long.

Sir George Monoux Sixth Form College 2

You might also like