Download presentation
Presentation is loading. Please wait.
Published byBlaise Baldwin Modified over 8 years ago
1
Networks Teacher’s guide
2
Networks 2
3
Problem 1 – the Link The EMTV Company needs to install a new cable system that links the six major towns in its area. The distances between the towns are shown on the map above. The cost of cabling is directly proportional to the total distance of cable required. Find the optimal solution. 3
4
Problem 2 – the Journey The Johnson family live in Ashby-de-la-Zouch but want to go to a festival in Grantham. The distances, in miles, between the towns/cities are shown on the map above. What route would you recommend to minimise the distance for them to travel? 4
5
Problem 3 – the Saleswoman Paula sells office equipment. She lives in Loughborough and has to visit all of the towns shown in the map above on Friday every week. Decide on her optimal route, assuming she comes home for tea. Would she be better off moving to a different town? 5
6
Problem 4 – the Gritter lorry Rob drives a gritter lorry for the East Midlands Environmental Agency and has to grit all of the roads tonight as a heavy frost is forecast. Rob’s depot is in Loughborough; decide on his optimal route. Does it matter where the depot is located? How do problems 2, 3 and 4 differ? 6
7
Problem 1 – the Link The EMTV Company needs to install a new cable system that links the six major towns/cities in its area. The distances between the towns are shown on the map above. The cost of cabling is directly proportional to the total distance of cable required. Find the optimal solution. 7
8
Problem 1 – the Link Kruskal’s algorithm This type of problem is known as a minimum connector problem and involves finding the minimum spanning tree. There are two well-known approaches. The first is known as Kruskal’s algorithm. In Kruskal’s algorithm the arcs are first ranked in order of increasing length. Begin by choosing the shortest arc of the network – in this case, LR LengthArcs 11LR 12LA 15MR 16MG, LN, AD, DN 17LD, LM, AR 24NG 8
9
Problem 1 – the Link Begin by choosing the shortest arc of the network, in this case, LR. At each subsequent stage, select from the remaining arcs the shortest arc that links nodes between which a path hasn’t already been created. In this case, LA. Effectively, you have now connected A, L and R. There is no need to connect A to R directly. LengthArcs 11LR 12LA 15MR 16MG, LN, AD, DN 17LD, LM, AR 24NG 9
10
Problem 1 – the Link We now repeat the process: the next shortest arc is MR. There are now 4 equally weighted arcs: MG, LN, AD, DN, all of which could be chosen. It doesn’t matter which one we choose. I am going to choose DN. It doesn’t matter that it is not connected to the other arcs yet. There are now 3 equally weighted arcs: MG, LN, AD. This time I am going to choose AD. 10
11
Problem 1 – the Link There are now 2 equally weighted arcs: MG, LN. I cannot choose LN as these are already connected (via A and D), so I will choose MG. We have now connected all 7 towns/cities. The length of cable is 84 kms. 11
12
Problem 1 – the Link Prim’s algorithm In Prim’s algorithm, first select an arbitrary node, then connect it to the nearest node. Now connect the nearest node that is not already connected, to those already in the solution. Repeat this until all the nodes are connected. 12
13
Select an arbitrary node, say M. Connect to the nearest node: R Now select the nearest node to M or R. In this case this is L. Now select the nearest unconnected node to L, M or R. In this case that is A. Problem 1 – the Link 13
14
Now select the nearest unconnected node to A, L, R, M. In this case we have a choice of three: D, N or G. It doesn’t matter which is chosen. In this case we have chosen D. We now repeat the process. We have a choice of N or G. It doesn’t matter which, so choose N. Finally we add G to the diagram by joining MG. We have now connected all 7 towns/cities. The length of cable is 84 kms. Problem 1 – the Link 14
15
Problem 5 The Irish Broadcasting Corporation wish to install a new cable system connecting each of the towns/cities to their new headquarters at Sligo. Design the most cost-effective system if cost is directly proportional to the length of cable. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 15
16
Step 1 Select an arbitrary node, say Galway: delete its row and highlight its column. Choose the smallest entry in the highlighted column, in this case Athlone. Your solution begins by drawing the arc between Galway and Athlone. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 16
17
Step 2 Choose Athlone: delete its row and highlight its column. Choose the smallest entry in either of the highlighted columns, in this case Galway to Limerick. Your solution continues by drawing the arc between Galway and Limerick. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 17
18
Step 3 Choose Limerick: delete its row and highlight its column. Choose the smallest entry in any of the highlighted columns, in this case Athlone to Sligo. Your solution continues by drawing the arc between Athlone and Sligo. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 18
19
Step 4 Choose Sligo: delete its row and highlight its column. Choose the smallest entry in any of the highlighted columns, in this case Athlone to Dublin. Your solution continues by drawing the arc between Athlone and Dublin. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 19
20
Step 5 Choose Dublin: delete its row and highlight its column. Choose the smallest entry in any of the highlighted columns, in this case Dublin to Wexford. Your solution continues by drawing the arc between Dublin and Wexford. Distance tables and Prim’s algorithm AthloneDublinGalwayLimerickSligoWexford Athlone–78567371114 Dublin78–13212113596 Galway56132–6485154 Limerick7312164–144116 Sligo7113585144–185 Wexford11496154116185– 20
21
The minimum spanning tree can now be calculated. 64 + 56 + 78 + 71 + 96 = 365 miles 21 Distance tables and Prim’s algorithm
22
Problem 2 – the Journey The Johnson family live in Ashby-de-la-Zouch but want to attend a festival in Grantham. The distances, in miles, between the towns/cities are shown on the map above. What route would you recommend to minimise the distance for them to travel? 22
23
Shortest Path algorithm – Dijkstra’s algorithm To find the shortest route from Ashby-de-la- Zouch to Grantham we use use a labelling algorithm originally developed by Edsger Dijkstra between 1956 and 1959. It is usual to have a box at each node with spaces for permanent and temporary markers and for the order in which the permanent labels are assigned. Problem 2 – the Journey Order of labellingPermanent label Working value (temporary label) 23
24
Shortest Path algorithm – Dijkstra’s algorithm To find the shortest route from Ashby-de-la-Zouch to Grantham we use use a labelling algorithm originally developed by Edsger Dijkstra between 1956 and 1959. Problem 2 – the Journey Step 1 Label the start node, A, with a permanent label (P-label) of 0. For all nodes that can be reached directly from A, assign a temporary label (T-label) equal to the distance from A. Select the node with smallest T-value and make its label permanent. The P-label represents the shortest distance from A to that node. 24
25
Shortest Path algorithm – Dijkstra’s algorithm Step 2 For all nodes that can be reached directly from L, assign a T-label equal to the sum of the P-value at L and the direct distance from it. Problem 2 – the Journey If there is already a T-label at the node, it should be replaced only if the new sum is smaller. Select the node with smallest T-value and make its label permanent. If this label is the destination node, go to step 3, otherwise repeat step 2. In this case, the smallest available T-Iabel is at D and so D is made permanent. 25
26
Shortest Path algorithm – Dijkstra’s algorithm Problem 2 – the Journey R now has the smallest T-value, and so is now made permanent. M can be reached from R, but this would give a new T-value of 32 which, as it is greater than 29, is rejected. N now has the smallest T-value and so is made permanent. It is now possible to travel to G. From D it is possible to travel directly to N but this would give a new T-value of 32 which, as it is greater than 28, is rejected. 26
27
Shortest Path algorithm – Dijkstra’s algorithm M now has the smallest T-value, and so is now made permanent. G can be reached from M, as this would give a new T-value of 45, which is smaller than 53, and is accepted. Problem 2 – the Journey Step 3 To find the shortest path, trace back from the destination to the start. G M L A. The recommended route is ALMG and the distance is 45 miles. 27
28
Core Maths Support Programme 60 Queens Road Reading RG1 4BS E-mail cmsp@cfbt.com Call 0118 902 1243
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.