Shortest Path Algorithms (Edexcel A Level Further Maths: Decision Maths 1)

Topic Questions

1a
Sme Calculator
6 marks

Write your answer in the Answer Booklet.

q1-8fmo-27-june-2018

Figure 1

Figure 1 represents a network of roads.
The number on each arc represents the time taken, in minutes, to drive along the corresponding road.

(i)
Use Dijkstra’s algorithm to find the shortest time needed to travel from A to H. 

(ii)
State the quickest route. 

1b
Sme Calculator
2 marks

For a network with n vertices, Dijkstra’s algorithm has order n squared

If it takes 1.5 seconds to run the algorithm when n = 250, calculate approximately how long it will take, in seconds, to run the algorithm when n = 9500. You should make your method and working clear.

1c
Sme Calculator
1 mark

Explain why your answer to the previous part is only an approximation.

Did this page help you?

2a
Sme Calculator
2 marks

q3-fig-2-june-2019-9fm0-3d

Figure 2

The network in Figure 2 shows the direct roads linking five villages, A, B, C, D and E.
The number on each arc represents the length, in miles, of the corresponding road.
The roads from A to E and from C to B are one-way, as indicated by the arrows.

Complete the initial distance and route tables for the network provided in the answer book.

2b
Sme Calculator
5 marks

Write your answer in the Answer Book.

Perform the first three iterations of Floyd’s algorithm. You should show the distance table and the route table after each of the three iterations.

2c
Sme Calculator
3 marks

After five iterations of Floyd’s algorithm the final distance table and partially completed final route table are shown below.

Distance table Route table
  A B C D E
A 12 7 6 3
B 15 22 21 18
C 7 5 4 7
D 11 9 4 3
E 14 12 7 3
  A B C D E
A A        
B A B      
C A B C    
D C C C D  
E D D D D E

(i)
Explain how the partially completed final route table can be used to find the shortest route from E to A.
 
(ii)
State this route. 
2d
Sme Calculator
4 marks

Mabintou decides to use the distance table to try to find the shortest cycle that passes through each vertex. Starting at D, she applies the nearest neighbour algorithm to the final distance table.

(i)
State the cycle obtained using the nearest neighbour algorithm. 

(ii)
State the length of this cycle. 

(iii)
Interpret the cycle in terms of the actual villages visited.

(iv)
Prove that Mabintou’s cycle is not optimal.

Did this page help you?

3a
Sme Calculator
2 marks

Write your answer in the Answer Booklet.

fig-2-november-2020-9fm0-3d

Figure 2

Direct roads between five villages, A, B, C, D and E, are shown in Figure 2. The weight on each arc is the time, in minutes, it takes to travel along the corresponding road. The road from D to C is one-way as indicated by the arrow on the corresponding arc.

Floyd’s algorithm is to be used to find the complete network of shortest times between the five villages.

Set up initial time and route matrices.

3b
Sme Calculator
4 marks

Write your answer in the Answer Booklet.

The matrices after two iterations of Floyd’s algorithm are shown below.

q3b-november-2020-9fm0-3d

Perform the next two iterations of Floyd’s algorithm that follow from the tables above. You should show the time and route matrices after each iteration.

3c
Sme Calculator
3 marks

The final time matrix after completion of Floyd’s algorithm is shown below.

Final time matrix

  A B C D E
A 7 4 7 8
B 7 3 10 9
C 4 3 7 6
D 5 4 1 1
E 6 5 2 1

(i)
Use the nearest neighbour algorithm, starting at A, to find a Hamiltonian cycle in the complete network of shortest times.
(ii)
Find the time taken for this cycle.
(iii)
Interpret the cycle in terms of the actual villages visited.

Did this page help you?

4a
Sme Calculator
2 marks

fig-4-november-2020-9fm0-3d

Figure 4

left square bracket T h e space t o t a l space w e i g h t space o f space t h e space n e t w o r k space i s space 320 space plus space x space plus space y right square bracket

State, with justification, whether the graph in Figure 4 is Eulerian, semi-Eulerian or neither.

4b
Sme Calculator
9 marks

