A2 June 2025 Q3

EdexcelCurrent spec10 marksShortest PathTravelling Salesman

3.

Figure 1: network on villages A to G with arcs AG 11, GF 12, GE 24 (one-way from G to E), GC 47, AE 35, AB 9 (one-way from A to B), AD 25 (one-way from A to D), BF 35, BD 8, BC 40, CD 17, FE 14, FD 31, ED 11
Figure 1

Direct roads between seven villages, A, B, C, D, E, F and G, are represented in Figure 1. The weight on each arc is the time, in minutes, taken to travel along the corresponding road. Three roads, AB, AD and GE, are 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 seven villages.

(a) Set up an initial time matrix for this network. (2)

The time matrix after three iterations of Floyd’s algorithm is shown below.

ABCDEFG
A–94917354411
B∞–408∞3587
C∞40–17∞7547
D∞817–113164
E35448411–1446
F∞35753114–12
G112047282412–
(b) Perform the next two iterations of Floyd’s algorithm that follow from the table above.
You should show only the time matrix after each iteration. (5)

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

ABCDEFG
A–93417282311
B54–258193345
C5825–17284247
D46817–112537
E35192811–1426
F2332422514–12
G112045282412–

Albert must visit each village. He will start and finish at B and wishes to minimise the total time taken to visit each village.

(c)
(i) Use the nearest neighbour algorithm, starting at B, to find a Hamiltonian cycle in the complete network of shortest times shown above.
(ii) Find the total travel time for this cycle.
(iii) Given that he travels the Hamiltonian cycle found in (c)(i), interpret this cycle in terms of the actual villages visited by Albert. (3)