Floyd's algorithmEdexcel A-Level Further Maths: Mind map
What this mind map covers
- Set-up
- Iteration rule
- Order of work
- Reading routes
- Compare with Dijkstra's
- Exam tips
Exam questions on Floyd's algorithm
- A network has four vertices , , and . The roads and their lengths are , , , and . Floyd's algorithm is applied, with the pivots in the order , , , . In the distance table the leading diagonal is 0 and a dash means there is no direct road. In the route table, the entry in row , column is the first vertex to travel to when going from to ; initially it is itself. Each iteration uses the next vertex in order as the pivot (iteration 1 uses the first row and column).Complete the algorithm. Find the shortest distance from to and use the final route table to give the route.2 marks
- Five sites to are joined by roads with lengths in km: , , , , and . Floyd's algorithm is applied, with the pivots in the order , , , , . In the route table, the entry in row , column is the first vertex to travel to when going from to ; initially it is itself. Each iteration uses the next vertex in order as the pivot (iteration 1 uses the first row and column).Complete the algorithm. Find the shortest distance from to and give the route.2 marks
- Four villages , , and are joined by roads with lengths in km: , , , and . Floyd's algorithm is applied, with the pivots in the order , , , . In the route table, the entry in row , column is the first vertex to travel to when going from to ; initially it is itself. Each iteration uses the next vertex in order as the pivot (iteration 1 uses the first row and column).Carry out iterations 1 and 2. State each entry of the distance table that changes, with its new value, and the new route table entries.3 marks
Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).