Write your answer in the Answer Booklet.

The weights on the arcs in Figure 4 represent distances. The weight on arc EF is x where 12 space less than space x space less than space 26 and the weight on arc DG is y where 0 space less than space y space less than space 10

An inspection route of minimum length that traverses each arc at least once is found.
The inspection route starts and finishes at straight A and has a length of 409

It is also given that the length of the shortest route from straight F to straight G via straight A is 140

Using appropriate algorithms, find the value of x and the value of y.

Did this page help you?

5a
Sme Calculator
1 mark

fig-2-oct-2021-8fm0-27

Figure 2

Dijkstra’s algorithm has been applied to the network in Figure 2.

A working value has only been replaced at a node if the new working value is smaller.

State the length of the shortest path from A to G.

5b
Sme Calculator
3 marks

Complete the table in the answer book giving the weight of each arc listed.
(Note that arc CE and arc EF are not in the table.)

5c
Sme Calculator
1 mark

State the shortest path from A to G.

5d
Sme Calculator
3 marks

It is now given that

  • when Prim’s algorithm, starting from A, is applied to the network, the order in which the arcs are added to the tree is AB, BC, CD, CE, EF and FG
  • the weight of the corresponding minimum spanning tree is 80
  • the shortest path from A to F via E has weight 67

Determine the weight of arc CE and the weight of arc EF, making your reasoning clear.

Did this page help you?

6a
Sme Calculator
1 mark

fig-3-november-2021-9fm0-3d

Figure 3

left square bracket T h e space t o t a l space w e i g h t space o f space t h e space n e t w o r k space i s space 1648 right square bracket

Direct roads between six cities, A, B, C, D, E and F, are represented in Figure 3. The weight on each arc is the time, in minutes, required to travel along the corresponding road.

Floyd’s algorithm is to be used to find the complete network of shortest times between the six cities.

An initial route matrix is given in the answer book.

Set up the initial time matrix.

6b
Sme Calculator
2 marks

Write your answer in the Answer Booklet.

Perform the first iteration of Floyd’s algorithm. You should show the time and route matrices after this iteration.

6c
Sme Calculator
4 marks

The final time matrix after completion of Floyd’s algorithm is shown below.

  A B C D E F
A 57 95 147 63 220
B 57 72 204 120 197
C 95 72 242 158 125
D 147 204 242 84 275
E 63 120 158 84 191
F 220 197 125 275 191

A route is needed that minimises the total time taken to traverse each road at least once.

The route must start at B and finish at E.

Use an appropriate algorithm to find the roads that will need to be traversed twice.
You should make your method and working clear.

6d
Sme Calculator
1 mark

Write down the length of the route.

Did this page help you?

7a
Sme Calculator
6 marks

Write your answer in the Answer Booklet.

fig-4-november-2021-9fm0-3d

Figure 4

In Figure 4 the weights on the arcs represent distances.

(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.
7b
Sme Calculator
3 marks

One application of Dijkstra’s algorithm has order n squared, 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.

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.

7c
Sme Calculator
1 mark

Explain why your answer to part (b) can only be an approximation.

Did this page help you?

8a
Sme Calculator
1 mark

fig-3-specimen-2017-9fm0-3d

Figure 3

The network in Figure 3 shows the roads linking a depot, D, and three collection points A, B and C. The number on each arc represents the length, in miles, of the corresponding road. The road from B to D is a one-way road, as indicated by the arrow.

Explain clearly if Dijkstra’s algorithm can be used to find a route from D to A.

8b
Sme Calculator
7 marks

The initial distance and route tables for the network are given in the answer book.

Use Floyd’s algorithm to find a table of least distances. You should show both the distance table and the route table after each iteration.

8c
Sme Calculator
2 marks

Explain how the final route table can be used to find the shortest route from D to B.
State this route.

8d
Sme Calculator
2 marks

Find a minimum route and state its length.

8e
Sme Calculator
2 marks

Floyd’s algorithm and Dijkstra’s algorithm are applied to a network. Each will find the shortest distance between vertices of the network.

Describe how the results of these algorithms differ.

Did this page help you?