Floyd's algorithmEdexcel A-Level Further Maths: Flashcards
What these 13 flashcards ask
- What does Floyd's algorithm find?
- What are the two tables in Floyd's algorithm?
- What is in the distance table at the start?
- What is in the route table at the start?
- What does a route table entry (X,Y) mean?
- How many iterations does a network with n vertices need?
- Which row and column does iteration 1 use?
- What is the update test in iteration K?
- What is the new route entry when an update is made?
- What if the new total equals the current value?
- How do you read off a route?
- Does the pivot's row or column change in its own iteration?
- When is Floyd's algorithm better than Dijkstra's?
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).