A2 October 2020 Q3
3.

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.
The matrices after two iterations of Floyd’s algorithm are shown below.
Time matrix
| A | B | C | D | E | |
|---|---|---|---|---|---|
| A | – | 8 | 4 | 7 | 18 |
| B | 8 | – | 3 | 15 | 10 |
| C | 4 | 3 | – | 11 | 6 |
| D | 7 | 15 | 1 | – | 1 |
| E | 18 | 10 | 6 | 1 | – |
Route matrix
| A | B | C | D | E | |
|---|---|---|---|---|---|
| A | A | B | C | D | B |
| B | A | B | C | A | E |
| C | A | B | C | A | E |
| D | A | A | C | D | E |
| E | B | B | C | D | E |
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 | – |
| Scheme | Marks | AO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Time matrix
Route matrix
| B1 B1 | 1.1b 1.1b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (2) |
Notes
(a) B1: Correct time matrix
B1: Correct route matrix
| Scheme | Marks | AO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Time matrix
Route matrix
Time matrix
Route matrix
| M1 A1 M1 A1 | 1.1b 1.1b 1.1b 1.1b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (4) |
Notes
(b) M1: No change in the third row and third column of both matrices with at least one value in the time matrix reduced correctly and one value in the route matrix changed to C
A1: CAO
M1: No change in the fourth row and fourth column of both matrices with at least one value in the time matrix reduced correctly (follow through their first iteration) and one value in the route matrix changed to D
A1: CAO
| Scheme | Marks | AO |
|---|---|---|
| (i) NNA: A – C – B – E – D – A | B1 | 1.1b |
| (ii) 4 + 3 + 9 + 1 + 5 = 22 minutes | dB1 | 1.1b |
| (iii) A – C – B – C – E – D – C – A | B1 | 3.2a |
| (3) | ||
| (9 marks) |
Notes
(c)(i) B1: CAO
(c)(ii) dB1: CAO – not from A – C – D – E – B – A
(c)(iii) B1: CAO