Decision Mathematics 1 Unit Test 7: Algorithms on graphs I (part 2)
1 Figure 5 shows roads connecting five towns. The numbers show distances in
kilometres.
Figure 5
These are the distance and route matrices after the third iteration of Floyd’s
algorithm:
a Perform the fourth iteration. (4 marks)
There are no changes on the fifth iteration.
b Explain how to find the shortest distance and route from town C to town A using
your answer from part a.
State the route and the distance. (4 marks)
© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free. 1
Decision Mathematics 1 Unit Test 7: Algorithms on graphs I (part 2)
2 Figure 6 shows a network with the weights on the arcs representing distances.
Figure 6
a Apply Floyd’s algorithm to find the complete network of shortest distances.
You should show both the distance table and the route table after each iteration. (9 marks)
b Explain how to use your final matrix to find the shortest route from vertex A to
vertex C.
State this distance. (3 marks)
© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free. 2