Nuffield FreeStanding Mathematics Activity Cable TV Nuffield Foundation
Nuffield Free-Standing Mathematics Activity Cable TV © Nuffield Foundation 2011
Cable TV Bride A Cable TV company wants to connect all the towns shown on the map. The company wants to use the minimum length of cable. This is called a minimum connector problem. This activity is about solving minimum connector problems 9. 3 6. 5 Kirk Michael 7. 4 Peel 13. 9 Ramsey Ballaugh 2. 8 6. 8 2. 7 Port Erin 4. 6 St Johns 9. 3 15. 4 Laxey 7. 7 8. 2 9. 3 10. 2 4. 7 Douglas The Isle of Man Castletown
To solve the problem you need to find a spanning tree of minimum length. A spanning tree is a tree that connects all the vertices together. A minimum spanning tree is a spanning tree of minimum length. Think about How many edges will there be in a minimum spanning tree that connects n vertices?
Kruskal’s Algorithm Step 1 List the edges in order of increasing length. Step 2 Start with the shortest edge. Step 3 From the remaining edges, select the shortest edge which does not form a cycle. (If there are 2 shortest edges choose either. ) Step 4 Repeat Step 3 until all the vertices are connected.
Edges in order of increasing length: Peel to St Johns 2. 7 Douglas to St Johns 8. 2 Ballaugh to Kirk Michael 2. 8 Bride to Ramsey 4. 6 Ballaugh to Bride Castletown to St Johns Laxey to Ramsey 9. 3 Castletown to Port Erin 4. 7 Castletown to Douglas 10. 2 Ballaugh to Ramsey 6. 5 Peel to Port Erin 13. 9 Kirk Michael to Peel 6. 8 Douglas to Ramsey 15. 4 Kirk Michael to St Johns 7. 4 Douglas to Laxey 7. 7
The Isle of Man Bride Peel to St Johns 2. 7 4. 6 6. 5 Kirk Michael Ramsey Bride to Ramsey 4. 6 Ballaugh 2. 8 Castletown to Port Erin 4. 7 6. 8 Peel 2. 7 St Johns Laxey 7. 7 8. 2 9. 3 Port Erin Ball to K Michael 2. 8 Ballaugh to Ramsey 6. 5 Kirk Michael to Peel 6. 8 Douglas to Laxey 7. 7 Douglas to St Johns 8. 2 Castletown to St Johns 9. 3 4. 7 Castletown Total length = 53. 3 miles
Prim’s Algorithm Step 1 Starting from any vertex, join it to the nearest adjacent vertex. Step 2 Join the next nearest vertex to those already included, provided this does not form a cycle. Step 3 Repeat Step 2 until all the vertices are included. The method can be carried out using an adjacency matrix.
Writing the network as an adjacency network: B 1 B 2 C D K L P 1 P 2 R S B 1 - 9. 3 - - 2. 8 - - - 6. 5 - B 2 9. 3 - - - - 4. 6 - C - - - 10. 2 - - - 4. 7 - 9. 3 D - - 10. 2 - - 7. 7 - - 15. 4 8. 2 K 2. 8 - - - 6. 8 - - 7. 4 L - - - 7. 7 - - 9. 3 - P 1 - - 6. 8 - - 13. 9 - 2. 7 P 2 - - 4. 7 - - - 13. 9 - - - R 6. 5 4. 6 - 15. 4 - 9. 3 - - S - - 9. 3 8. 2 7. 4 - 2. 7 - - -
Starting from any vertex – say B 1: 1 B 1 4 B 2 9 C 7 D 2 K 8 L 5 P 1 10 P 2 3 R 6 S B 1 - 9. 3 - - 2. 8 - - - 6. 5 - B 2 9. 3 - - - - 4. 6 - C - - - 10. 2 - - - 4. 7 - 9. 3 D - - 10. 2 - - 7. 7 - - 15. 4 8. 2 K 2. 8 - - - 6. 8 - - 7. 4 L - - - 7. 7 - - 9. 3 - P 1 - - 6. 8 - - 13. 9 - 2. 7 P 2 - - 4. 7 - - - 13. 9 - - - R 6. 5 4. 6 - 15. 4 - 9. 3 - - S - - 9. 3 8. 2 7. 4 - 2. 7 - - -
Prim’s Algorithm results in the same minimum spanning tree, but the order the edges are added to the tree is different Ballaugh to Kirk Michael Ballaugh to Ramsey to Bride Kirk Michael to Peel to St Johns to Douglas to Laxey St Johns to Castletown to Port Erin 2. 8 6. 5 4. 6 6. 8 2. 7 8. 2 7. 7 9. 3 4. 7
The Isle of Man Bride Total length 4. 6 6. 5 Kirk Michael Ramsey Ballaugh 2. 8 6. 8 = 53. 3 miles Peel 2. 7 St Johns Laxey 7. 7 8. 2 9. 3 Port Erin = 2. 8 + 6. 5 + 4. 6 + 6. 8 + 2. 7 + 8. 2 + 7. 7 + 9. 3 + 4. 7 Castletown Douglas Think about Can you explain how the matrix method works? Which method do you prefer? Why? What else would need to be considered in the real situation?
Cable TV Reflect on your work How many edges will there be in the minimum spanning tree of a network with n vertices? What are the advantages or disadvantages of Kruskal’s and Prim’s algorithms? What other sorts of things might need to be considered in a real situation? © Nuffield Foundation 2011
- Slides: 12