Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
272 views
284 pages
Maths 31
maths fun 1
Uploaded by
Lawrence Lim Ah Kow
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save maths 31 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
272 views
284 pages
Maths 31
maths fun 1
Uploaded by
Lawrence Lim Ah Kow
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save maths 31 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save maths 31 For Later
You are on page 1
/ 284
Search
Fullscreen
Decision Mathematics 2 Edexcel AS and A Level Modular MathematicsContents About this book 1 ‘Transportation problems LLL Terminology used in describing and modelling the transportation problem 1.2. Finding an initial solution to the transportation problem 1.3. Adapting the algorithm to deal with unbalanced transportation problems 14 ‘meant by a degenerate solution and how to manage such 1.5 Finding shadow costs 1.6 Finding improvement indices and using these to find entering cells 1.7 Using the stepping-stone method to obtain an improved solution 1.8. Formulating a transport problem as a linear programming problem Allocation (assignment) problems 2.1. Reducing cost matrices 2.2 Using the Hungarian algorithm to find a least cost allocation 2.3. Adapting the algorithm to use a dummy location 2.4 Adapting the algorithm to manage incomplete data 2.5. Modifying the algorithm to deal with a maximum profit allocation 2.6 Formulating allocation problems as linear programming problems The travelling salesman problem 3.1. Understanding the terminology used 3.2. Knowing the difference between the classical and practical problems 3.3. Converting a network into a complete network of least distances 3.4 Using a minimum spanning tree method to find an upper bound 3.5. Using a minimum spanning tree method to find a lower bound 3.6 Using the nearest neighbour algorithm to find an upper bound Further linear programming 4.1. Formulating problems as linear programming problems 4.2 Formulating problems as linear programming problems, using slack variables 4.3. Understanding the simplex algorithm to solve maximising linear programming problems 4.4 Solving maximising linear programming problems using simplex tableaux 4.5. Using the simplex tableau method to solve maximising linear programming, problems requiring integer solutions Review Exercise 1 10 15 7 26 32 33 34 43. 44 48 82 61 62 62 62 67 73 78 88 89 1 94 101 4 121Game theory 5.1 Knowing about two-person games and pay-off matrices 5.2. Understanding what is meant by play safe strategies 5.3. Understanding what is meant by a zero-sum game 5.4 Determining the play safe strategy for each player 5.5. Understanding what is meant by a stable solution (saddle point) 5.6 Reducing a pay-off matrix using dominance arguments 5.7. Determining the optimal mixed strategy for a game with no stable solution 5.8. Determining the optimal mixed strategy for the player with two choices in a2 3or3 x 2 game 5.9. Determining the optimal mixed strategy for the player with three choices ina2 x 3or3 x 2 game 5.10 Converting 2 x 3, 3 X 2 and 3 x 3 games into linear programming problems Network flows 6.1 Knowing some of the terminology used in analysing flows through networks 6.2. Understanding what is meant by a cut 6.3 Finding an initial flow through a capacitated directed network 6.4 Using the labelling procedure to find flow-augmenting routes to increase the flow through the network 6.5. Confirming that a flow is maximal using the maximum flow-minimum cut theorem 6.6 Adapting the algorithm to deal with networks with multiple sources and/or sinks Dynamic programming 7.1 Understanding the terminology and principles of dynamic programming, including Bellman’s principle of optimal 7.2. Using dynamic programming to solve maximum and minimum problems, presented in network form. 7.3. Using dynamic programming to solve minimax and maximin problems, presented in network form. 7.4 Using dynamic programming to solve maximum, minimum, minimax or ‘maximin problems, presented in table form Review Exercise 2 Examination style paper Answers Index 134 135 136 137 137 138 144 145 149 153 153 165 166 171 178 182 193 197 207 208 209 217 221 233 241 245 279In this chapter you will: + learn the terminology used to describe and model transportation problems 4 * learn about the ‘north-west corner method’ + learn about unbalanced transportation problems + understand what is meant by a degenerate solution * learn to find shadow costs + find improvement indices + use the stepping-stone method + formulate a transportation problem as a linear programming problem. Transportation In industry, people are concerned with efficiency and cost-effectiveness at all stages. In this chapter you will look at the costs due to the transportation of goods — to factories and from factories to warehouses and customers. The problems considered are usually concerned with minimising distribution costs where there are multiple sources and multiple destinations.HAPTER 1 «1 You should be familiar with the terminology used in describing and modellin: 9 9 the transportation problem. In order to solve transportation problems you need to consider: I The capacity of each of the supply points (or sources) - the quantity of goods that can be produced at each factory or held at each warehouse. This is called the supply or stock. The amount required at each of the demand points — the quantity of goods that are needed at each shop or by each customer. This is called the demand (or destination). The unit cost of transporting goods from the supply points to the demand points. Three suppliers A, B and C, each produce road grit which has to be delivered to council depots W, X, Yand Z. The stock held at each supplier and the demand from each depot is known. The cost, in pounds, of transporting one lorry load of grit from each supplier to each depot is also known, This information is given in the table. Depot | Depot | Depot | Depot Stock. Se wi] x | ¥ | Z _dorrytoads) SupplierA | 180 | 110 | 130 | 290 4 Supplier B | 190 | 250 | 150+\—280 | 16 Supplier C 240 | 270 | 190 | 120 2D Demand Money tons) |e |S ea 50 Use the information in the table to write down: ‘a the number of lorry loads of grit that each supplier can supply b the number of lorry loads of grit required at each depot © the cost of transporting a lorry load of grit from A to W the cost of transporting a lorry load of grit from C to Z. © Which is the cheapest route to use? £ Which is the most expensive route to use?portation problems a Suppliers A. B and C can provide 14, 16 and 20 lorry loads respectively. b Depots W, XY and Z require 11,15, 14 and 10 lorry loads respectively. The cost of transporting one lorry load from A to W le £180. The cost of transporting one lorry load from C to Z is £120. The cheapest route is A to X at £110 per load, f The most expensive route is A to Z at £290 per load Solving the transportation problem The method is as follows. 1 First find an initial solution that uses all the stock and meets all the demands. 2 Calculate the total cost of this solution and see if it can be reduced by transporting some ‘goods along a route not currently in the solution. (lf this is not possible then the solution is optimal.) 3 If the cost can be reduced by using a new route, as many units as possible are allocated to this new route to create a new solution. 4 The new solution is checked in the same way as the initial solution to see if itis optimal. If not, any new routes found are included. 5 When no further savings are possible, an optimal solution has been found, ‘1,2. You can find an initial solution to the transportation problem. A method often called the ‘north-west corner method! is used. 1 Create a table, with one row for every source and one column for every destination. Each cell represents a route from a source to a destination, Each destination’s demand is given at the foot of each column and each source’s stock is given at the end of each row. Enter numbers in each cell to show how many units are to be sent along that route, 2 Begin with the top left-hand comer (the north-west corner). Allocate the maximum available quantity to meet the demand at this destination (whilst not exceeding the stock at this source!). 3 As.each stock is emptied, move one square down and allocate as many units as possible from. the next source until the demand of the destination is met. ‘As each demand is met, move one square to the right and again allocate as many units as possible, 4 When all the stock is assigned, and all the demands met, stop. In order to avoid degenerate Fora problem involving In the examination, solutions, movements are made im source vertices and problems will be Ietween Squares either vertically _—_ destination vertices you must restricted to a ‘or horizontally but never enter n+ m-~ transportation _-—_-maximum of 4 supply diagonally. See example 4 quantities = 0. This will points and 4 demand not reduce throughout the points. problem.HAPTER 1 Depot W | DepotX | DepotY | DepotZ | Stock Supplier A | 180 110 130 290 4 Supplier B 190 230 150 280 16 Supplier C | 240 270 190 120 20 Demand iW 15 4 10 50. Use the north-west corner method to find an initial solution to the problem described in example 1 and shown in the table. 1 w fx w Z_| Stock A 4 B | 16 g 20 Demana| 1 | 6 | 4 | 10 | 50 2 Beginning with the north-west comer, start to fill in ‘the number of units you wish to send along each route. wfx [vy | z [Stock A ae 4 B | —— 16 a [2e— Demand] 1 | 6 | 4 | 10 | 50 G Zo} | Demand n 6 4 10 50. Demana| 1 | 6 | 4 | 10 | 50wfx Y |Z [Stock A 1 3 4 B w | 4 16 c 10 +20 Demand] 1 | 5 | 4 | 10 | 50 wf x @ Z_| Stock A 1 5 4 8 ried a 16 a 10 | 10-420 Demana| 1 | 6 | 4 | 10 | 50 This Is the final table. All of the stock has been used and all of the demands met, ‘The number of occupied cells (routes used) in the table = number of supply points + number of demand points ~1. In this case the ‘number of occupied cells (routes used) = 6, ‘number of supply points = 3, ‘number of demand points and6=3+4-1. Use this table, together with the table showing costs, to work out the total cost of the solution. wf] x w Z_| Stock A Wonmon) 130 | 220 | 4 5 190 | 260 | 160 | 280 | 16 € 240 | 270 |BON20] 20 Demand] ti | 6 | 4 | 10] 50 ‘The total cost of this solution ie (It < 180) + (3 x M10) + (12 x 250) + (4 x 150) + (10 x 190) + (10 x 120) = £9010.CHAPTER 1 [13 You can adapt the algorithm to deal with unbalanced transportation problems. ] When the total supply > total demand, we say the problem is unbalanced. Ifthe problem is unbalanced we simply add a dummy demand point with a demand chosen so that total supply = total demand, with transportation costs of zero. A | B | Cc [ Supply x 9 |u| 1 40 ¥. wo | 8 | 12 60 Zz wil7ts 50. Demand | 50 | 40 | 30 Three outlets A, B and C are supplied by three suppliers X, Y and Z. The table shows the cost, in pounds, of transporting each unit, the number of units required at each outlet and the number of units available at each supplier. a Explain why it is necessary to add a dummy demand point in order to solve this problem. b Adda dummy demand point and appropriate costs to the table. ‘© Use the north-west comer method to obtain an initial solution, a The total supply Io 150, but the total demand is 120. A dummy is needed to absorb this excess, so that. total supply equals total demand, b |e fT fies D_| Supply x @[" [oo] 4 Y [to | 6 | 2 | 0 | 6 Zz [eee eel ee oe |e Demana | 50 | 40 | 20 | 20 | 150 ic a [6 | c |b | Suppy x 40 | 40 Y 10 | 40 | 10 0 Zz | 20 | 30 | 50 Demand | 50 | 40 | 20 | 30 | 160‘Transportation problems I Ina feasible solution to a transportation problem with m rows and n columns, if the number of cells used is less than n + m ~ 1, then the solution is degenerate. This will happen when an entry, other than the last, is made that satisfies the supply for a given row, and at the same time, satisfies the demand for a given column. The algorithm requires that n + m — 1 cells are used in every solution, so a zero needs to be placed in a currently unused cell. A | B | C | Supply Ww w [ul 6 30 x 40 [S| 9 20 ¥ 3 [al7 35 zi u [io] 9 35 Demand | 30 | 40 | 50 120 a Demonstrate that the north-west corner method gives a degenerate solution and explain why it is degenerate. 1b Adapt your solution to give a non-degenerate initial solution and state its cost. a A | 8 | c | Suppy w 30 30 x 20 20 Notice that there has been a diagonal ‘move’ from cell ms 2 BE Se WA to cell XB, Degenerate Iz 26 | 26 solutions can be avoided by Baviand [ESOu leon sou EEO) not allowing diagonal moves. This solution is degenerate since it fulfils all the oupply and demand needs but only uses 5 cells WA, XB, YB, YC and ZC. There are 4 rows and 3 columns 60 a non: degenerate solution will use 4 + 3 — 1 = 6 cells b Start by placing the largest possible number in the north-west comer A | 6 | c | Suppy Ww. 30 30 x 20 2 Zz 35 35 Demana| 30 | 40 | 50 | 120 underneatHAPTER 1 There are two possible initial solutions, depending on where you chose to place the zero. Either A |B | c | Supply | w 30 | 0 30 x 20 20 | @ 20 | 16 | 36 z 36 | | Demand | 30 | 40 | 50 | 120 Or A [|B | Cc | Supply | w 30 30 x o | 20 20 Sa 20 | 15 | 35 Zz | Demand| 30 | 40 | 50 | 120 Both have a cost of (30 X 10) + 0 + (20 x 5) + (20 X B) + (15 X 7) + (65 X 9) = £980 {In fact the zero can be placed anywhere in the table, but it is convenient to stick to the rule’ about restricting the movement to one square down or one square right. Photocopy masters are available for the questions in this exercise. In Questions 1 to 4, the tables show the unit costs of transporting goods from supply points to demand points. In each case: _use the north-west comer method to find the initial solution, b verify that, for each solution, the number of occupied cells = number of supply points + number of demand points ~ 1. € determine the cost of each initial solution, 1 PQ | R | Supply A 150 | 213 | 222 32 B 175 | 2048 | 218 | 44 c 188 | 198 | 246 34 Demand 28 45 37 110 2 P| Q | R | S | Supply A 27 33 34 41 54 B a1 | 29 | 37 | 30 7 c 40, 32 28 35 29 Demand 21 32 51 46 150‘Transportation problems P| Q | R | Supply A w | a | 19 123 B 1s | 21 | 25 143 c 19 | 2 | 18 84 D 20 | 27 | 16 150, Demand | 200 | 100 | 200 | 500 P| a{[Ris | supply A 36 | 86 | 80 | 61 134 B so | 76 | 78 | 65 203 g 62 | 70 | 57 | 67 176 D oo | 6 | 75 | 71 | 187 Demand | 175 | 175 | 175 | 175 700 A | B | Cc | D | Supply x 27 | 33 | 34 [ 41 | 60 y 31 | 29 | 37 | 30 | 60 z 40 | 32 | 28 | 35 | 80 Demand | 40 | 70 | 50 | 20 Four sandwich shops A, B, Cand D can be supplied with bread from three bakeries, X, Y, and Z. The table shows the cost, in pence, of transporting one tray of bread from each. supplier to each shop, the number of trays of bread required by each shop and the number of trays of bread that can be supplied by each bakery. a Explain why it is necessary to add a dummy demand point in order to solve this problem, and what this dummy point means in practical terms. 1b Use the north-west comer method to determine an initial solution to this problem and the cost of this solution k | t [| M | N | supply A 35 | 46 | 62 | 80 20 B 2a [53 | 73 | 52 15 € 67 | 61 | 50 | 65 20 D 92 | a1 | 41 | 42 20 Demand | 25 | 10 | 18 | 22 A company needs to supply ready-mixed concrete from four depots A, B, C and D to four work sites K, [, M and N, The number of loads that can be supplied from each depot and the number of loads required at each site are shown in the table above, as well as the transportation cost per load from each depot to each work site. a Explain what is meant by a degenerate solution, b Demonstrate that the north-west comer method gives a degenerate solution. ¢ Adapt your solution to give a non-degenerate intial solution.CHAPTER 1 7 LM Supply P a (os 22 Q a3 a R 6 | 4 im s 3 [2 b Demand | 15 | 17 The table shows a balanced transportation problem. The initial solution, given by the north- west comer method, is degenerate. Use this information to determine the values of a and b. b Hence write down the initial, degenerate solution given by the north west-corner method. Finding an improved solution To find an improved solution, you need to: 1 use the non-empty cells to find the shadow costs (see Section 1.5) 2 use the shadow costs and the empty cells to find improvement indices (see Section 16) 3 use the improvement indices and the stepping stone algorithm to find an improved solution (see Section 1.7). 1.5 You can find shadow costs. I Transportation costs are made up of two components, one associated with the source and one with the destination. These costs of using that route, are called shadow costs. Depot W | Depot X | DepotY | DepotZ | Stock Supplier A 180 110 14 Supplier B 250 150 16 Supplier C | 190 120 20 Demand ul 15 4 10 50 In example 2, the cost of £250 in transporting one unit from supplier B to depot X must be dependent on the features ~ location, toll costs etc, of both B and X. Using the routes currently in use you can build up equations, showing the cost of transpor unit, such as S(A) + D(X) = 10 and S(C) + D(Z) = 120 ete. where S(A), D(X) are the costs due to supply point A and demand point X and so on, respectively. You need a value for each of the source components and each iene : te 3 You are only looking at the of the destination components. You do not have sufficient pee peer ‘equations for a solution (five equations and six unknowns) but ‘your current solution. relative costs will do.‘Transportation problems To find the shadow costs, follow these steps. 1 Start with the north-west corner, set the cost inked with its source to zero. 2 Move along the row to any other non-empty squares, and find any other destination costs in the same way. next row. destination costs. 3 When all possible destination costs for that row have been established, go to the start of the 4 Move along this row to any non-empty squares and use the destination costs found earlier, to establish the source cost for the row. Once that has been done, find any further unknown: 5 Repeat steps 3 and 4 until all source and destination costs have been found, Depot W_| DepotX | DepotY | DepotZ | Stock Supplier A 180 110 130 290 4 Supplier B 190 250, 150 280 16 Supplier C 240 270 190 120 20 Demand un 1 4 10 0 Calculate the shadow costs given by the initial solution of the problem given in example 2 and shown in the table. Initial solution (see page 5) was wx [iy | z | Stock A an [3 14 B [4 16 c to [10 | 20 Demand] 1 | 5 | 4 | 10 | 50 Focus on the costs of the routes being used ~ the non- empty equares re ree ee re ae Supplier A| 180 | 110 4 Supplier B 250 | 150 16 Supplier C 190 | 120 | 20 Demand | 1 | 15 | 14 | 10 | 50 Remember to use the cost values not the number of items currently being transported along that route.HAPTER 1 Putting S(A) to zero, from row 1 we get D(W) = 180 and D(X) = 10 Find the remaining shadow costs by ‘walking round! the current solution, noting the shadow costs you find round the edge Of the table, and using shadow costs found earlier to find the remaining ones. Shadow costs 160 10 Depot W | Depot Xx | Depot Y | Depot z | Stock ° Supplier A | 160 110 14 Supplier B 250 160 16 Supplier C 190 120 | 20 Demand it 6 14 10 50 Now move to Row 2. You know that: D(X) = 110, 60 you find 6(B) = 140 hence D(Y) = 10 Shadow costs 100 | 10 10 Depot W | Depot X | Depot | Depot Z | Stock ° Supplier A | 180 110 4 140 | Supplier B 250 | 160 16 Supplier C wo | 120 | 20 Demand 1 6 4 170 | 60 You know that D(Y) = 10, 60 we find S(C) = 180 and hence that D(Z) = -60. Shadow costs 180 | to 10 | -60 Depot W | Depot X | Depot'Y | Depot Z | Stock ° Supplier A | 180 110 4 140 | Supplier B 250 | 160 16 160 | Supplier C 190 | 120 | 20 Demand 1 6 14 10 | 50 You have now found all source and all destination shadow costs. S(A)=0 5(6)=140 5c) = 180 DW) =180 DK)=110 DIY) = 10 D(z) = -60A |B | c | D | Supply x 9 | 1 [10 | 0 40 Y w | 8 | 2 | 0 60 Zz zi[7i/s [o 50 Demand | 50 | 40 | 30 | 30 150 Calculate the shadow costs given by the initial solution of the problem given in example 3 and shown in the table, ‘The north-west comner method gave the following initial solution (cee page 6) A | 6 [c | dD | Suppy x 40 40 iv 10 | 40 | 10 60 Z) 20 | 30 | 50 Demana| 50 | 40 | 30 | 30 We need to use the costs rather than the number of items being transported. So we use the following numbers. Shadow costs A | 6 | c | D | Supply x Q 40 x 10 [ 6 | 12 60 Zi o | 50 8 Demana| 60 | 40 | 30 | 30 | 150 Arbitrarily assign 3(X) = 0. Shadow costs A | 68 | c | D | Supply oO x 9 40. it 10. & 12. 60. Zz oO 50. 8 Demand | 50 | 40 | 20 | 30 | 150 Use this to work out the shadow cost for D(A). Shadow costs 9 A | 6 | c | D | Supply ° x 9 40 i to | @ | 12 60 B & | o | 50 Demand | 50 | 40 | 30 | 30 | 150HAPTER 1 Use this to work out the shadow cost for S(Y). Shadow costs 9 A | 6 | c | D | Supply ° i 9 40 1 Y to | 6 | 12 60 zi 6 | o | 50 Demand | 50 | 40 | 30 | 30 | 150 We use this to work out the chadow costs for D(B) ard D(C). Shadow costs em |Ee7 Ea A | 6 | c | D | Supply ° x 9 40 1 ig io | & | 12 60 Z & | o | 50 Demana| 60 | 40 | 30 | 30 | 150 Use these to work out the shadow cost for S(Z). Shadow costs a9|7|n A | 6 | c | D | Supply ° x 9 40 1 a to | 6 | 12 60 Demana| 50 | 40 | 30 | 30 | 150 Use this to work out the shadow cost for D(0). Shadow costs ine (Ta ES A | 6 | c | D | Supply oO Ba 9 40 1 a 1o | 6 | 2 60 iz e|ol| 5 Demana| 50 | 40 | 20 | 30 | 160 You do not have to show each stage of the table in the examination, Just this final list of shadow costs is sufficient,It may be possible to reduce the cost of the initial solution by introducing a route that is not ‘currently in use. You consider each unused route in tum and calculate the reduction in cost which ‘would be made by sending one unit along that route. This is called the improvement index. I The improvement index in sending a unit from a source P to a demand point Q is found by subtracting the source cost S(P) and destination cost D(Q) from the stated cost of transporting one unit along that route C(PQ). Le. Improvement index for PQ = Ipq= C(PQ) — $(P) — D(Q) The route with the most negative improvement index will be introduced into the solution. The cell corresponding to the value with the most negative improvement index becomes the entering cell (or entering square or entering route) and the route it replaces is referred to as the exiting cell (or exiting square or exiting route). MIF there are two equal potential entering cells you may choose either. Similarly, if there are two equal exiting cells, you may select either If there are no negative improvement indices the solution is optimal. Shadow costs 180 110 10 60 DepotW | DepotX | DepotY | DepotZ | Stock 0 Supplier A) 180 m0 =| «130 290 14 140 |SupplierB) 190 250 150 280 1 | 180 [Supplier] 240 270 190 120 20 Demand 1 15 4 10 50 Use the shadow costs found in example 5, and shown in the table above, to calculate improvement indices, and use these to identify the entering cell. Focus on the routes not currently being used, BW, CW, CX, AY, AZ and BZ. You already know that S(A)=0 S(B)=140 S(C)= BO DIW)=180 D(K)=10 DYY)=10 DIZ) = -60 Improvement: index for BW = Iny = C(BW) ~ S(B) — D(W) = 190 — 140 - 180 = ~130 Improvement: index for CW = Iq, = 240 — 180 — 180 = —120 270 — 180 - 10 = -20 Improvement: index for AY = In = 130 — 0 — 10 = 120 Improvement. index for AZ = I,z = 290 — 0 — (—60) = 360 Improvement: index for BZ = Ine = 280 — 140 — (60) = 200 The entering cell is therefore BW, since this is the most negative, Improvement: index for CXCHAPTER 1 eed x | -y |Z | supply n [2 [a i B | 10 | 13 15 5 | 18 | 9 14 Demand | 10 | 15 | 15 Il fi a Use the north-west comer method to find an initial solution to the transportation problem shown in the table. b Find the shadow costs and improvement indices. ‘© Hence determine if the solution is optimal. a x | y | z | Supply a io [4 1 B i 15 c | 4 | 4 | Demand| 10 | 15 | 15 | Improvement indices for cellet X= 1342-0 =4 X=15+6-1=10 CY=1846-12=12 AL=17-0-15=2 © There are no negative improvement indices, 90 the solution io optimal. Photocopy masters are available for the questions in this exercise. Questions 1 to 4 Start with the initial, north-west corner, solutions found in questions 1 to 4 of exercise 1A. In each case use the initial solution, and the original cost matrix, shown below, to find a the shadow costs, by the improvement indices € the entering cell, if appropriate,‘Transportation problems 1 P| Q | R | Supply A 150 | 213 | 222 32 B 175 | 204 | 218 44 c 188 | 198 | 246 34 Demand | 28 | 45 | 37 2 P| alr s | supply A 27 | 33 | 34 | a1 S4 B 3i_| 29 | 37 | 30 67 c 40 | 32 | 28 | 35 29 Demand | 21 | 32 | 51 | 46 3 P| Q | R | Supply A v7 | m4 | 19 123 B 1s | 21 | 25 143 c 1 | 22 | 18 84 D 20 | 27 | 16 150, Demand | 200 | 100 | 200 P| al R | s | Supply A 36 86 | 80 | 61 1B B so) 76 | 78 | 65 203 c 62 | 70 | 57 | 67 176 D 60 | 68 | 75 | 71 187 Demand | 175 | 175 | 175 | 175 In example 7 you discovered that the most negative improvement index was BW with a value ‘of ~130 (see page 15). This means that every time you send a unit along BW you save a cost of 130. Therefore you want to send as many units as possible along this new route. You have to be careful, however, not to exceed the stock or the demand. To ensure this, you go through a sequence of adjustments, called the stepping-stone method. You are looking therefore for a cycle of adjustments, where you increase the value in one cell and then decrease the value in the next cell, then increase the value in the next, and so on. A popular mind picture is that you are using the cells as ‘stepping-stones’, placing one foot on each, ‘and altemately putting down your left foot (increasing) then right foot (decreasing) as you journey around the table — hence the method's nickname,CHAPTER 1 The stepping-stone method 1 Create the cycle of adjustments. The two basic rules are: ‘@ within any row and any column there can only be one increasing cell and one decreasing cell. b apart from the entering cell, adjustments are only made to non-empty cells. 2 Once the cycle of adjustments has been found you transfer the maximum number of units through this cycle, This will be equal to the smallest number in the decreasing cells (since ‘you may not have negative units being transported). 3 You then adjust the solution to incorporate this improvement. ple In example 2, the table of costs was Depot W | DepotX | DepotY | DepotZ | Stock Supplier A 180 110 130 290 14 Supplier B 190 250 150 280 16 Supplier C 240) 270 190 120 20 Demand u 15 4 10 50 and the initial solution was wfex | y | z | Stock A u | 3 4 B 2 | 4 16 c [10 [10 | 20 Demand | 1 | 15 | 14 | 10 50 at a cost of £9010 (see page 5). Obtain an improved solution and find the improved cost. Use BW as the entering cell, since this gave the most negative improvement index. ~180 (see Example 7, page 15). So BW will be an increasing cell. We enter a value of 8 into thie cal wix lv | z | stock A [3 | 4 B On ie | 16 ¢ | 10 [10 | 20 Demand| 1 1 14 | 10 50‘Transportation problems In order to keep the demand at W correct, you must therefore decrease the entry at AW. so AW will be a decreasing cell. w [|x | y | z | Stock A n= 4 5 o | 2i|4 16 iG wo | 10 | 20 Demana| 1 | 1% | 14 | 10 | 50 In order to keep the stock at A correct, you must therefore increase the entry at AX. 0 AX will be an increasing cel wl x | y | z | Stock A n-0|3+0 4 5 0 wi 4 16 iG 70 | 10 | 20 Demand| 1 | 4 [10 [| 50 In order to keep the demand at X correct, you muet therefore decrease the entry at BX, 60 BX will be a decreasing cell. w [| x |v | z | Stock A n-0|3+0 4 5 @ |i2-0| 4 16 ic 1o | 10 | 20 Demand| 1 ss | 4 | 10 | 50 Now choose a value for @, the greatest value you can, without introducing negative entries into the table. Look at the decreasing cells and see that the greatest value of 8 is 1 (gince 1 — 11 = 0). Replace @ by I! in the table: w x [|v | z | Stock A u-n|3en 4 5 nt f-n] 4 16 c 10 | 10 | 20 Demand| 1 i | 4 [10 | 50CHAPTER 1 This gives the improved solution: w [x [¥ | | stock A 14 4 B in 1 [4 16 c | 10 [10 | 20 Demand | ti i | 4 [10 | 50 Looking at: the table of transportation coste, this solution has a cost of £7580 You will notice that AW has become empty. AW is therefore the exiting cell. Remember that the number of cells used in a feasible solution must equal the number of rows plus the number of columns minus 1. So if you put a number into an entering cell, it must be balanced by a number being removed from an exiting cell. M_Ateach iteration we create one entering cell and one exiting cell. To find an optimal solution, continue to calculate new shadow costs and improvement. indices and then apply the stepping-stone method. Repeat this iteration until all the improvement indices are non-negative. Find an optimal solution for example 9. ‘This second iteration indicates the amount of working you need to show in the examination, Second iteration Find the new shadow costs: Shadow costs 50 | 10 | 10 |-60 wfex [ y | z | stock ° A wo | no | 130 | 200| 14 140 B 190 | 260 | 160 | 280| 16 oc | 240 | 270 | 190 | 120 | 20 Demand| 1 | 15 | 14 | 10 | 50Finding the new improvement indices for the nor-used cells: AW = 180 — 0 - 50 = 150 OW = 240 — 180 — 50 = 10 CX = 270 — 180 — 110 = -20 AY = 130 - 0-10 = 120 AZ = 290 — 0 + 60 = 350 BZ = 280 — 140 + 60 = 200 So the new entering cell is CX, eince this has the most negative improvement index. ‘Applying the stepping-stone method gives wfsx Y_| z | Stock A [4 14 B nu [1-@|4a+e 16 c 6 |to-e| 10 | 20 Demand] 11 | 15 4 [10 | 50 Looking at cells BX and CY we see that the greatest value for @ iat The new exiting cell wll be BX, @ = 1 and we get wfox [vy | z | stock A 4 14 B it 5 16 c [ame] ame [one Demand| ri | 6 [| 4 | 10 | 50 The new cost is £7560 Checking, 7580 + (~20) x 1 = 7560 Third iteration New shadow costo Shadow costs 70 | 10 | 30 ye x Stock ° A 180 | no | 130 | 290] 14 120 B 190 | 250 | 160 | 280| 16 160 a 240 | 270 | 190 | 120 | 20 Demand| 1 | 15 | 14 | 10 | 50CHAPTER 1 New improvement indices for the non-used celist AW = 180 - 0 ~ 70 = 110 GW = 240 - 160 - 70 = 10 BX = 250 — 120 - 10 = 20 xY = 130 - 0 - 30 = 100 AZ = 280 — 0 + 40 = 380 BZ = 280 — 120 + 40 = 200 There are no negative improvement indices ¢0 this solution is optimal. The solution is 110 unite Ato X 190 unite B to W At this point, if there isan improvement index of 150 unite B to Y 6, this would indicate that there isan alternative Anat ‘optimal solution. To find it, simply use the cell ea ‘with the zero improvement index as the entering 190 unite CtoY cell. (See question 2 in Mixed Exercise 1F.) 120 unite C to Z Some stepping-stone routes are not rectangles and some 4 values are not immediately apparent. Example EH] Supermarket X | Supermarket Y | Supermarket Z | Stock ‘Warehouse A By 22, 28 B Warehouse B | 26 26 4 ul Warehouse C | 20 22, 20 12 Demand 10 13 13 The table shows the unit cost, in pounds, of transporting goods from each of three warchouses, A, Band C to each of three supermarkets X, Y and Z. It also shows the stock at each warehouse and the demand at each supermarket. Solve the transportation problem shown in the table. Use the north-west corner method to obtain an initial solution. You must state your shadow costs, improvement indices, stepping- stone routes, @ values, entering cells and exiting cells. You must state the initial cost and the improved cost after each iteration Check the problem is balanced, Supply = Demand = 36, 60 we do not need to add a durnmy. The north-west corner method gives the following initial eolution x |v | z | stock A to | 3 ass B io | 1 i c wz | Demand| 10 | 13 | 13 |‘Transportation problems The cost of the initial solution is E820 Calculate chadow coats Shadow costs 24 | 22 | 10 x | y | z | Stock ° A 24 | 22 | 28 | 3 4 B 26 | 26 | 14 tt 10 Ci 20 | 22 | 20[ 2 Demand | 10 | 13 | 15 Calculating the improvement indices for the empty celle: BX = 26 -4-24=-2 (X= 20 -10- 24= -14 CY =22-10-22=-10 AL = 28-0-10=18 Use CX as the entering cell, since It has the most negative improvement Index. § vi Z_| Stock A 1o-@| 5+0 13 6 to-o|i+0[ 1 6 @ 2-6| 12 Demand| 10 % 15 ‘This stepping stone route is quite complicated. Take a minute or two to check how it has been created. Start by putting din CX, then to correct the demand of X, subtract @ from cell AX, then to correct the supply in A, add @to cell AY and so on, finishing at cell CZ. ‘The maximum value of 8s 10 Either cell AX or cell BY can be the exiting cell, since bath of these will go to zero, We simply choose one of them, AX to be the exiting cell, the other will have a numerical value of zero. Many candidates fal to understand the difference between an empty cell and one with a zero entry. Zero is a number, just like 4 and ‘counts’ towards our m +n — 1 entries in the table, An empty cell hhas no number in it. Improved solution is x | y | z | Stock A 1% 13 5 olt 1 ec 10. 2 12 Demand| 10 | 13 | 13HAPTER 1 The cost is now £680 We need to check for optimality, by calculating improvement indices. The second set of shadow costs are: Shadow costs to | 22 | 10 x | vy | z | Stock oO A 24 | 22 [26 | 13 4 B 26 | 26/4 | on 10 G 20 | 22 | 20[ 2 Demand | 10 | 13 | 13 Improvement indices Ax [ex [cy [Az 4 | 2 | -0[ 6 So the solution is not yet optimal and the next entering cell ie CY. x i Z_| Stock A 18 13 5 o-elit+ol C 10 a |2-0| 2 Demand | 10 1% 13 We can see from cell BY that the maximum value of Bis 0. The entering cell is CY and will have an entry of O. The exiting cell i BY and it will now be empty. The improved solution is x [vy [Zz J sto A 1% 13 5 | tt iW c to | o [2 2 Demand | 10 [ 3 3 ‘The cost ie unchanged at £680 We again need to check for optimality, by calculating improvement: indices Shadow cost: Shadow costs 20 | 22 | 20 x | y | z | Stock o A 24 | 22 [28 | 3 6 26 | 26 | 4 tt oO c 20 | 22 | 20/ 2 Demand | 10 | 13 | 13‘Transportation problems Improvement indices are ax | ex | ey | az aia ons All the improvement indices are non-negative and 60 the solution is optimal. x Ly | z J stock A 5 13 5 1 n ic (on em 2 2 Demand| 10 | 1 | 3 So the optimal solution is to ¢end 13 unite from A toY units from B to Z 10 unite from C to X 2 unite from C to Z at a cost of E680 Questions 1 to 3 Complete your solutions to the transportation problems from questions 1, 2 and 4 in exercises 1A and 1B, You should demonstrate that your solution is optimal. 1 P| Q | R | Supply A 150 | 213 | 222 32 B 175 | 204 | 218 44 € 188 | 198 | 246 34 Demand | 28 | 45 | 37 2 P| alr s | supply A 27 | 33 | 34 | 41 54 B 31_| 2 | 37 | 30 67 c 40 | 32 | 28 | 35 29 Demand | 21 | 32 | 51 | 46 3 P| alr s | supply A 56 | 86 | 80 | 61 134 B 59 | 76 | 78 | 65 203 a | 7 | s7 | 67 | 176 D oo | 68 | 7s | 7 187 Demand | 175 | 175 | 175 | 175CHAPTER 1 ‘The solution to question 3 requires a number of iterations, plus the optimality check ~ you will certainly get lots of practise in implementing the algorithms! 4 P | a] stock ‘The table shows the unit cost, in pounds, Site a Of transporting goods from each of three warehouses A, B and C to each of two B BEA Ss supermarkets P and Q. It also shows the c See) a stock at each warehouse and the demand at Demand | 6 | 4 each supermarket Solve the transportation problem shown in the table. Use the north-west comer method to obtain an initial solution. You must state your shadow costs, improvement indices, stepping- stone routes, 6 values, entering cells and exiting cells. You must state the initial cost and the improved cost after each iteration. {In book D1 you met linear programming problems in two variables. In chapter 4 of this book you will study linear programming problems in more than two variables. Consider our first example DepotW | DepotX | DepotY | DepotZ Stock Supplier A 180 | 110 130 | 290 4 Supplier B 190 230 150 280 16 Supplier C 240 270 190 120 20 Demand 15, 4 10 50 Let x1 (the entry in the Ist row, Ist column) be the number of units transported from A to W, and x2, (the entry in the 2nd row and 4th column) be the number of units transported from B to Z, and so on, then you have the following solution. Depot W | DepotX | DepotY | DepotZ | Stock Supplier A a Xn Xs Es 14 Supplier B Xa Xn Xn Xu 16 Supplier C 2 Xu Xs Xu 20 Demand u 15 4 10 50 ‘The objective is to minimise the total cost, which will be calculated by finding the sum of the product of number of units transported along each route and the cost of using that route.‘Transportation problems In this case the objective is 8000); + 110k) + 130 + 2905 + 1909) + 250%g2 + 150x33 + 2805 + 240hry, + 270aty9 + 190g + 120%, Minimise C Looking at the stock, you know that the four entries in the first row must not exceed 14, so you have our first constraint: Butea tty tas 14 We can write similar constraints for each supplier and each depot, and include non-negativity constraints. This enables you to formulate the transportation problem as a linear programming problem. The standard way of presenting a transportation problem as a linear programming problet « first define your decision variables, « next write down the objective function, «finally write down the constraints. Example [EI R | -s | 1 | suppr A 3,3 ]2][ 2 B a[2[3[ 0 € 3 [4 [3] 31 Demand | 30 | 30 | 36 Formulate the transportation problem as a linear programming problem. You must state your decision variables, objective and constraints. Let x, be the number of unite traneported from i to j where 1€ {A. B.C} JER 9.7} and x; > 0 Minimise C= Sxy + Ste + 2m + xy, + tz + Bxon + Bry, + Axap + Bn Subject to: xy + Xp + Xp = 25 Nay + ee t+ ey = 40 Xyy + Mag + ay = BI y+ Xp) + ty = 30 Nat Xz + Xx <0 Big + zy + Xap SBSHAPTER 1 Formulate the following transportation problems as linear programming problems. 1 PQ | R | Supply A 150 | 213 | 222 32, B 175 | 204 | 218 4 G 188198 | 246 34 Demand | 28 | 45 | 37 2 P| a{ri{s | supply A 27 | 3 34 | at] B 31_| 29 | 37 | 30 67 g 40 | 32 | 28 | 35 29 Demand | 21 | 32 | si | 46 3 PQ | R | supply A 17_| 24 19 123 B 15 21 25 143 c 19 22 18 84 D 20 27 16 150, Demand | 200 | 100 | 200 4 P| al Rs | supply A 56 | 86 | 80 | ot 134 B so | 76 | 78 | 65 | 203 ¢c 62 | 70 | 37 | 67 | 176 D 60 | 68 | 75 | 71 | 187 Demand | 175 175 | 175 | 175 1 L_ | M | Supply A 20 | 70 15 B 4030 5 c 60 | 90 8 Demand | 16 | 12 ‘The table shows the cost, in pounds, of transporting a car from each of three factories A, B and C to each of two showrooms L and M. It also shows the number of cars available for delivery at each factory and the number required at each showroom.‘Transportation problems a Use the north-west corner method to find an initial solution. b Solve the transportation problem, stating shadow costs, improvement indices, entering. cells, stepping-stone routes, 6 values and exiting cells. © Demonstrate that your solution is optimal and find the cost of your optimal solution. Formulate this problem as a linear programming problem, making your decision variables, objective function and constraints clear. € Verify that your optimal solution lies in the feasible region of the linear programming problem, PQ | R | Supply F za | 2 | 22 15 G zi_| 23 | 24 35 H 22 | a | 23 10 Demand | 10 | 30 | 20 ‘The table shows the cost of transporting one unit of stock from each of three supply points F, Gand H to each of three sales points P, Q and R. It also shows the stock held at each supply point and the amount required at each sales point. a Use the north-west corner method to obtain an initial solution. b Taking the most negative improvement index to indicate the entering square, perform. two complete iterations of the stepping-stone method. You must state your shadow costs, improvement indices, stepping-stone routes and exiting cells. © Explain how you can tell that your current solution is optimal. d State the cost of your optimal solution. € Taking the zero improvement index to indicate the entering square, perform one futher iteration to obtain a second optimal solution. x | y | z | supply J 8 fs |7 30 K s|[s [9 40 L 7 |e | io 50 M 6 | 3 | 15 50 Demand | 25 | 45 | 100 The transportation problem represented by the table above is to be solved. A possible north-west corner solution x | y | Zz | supply in 25 | 5 30 K 40 40 iy o | 50 50 M 50. 50. Demand | 25 | 45 | 100CHAPTER 1 a Explain why it is was necessary to add a zero entry (in cell LY) to the solution. bi State the cost of this initial solution. © Choosing cell MX as the entering cell, perform one iteration of the stepping-stone ‘method to obtain an improved solution. You must make your route clear, state your exiting cell and the cost of the improved solution. Determine whether your current solution is optimal. Give a reason for your answer. After two more iterations the following solution was found. x | y | z | supply J 30 30 K 20 | 20 40 L 50. 50 M 25_|_25 50 Demand | 25 | 45 | 100 € Taking the most negative improvement index to indicate the entering square, perform. one further complete iteration of the stepping-stone method to obtain an optimal You must state your shadow costs, improvement indices, stepping-stone route s | T | U | Supply A 6 | 0 | 7 50 B 7[s [38 70 c 6|[7|7 50 Demand | 100 30 | 20 a Explain why a dummy demand point might be needed when solving a transportation problem. The table shows the cost, in pounds, of transporting one van load of fruit tree seedlings from. cach of three greenhouses A, B and C to three garden centres S, T and U. It also shows the stock held at each greenhouse and the amount required at each garden centre. b Use the north-west corner method to obtain an initial solution. © Taking the most negative improvement index in each case to indicate the entering square, use the stepping-stone method to obtain an optimal solution. You must state your shadow costs, improvement indices, stepping-stone routes, entering squares and exiting cells State the cost of your optimal solution. € Formulate this problem as a linear programming problem. Make your decision variables, objective function and constraints clear.Transportation problems seer es In solving transportation problems, you need to know ‘the supply or stock the demand ‘+ the unit cost of transporting goods. 2 When total supply > total demand, the problem is unbalanced. 3 A dummy destination is needed if total supply does not equal total demand. ‘Transport costs to this dummy destination are zero. 4 To solve the transportation problem, the north-west corner method is used. 5 The north-west comer method: = Create a table, with one row for every source and one column for every destination. Each destination’s demand is given at the foot of each column and each source's stock is given at the end of each row. Enter numbers in each cell to show how many units are to be sent along that route. m= Begin with the top left-hand comer. Allocate the maximum available quantity to meet the demand at this destination (but do not exceed the stock at this source). m= As each stock is emptied, move one square down and allocate as many units as possible from the next source until the demand of the destination is met. = As each demand is met, move one square to the right and again allocate as many units as possible. = Stop when all the stock is assigned and all the demands are met. 6 Ina feasible solution to a transportation problem with m rows and n columns, if the number of cells used is less than + m — 1 then the solution is degenerate. 7 The algorithm requires n + m ~ 1 cells to be used in every solution, so a zero must be placed in an unused cell in a degenerate solution. 8 To find an improved solution, you need to: = use the non-empty cells to find the shadow costs = use the shadow costs and the empty cells to find improvement indices i= use the improvement indices and the stepping-stones method to find an improved. solution. 9 Transportation costs are made up of two components, one associated with the source and ‘one with the destination, The costs of using a route are called shadow costs. (See example 5 for how to work out shadow costs.) 10 The improvement index of a route is the reduction in cost which would be made by sending one unit along that route. Improvement index for route PQ = Ihq = C{PQ) ~ S(P) ~ D(Q) (see example 7). 11 The stepping-stone method is used to find an improved solution (see example 9).In this chapter you will: * learn to reduce cost matrices * use the Hungarian algorithm to find a least cost, allocation * adapt the Hungarian algorithm to use a dummy location * adapt the Hungarian algorithm to manage incomplete data + modify the Hungarian algorithm to deal with a maximum profit allocation + formulate allocation problems as linear programming problems. Allocation nt) problems In a medley relay swimming team, four swimmers will each swim one length, one after the other, and each will swim a different stroke. Although all the team members could swim any of the strokes, some members of the team are faster at one or two particular strokes. We want the strokes to be allocated to the team members in such a way as to minimise the total time it takes the team to complete all four lengths. This is an example of an allocation (assignment) problem. It can be seen as a weighted matching problem, where we seek to minimise the total cost or time or to maximise the total profit.‘Allocation (assignment) problems In allocation problems each worker must do just one task and each task must be done by just one worker. We are seeking a one-to-one solution. This means that we require the same number of tasks as workers. In finding a solution to an allocation problem, only relative costs are important. Suppose each member of the swimming team is timed doing a length of crawl and the times are 12, 13, 11 and 14 seconds. The important thing is not how long they each take, but how much quicker or slower each one is relative to the others, We can subtract 11 seconds from each time to compare the swimmers more easily. To reduce the cost matrix: subtract the least value in each row from each element of that row, using the new matrix, subtract the least value in each column from each element in that column, Task W | Task X | Task Y | Task Z Kris 2 23 15 40 Laura 4 a 7 20 Sam | 13 22 2030 Steve 4 24 3B 10 ‘The table shows the times taken, in minutes, by four workers to complete each task of a four- stage production process. The time taken for the process is the sum of the times of the four separate tasks, Reduce the cost matrix. The smallest numbers in rows 1, 2, 3 and 4 are 12, 14,13 and 10 respectively. If we subtract these numbers from each element in the row our table becomes TaskW | TaskX | TaskY | TaskZ Kris ° 1 SI 2 Laura ° ia oI 6 Sam o 2 7 7 Steve 4 4 5 o The omallest numbers in columns 1, 2, 3 and 4 are O, 7, and O respectively. If we subtract these numbers form each element In the column our table becomesTaskW | TaskX | TaskY | TaskZ Kris oO 4 ° 28 Inthe examination you will be required to Laura o o o 6 Tere Sam o Z 4 7 and then the columns. Steve 4 1 °. o IF we can find a matching using only the cells showing a zero cost we will have found an optimal solution. In this case we can. Our optimal solution is Kris does taskY Laura does task X Sam does task W and Steve does task Z IF you look at the original cost matrix the total cost Ie 15+ 21+ 13 + 10 = 59, 5 ‘There may be more Check than one optimal ‘The total cost was 59 which is also the value of all the row and solution, of course, column reductions we made (12 + 14 +13 +10 +7 +3 = 59). ‘but all will have the same ‘cost’. The Hungarian algorithm 1 Start by finding the reduced cost matrix. 2 Determine the minimum number of straight lines (horizontal or vertical), which will cover all of the zeros in the matrix. 3 Inanm Xn matrix, if you cannot cover them in fewer than n lines, you have an optimal solution and you stop. 4 If in ann x n matrix you can cover the zeros with fewer than 1 lines, drawn vertically or horizontally, the solution can be improved. 5 Draw in these lines and look for the smallest uncovered element, ¢. 6 Add eto the elements in each covered row and each covered column, adding it twice to any element covered twice. 7 Subtract ¢ from every element of the matrix. 8 Repeat steps 2-7 until an optimal solution is found. ‘The idea of this algorithm is rather like making bids at an auction. We ‘offer’ up an amount of money ~ the minimum we can sensibly make, made up of the sum of the row and column, reductions,‘Allocation (assignment) problems If we can find a solution it will therefore be optimal. If we do not find a solution, then we increase our ‘bid!’ and see if we can find a solution for that, ind keep on increasing until we are successful. amount; Boris, Percival and Spike do garden maintenance. The table shows the time, in minutes, that they ‘would take to do each task in Mrs Green’s garden. Allocate the tasks so that the time taken to do the whole job is as small as possible. Dig vegetable patch | Weed flower beds | Cut lawn and hedges Boris 250 80. 160 Percival 230 90. 150 Spike 230 110 140 Dig vegetable | Weed flower | Cut lawn and patch beds hedges Boris 170 o 80 Percival 140, 0 60 Spike 120) o EZ) Dig vegetable | Weed flower | Cut lawn and patch beds hedges Borie 50 ° 50, Percival 20, ° 30, Spike ° ° ° We can cover all the zeros using only 2 lines like this: Dig vegetable | Weed flower | Cut lawn and patch beds hedges Boris 50. 8 50. Percival 20 6 ‘Spike Qa a So we have not yet found a solution ~ there le no way of allocating each worker to a task using just the zero cost cells. The minimum uncovered element is 20. We add 20 to each row covered by a line.Dig vegetable | Weed flower | Cut lawn and patch beds hedges Boris 50 o 50. Percival 20 o 30 Spike 20 20 20 and then to each column covered by a line, giving: Dig vegetable | Weed flower | Cut lawn and patch beds hedges Boris 50, 20 50 Percival 20 20 30, Spike 20 40 20 We then subtract 20 from each element in the matrix giving: Dig vegetable | Weed flower | Cut lawn and patch bedo hedges 9 30. o 10 mB We have to use three lines to cover all the zeros, 60 our current olution ie optimal. A minimal matching fs Boris — weeding fiower beds Percival ~ dig vegetable patch Spike — cut lawn and hedges Using the original cost matrix the cost = 80 + 230 + 140 = 450 minutes A Short Cut Steps 6 and 7 of the algorithm can be done in just one matrix. If the smallest uncovered element is “e’ the effect of these three operations is that i each element covered by two lines will increase by ‘e’, each element covered by just one line will be unchanged, ii cach uncovered element will be reduced by ‘e’.‘Allocation (assignment) problems Sew | Fill | Finish | Pack 8 3 6 10. 5 7 3 5 9 3 9 10 7 2 9 7 8 2 7 10 Five workers Ben, Ellie, Greg, Hyo and Toby are to be assigned to five tasks involved in making a soft toy. The table shows the time in seconds taken to complete each task. Reducing rows first, use the Hungarian algorithm to determine an allocation that minimises the total time. Reducing rows first Cut | Sew | Fill | Finish | Pack Ben 6 5 ° 3 7 Ellie ° ° al °. ° Greg 7 é °. 6 Z Hyo 8 5 oO Fa 5 Toby z 6 ° 5 8 We can not reduce the columns, since there is a zero already in each column, We can cover all the zeros in just two lines lke this: Pack olalololalg eel ales @]a}alo | Method |: Using the short cut Our matrix is currently Fil_| Finish | Pack a ° a 7 0. a 0. comnle 6 oO 6 T a ° ia SB 6 ° 6 3To use the short cut we need to tackle the elements according to how many lines cover them. The smallest uncovered element; is 3, 20 using the short cut, we ‘© Add 3 to the element covered by two lines © Leave the elements covered by just one line unchanged © Subtract 3 from the uncovered elements This gives the following matrix cut | Sew | Fill | Finish | Pack Ben 3 2 ° ° 4 Ellie ° ° 5 ° ° Greg | 4 3 ° 5 4 Hyo 5 2 ° 4 2 Toby 4 ei ° ZI 5 Method Il: Not using the short cub © add 3 to each element in the ‘Ellie! row Cut | Sew | Fill | Finish | Pack Ben é 5 ° ei 7 Ellie 3 3 5 3 3 Greg ia é ° 6 7 Hyo 8 5 ° i 5 Toby 7 6 ° 5 8 © add 3 to each element in the ‘Fill column Cut | Sew | Fill | Finish | Pack Ben 6 5 3 a 7 Ellie 3 3 8 3 3 Greg 7Z é 3 6 7 Hyo 8 5 3 ia 5 Toby a é 3 5 8 © We now subtract 3 from all elements in the table giving: Cut | Sew | Fill | Finish | Pack Ben zi 2 °. ° 4 Ellie ° ° 5 ° ° Greg | 4 2 oO 3 4 Hyo 5 2 ° 4 2 Toby 4 a oO 2 5‘Allocation (assignment) problems The matrix resulting from both methods can be covered in just three lines like this: Fill_| Finish | Pack | | I alas |élale alr fo of O}O}O}h}o wlrloloto alr} |ol> Using the short cut again we categorise the elements according to how many lines cover them. cut | Sew | Fill | Finish | Pack Ben 3 2 o | o 4 | Ellie ° 0 5 ° ° Greg | 4 a ° si 4 LHyo Gis o | 4 2 Toby | 4 3 ° al 5 The minimum uncovered element is 2, 60 we © Add 2 to the element covered by two lines © Leave the elements covered by just one line unchanged © Subtract 2 from the uncovered elements Giving | cut | Sew | Fill Pack Ben 1 | 0 ° 2 Ellie ° ° if ° Greg | 2 1 ° 2 Hyo 3 0 ° 0 [Toby | 2 1 ° Bi This can be covered in four lines, 60 we have not yet found a solution The four lines can be placed like this: Fil_| Finish | Pack {Ben ftp O-— + Ellie --- oO fe Greg 2 1 “Hye 3-0) Toby 2a‘charTen 2 Using the short cut again Cut | Sew | Fill | Finish | Pack Ben 1 o ° oO 2 Ellie ° ° % a ° Greg | 2 1 ° i 2 Hyo 3 ° ° 4 ° Toby 2 1 oO A 3 ‘The minimum uncovered element is 1, 60 we © Add 1 to the element covered by two lines © Leave the elements covered by just one line unchanged © Subtract 1 from the uncovered elements Giving cut | Sew | Fill | Finish | Pack Ben 1 ° 1 oO 2 Ellie oO 0 8 zl ° Greg 1 0 ° 2 1 Hyo 3 ° 1 4 ° Toby 1 ° ° 1 2 We need five lines to cover all the zeros, 60 we have found our optimal solution, In fact there are two solutions: Either Ben-Finish, Ellie Cut, Greg—Fil, Hyo—Fack, Toby - Sew Or Ben Finish, Ellie~Cut, Greg-Sew, Hyo- Pack, Toby Fill Both solutions have a total time of 29 seconds. (G+5+347+80r6+5+9+742) To find the eolution from the final table we just use logic - treat it 6 a logic problem. First locate any single zeros in rows or columns since these must be used. Fill__| Finish | Pack Ben i 0 1 ° 2 Ellie ° ° 6 2 ° Greg 1 o ° 2 1 Hyo a ° Hl 4 0 Toby 1 ° ° 1 2‘Allocation (assignment) problems So we must include Ellie ~ Cut and Ben — Finish In our solution. This leaves Greg, Hyo and Toby and Sew, Fill and Fack to be assigned. The only person now able to do Pack is Hyo, 60 we assign her. cut | Sew | Fill | Finish | Pack Ben 1 ° i ° A Ellie ° ° 8 2 ° Greg 1 ° ° 2 1 Hyo a 0 Hl 4 ° Toby 1 ° ° fl 2 We now see that Greg and Toby must cover Sew and Fill, which both are able to do — giving our two solutions. In questions 1 to 4 the tables show the cost, in pounds, of allocating workers to tasks. Reducing rows first, use the Hungarian algorithm to find an allocation that minimises the cost. You should make your method clear, showing the table at each stage and state your final solution and its cost. 1 Task X | TaskY | Task Z ‘Worker A 34 35 31 ‘Worker B 26 31 27, ‘Worker © 30 37 32Task A | TaskB | Task | Task D Worker P 34 37 32 32 ‘Worker Q. 35, 32 34 Ed ‘Worker R 2 35 37, 36 Worker 38 34 35, 39. TaskR | TaskS | TaskT | Task U Worker J 20 22 14 24 Worker K 20 19 12 20 ‘Worker L B 10 1 | 16 WorkerM | 22 23 9 28 Task V | TaskW | TaskX | TaskY | Task Z ‘Worker D 85, 95 97 87 80 Worker E 110 115 95 105, 100 ‘Worker F 90 95 86 93 105 Worker G 85 83 84 85 87 Worker | 100 100 105 120 95 100m | Hurdles | 200m | 400m Ahmed 4 21 37 64 Ben 13 22 4068 Chang 12 20 38 70 Davina 13 21 39 74 A junior school has to enter four pupils in an athletics competition comprising four events; 100m sprint, hurdles, 200m, 400m. The rules are that each pupil may only enter one event and the winning team is the one whose total time for the four events is the least. The school holds trials and the table shows the time, in seconds, that each of the team members takes. Reducing rows first, use the Hungarian algorithm to determine who should participate in Which event in order to minimise the total time, 6 Beech | Elm | Eucalyptus | Oak | Olive A | 183 87 62 144 76 B | 162 | 105 87 152 88 c | 159 84 75 165 79 D | 145 98 63 170 85 E | 149 94 70 138 82 ‘The table shows the cost, in pounds, of purchasing trees from five local nurseries. A landscape gardener wishes to support each of these local nurseries for the year and so decides to use each nursery to supply one type of tree. He will use equal numbers of each type of tree throughout the year, Reducing rows first, use the Hungarian algorithm to determine which type of tree should be supplied by which nursery in order to minimise the total cost.‘Allocation (assignment) problems If you do not have an n x n problem you handle it in the same way that you would a transportation problem. You introduce a dummy row or column and put zeros in as the elements. Task A | TaskB | Task Mark 12 23 1S Nicky 4 21 7 Nigel 13 2 20 Susie 4 24 1B ‘The table shows the time, in minutes, taken for four workers Mark, Nicky, Nigel and Susie to do each of three tasks A, Band C. Use the Hungarian algorithm to obtain an allocation that minimises the total time, TaskA | TaskB | Taskc | tacko | (Uineta morons tian tase Mark 12 2B 6 0 {introduce a dummy column so that = the number of rows is equal to the Niche a ta o ‘number of columns. Nigel | 18 22 20 o ‘Add in a extra column and flit with Susie 14 fa B a eros, since it will ake no time to do. Continue as usual. ‘There are no row subtractions to do (each row contains a zero), so we subtract 12, 21, 13 and 0 from the columns. TaskA | TaskB | TaskC | TaskD Mark ° A 2 o Nicky 2 o 4 oO Nigel 1 1 7 0 Susie 2 3 ° ° It takes four straight lines to cover the zeros, £0 we have an optimal solution, Mark — task A Nicky ~ task 6 Nigel - task D (dummy) Susie ~ task C ‘The total time taken = 12 + 21+ O + 13 = 46 minutes,‘charTen 2 The tables show the cost, in pounds, of allocating workers to tasks. Reducing rows first, use the Hungarian algorithm to find an allocation that minimises the cost. ‘You should make your method clear, show the table at each stage, and state your final solution and its cost. 1 TaskM | Task N Worker J 23, 26 ‘Worker K 26 30 ‘Worker L 29 28 2 TaskW | Task X | Task Y | Task Z Worker A 31 43 19 35 Worker B 28 46 10 | 34 Worker C 24 42 1B 33 3 TaskR | TaskS | TaskT WorkerW | 81 45 55. ‘Worker X 67 32 48 Worker Y 87 38 58 ‘Worker Z, 2B 37 60 4 TaskE | TaskF | TaskG | Task H ‘Worker P. 24 a2 32, 31 Worker Q 22 39 30. 35 Worker R B 34 22 25, Worker S. 19 a 27 29 ‘Worker T 18 40 31 33 I Ifitis not possible to assign a task to a given person, enter a large value into the matrix at the appropriate place. This makes these particular assignments ‘unattractive’.Aye Full Hows Piece a New Dell | “Tower | acumry | Panta (French) (Indian) (Italian) Denis - 27 15, 40 Hilary 14 21 17 13 Robert 20 = 13, = ‘Trudy 4 24 10 30 ‘Allocation (assignment) problems An agency needs to assign four relief chefs Denis, Hilary, Robert and Trudy to four restaurants serving Chinese, French, Indian and Italian food. The travelling expenses, in pounds, that will be paid to each chef are shown in the table. Some of the chefs can not work in some of the restaurants, since they are not familiar with that style of cookery. Use the Hungarian algorithm, reducing rows first, to obtain an allocation that minimises the total travelling expenses paid. eed ee Meee enh ma eee) Denia_| 100 27 6 Hilary 4 a 7 Robert | 20 100. B Trudy ma 24 10 Reducing rows gives: Full Hows Plece a Pee eae ge (French) | (Indian) (Italian) a Hilary i & 4 Oo Robert 7 87 oO 87 Trudy 4 4 oO 20Reducing columns gives: The minimum uncovered element is 3. at | Hows | Pose nowt | over | seury | ast (French) | (Indian) (Italian) Denis BA 4 oO 25 Hilary oO oO 4 oO Robert 6 72 oO 87 Trudy 3 oS oO 20 ‘The zeros can be covered by two lines like this: Full Hows: Piece a pean cme ee eee (French) (Indian) (Italian) Denis Ba 4 Q 2] Hilary” ee ee eee 0----~ Robert: 6 72 o 87 Trudy 3 6 0 20 eben | A | eee (Chinese) | (French) | (Indian) Deni al 1 0 Hilary o o 7 Robert | 2 76 0 Trudy o 3 ° The zeros can now be covered with just tares linea ike tris AyeFull | Hows | Piece a Tower curry | Pasta (French) | (Indian) | (italian) Denis 1 Q 22 Hilary foconefonenO Robert 76 6 4 Trudy = oO 7Allocation (assignment) problems The omallest uncovered element is 1, giving (after applying the short cut again): New ven | AYeFull | Hows | Piece a (Chinese) | Tower | acurry | Pasta ? (French) | (Indian) | (Italian) Denis Q a 3 Hilary | @ Robert $ 6 ~Hirudy- = z Four lines are needed to cover the zeros, 60 we have an optimal solution, Denis— Aye Full Tower Hilary ~ Piece a Pasta Robert—Hows a curry Trudy ~ New Dell The total cost = 27 +13 +13 + 14 = £67. Applying the (more complicated) check ae Row and column reductions = 60. 60 + 2(8) + 101) = 67. 3 Exe ‘The tables show the cost, in pounds, of allocating workers to tasks. ‘The crosses ‘X’ indicate that that worker cannot be assigned to that task. Reducing rows first, use the Hungarian algorithm to find an allocation that minimises the cost. You should make your method clear, show the table at each stage and state your final solution and its cost. 1 Task | TaskM | Task N Worker P 48 34 xK WorkerQ |X 37 67 Worker R 53 B 56 2) TaskD | TaskE | TaskF | TaskG Worker R 38 47 55 53 Worker S 32 x a7 64 Worker T x 53 43 x WorkerU | 41 48 52 a7‘Task P TaskQ | Task R ‘Task S Worker A 46 53 67 75, Worker B 48 x 61 78 Worker C 42 46 53. 62, Worker D 39 50, x 73 4. Task R Task S ‘Task T Task U ‘Task V Worker J 143 12 v9 | 137 x Worker K 149 106 153 us 267 Worker L 137, 109 143 121 x Worker M 157 x x 134 290 Worker N 126 101 132 ii 253 ‘You have seen how to use the Hungarian algorithm to find a minimum cost allocation. You can modify the matrix so that you can find a maximum profit allocation, TaskW | TaskX | TaskY | TaskZ Cherry 12 23 15 40 Jimmy. 4 21 7 20 Mac 13 22 20 30. Plum 4 2 13 0) ‘The numbers represent profits, in pounds, so that the profit of Cherry doing task W is £12, etc Find the allocation of tasks to people to maximise the total income, The Hungarian algorithm finds minimums so you have to make all the numbers in the table negative. The algorithm will find the minimum solution — i.e, the most negative one, which wil, oF course, be the maximum solution. Start off with TaskW | TaskX | TaskY | TaskZ Chery | -12 | -23 | -15 | -40 vimmy | -4 | -21 =17_|_-20 Mac Soe | 22a Se 5) Plum =4 | =24 [| =5 | -0‘Allocation (assignment) problems Subtract the most negative number from each element (In this case you subtract ~40, which is the same as adding 40), 60 that you lose the negative signs [ TaskW | Taskx | TaskY | TaskZ [Cherry | 28 7 25 ° \Jimmy | 26 19. 23 20 Mac 27 6 20 10 Plum 26 16 El 30 Proceed as before. The reduced matrix (after reducing both rows and columns) io TaskW | Taskx | TaskY | TaskZ (Cherry | 21 7 2i ° Jimmy, oO 0 ° 1 Mac 10. & 6 oO Plum 3 o @ 14 Three lines are needed to cover the zeros TaskW | Taekx | TaskY | TaskZ a 7 a 0 2 af@f 10 6 3 iz The minimum uncovered element is 3 So the next matrix is TaskW | Taskx TaskZ Cherry | 18 7 o (immny oO 5 ° 4 Mac 7 8 3 ° Plum o ° 4 4 ‘Three lines are needed again to cover the zeros. | TaskW | TaskX | TaskY | TaskZ “Cherry 18 7 18 ° Lairnmy 0s One Mac 7 & BI 9 “Plum Bape feeThe minimum uncovered element is 3 again. The next matrix is Task W 5 19k X Cherry Now four lines are needed to cover the zeros as shown, The optimal solution is Cherry does Z Jimmy does W Mac does Y Ata total profit of 40 +14 +20 + 24 = £98 Plum does X Auseful tip Afr the row and column reductions, you hed thls mates, which needs three eApeea eee Task W [Tusk X | Task Y | Tskz Geny | a | 7 | a [0 jimmy | _o | 0 | 0 1 Mac | 8 6 0 Plum 3 0 7 > We chose the line ike this Tsk W [Task X | Task ¥ chery | a | | A solo eee eee Mac 10 8 6 [Plum 3 [9 7 ‘This patter gave the minimum uncovered elements 3, and you needed another ietion to lat the solution, Ifyou had chosen this pattern of ines Task W [Tusk X | Task y | Taskz ‘Chery 21 7 21 é ca é r 0. zi Mac 10 8 6 9 freer feg eftExe 20] ‘Allocation (assignment) problems The tables show the profit, in pounds, of allocating workers to tasks. Reducing rows first, use the Hungarian algorithm to find an allocation that maximises the profit. You should make your method clear, show the table at each stage and state your final solution and its profit. 1 Task C | TaskD | Task E Worker L 37 15 12 WorkerM | 25 1B 16 WorkerN | 32 41 35 2 TaskS | TaskT | TaskU | Task V Worker C 36 4 32 35 WorkerD | 37 32, 34 33 Worker E 2 35 37 36 Worker F 39 4 35 35 TaskE | TaskF | TaskG | Task H Worker R 20 22 4 24 Worker S 20 19 2 20 Worker T 1B 10 18 16 WorkerU | 22 23 9 28 4 Task} | TaskK | Taskl | TaskM | Task N Worker A 85 95 86 87 7 WorkerB | _110 1 95, 1s 100 ‘Worker © 90 95 86 8 105 WorkerD | 85 87 84 85 87 WorkerE | 100 100 105 120 95In an allocation problem, you match one person to just one task and each task to just one person. You have just two options for the decision variables, either the person is going to do the task or they are not. You use binary coding to signal this, with 1 representing allocating that person to the task and 0 representing not allocating them to the task. Mi There is a standard way of presenting an allocation problem as a linear programming problem: « first define your decision variables, ‘* next write down the objective function, + finally write down the constraints. Formulate the allocation problem from example 1 as a linear programming problem. TaskW | TaskX | TaskY | TaskZ Kris 2 23 15 40 Laura 4 2 7 20 Sam 3B 22 20 30 Steve it 24 13. 10 ‘The decision variables are: Lot xy be O or if worker (does job J O otherwise where 1 € (Kris, Laura, Sam, Steve} and j € 4W,X YZ} The objective Is to minimise the total cost, which wil be calculated by finding the sum of the product of the cost and the allocation. In this case the objective Is Minimise C = 12xy + 28%y + 18, + 40%, 4 VAxyy + 2itgo + itz + 2O%24 + 1Bityy + 22x + 20ite5 + BOrtey 4 Vay + 2AiXae + 1BXas + 10g The constraints can be found as follows, Since each person ie allocated to just one task each row will contain precisely one 1 and all other entries will be O.Allocation (assignment) problems Consider Kris. You kriow she will do just: one task, £0 just one variable in her row will be 1, all the rest will be zero. Hence y+ Me + ty + he = 1 Similarly, since each task will be done by just one person each column will contain precisely one | and all other entries will be O. Consider Y. You know that just one person will be allocated to ft, 60 just one variable in the column will be 1, all the rest will be zero, Hence Xie + Kay + ag + Xe You can write similar constraints for each person and each task. This enables you to formulate tthe allocation problem ao a linear programming problem [ave[c[o] 1/wl2|sle 2/9 [3/13 3/3 [3 a a4[3 [2 3 Four machines 1, 2, 3 and 4 are to be used to perform four tasks, A, B, C and D. Each machine is to be assigned to just one task and each task must be assigned to just one machine. The cost, in thousands of pounds, of using each machine for each task is given in the table above. Formulate the above assignment problem as a linear programming problem, defining your variables and making the objective and constraints clear, FIRST define your decision variables: Let xy be O or 1 Vif machine i does task j “0 otherwise where 1€ {), 2, 3, 4} and j€ fA, B, C, D}NEXT write down the objective Function: minimise C= 10x, + 2 + xc + Xp + Oxy, + Bop + Woe + Bikey + Bitag + op + Mac + Zoo $F Bitgy + Qty + tac + Eke FINALLY write down the constraints: Subject to xy + Met Met Mw Noa + Xen + oc + op Naa + Mee + Asc + Yao Xag t+ Xap + tact Xen = 1 oF Kip t Xe + Xa tay Xp + Xpp + Xoo + typ = 1 oF Met Xapt Rect xsc= 1 or Xp + Xap + Xap + Xap 1 or If you are required to formulate the MAXIMISING problem as a linear programming problem, transform the matrix as on pages 48-9, then proceed as usual. a] { 3 A | aa] 15 [21 B | 14 | 18 | 17 c | 16 | 13 | 23 Three workers A, B and C are to be assigned to three sites 1, 2 and 3 in order to collect the names and addresses of those who may be considering changing their fuel supplier. The number of names and addresses each worker is likely to collect at each site is shown in the table above Each worker must be assigned to just one site and each site assigned to just one worker. The fuel company wish to maximise the number of names and addresses collected. Formulate this as a linear programming problem, defining your variables and making the objective and constraints clear. Before we formulate the problem, we need to alter the matrix because it is a maximising problem. We simply subtract all entries from the largest number giving Tas * ze] 2 9[s\é \icsilevallea|ic) > oAllocation (assignment) problems We then proceed as usual. FIRST define your decision variables: Let xy be O or 1 Vif worker does job J "LO otherwise where 1E A,B, Cand je1,2,3 NEXT write down the objective function: minimise P = 12xi4 + Bre + 2xc + O24 + Stes + Grae + Tia, + 1056 FINALLY write down the constraints: Subject to xy txt X51 oF Yo t Xe + Xap =1 or Xgtitgtig=1 or ty tte tiq=1 or %yot Xo +Aq=1 oF Xp + Xp +%q=1 or Questions 1 and 2 The tables show the cost, in pounds, of allocating workers to tasks ‘You wish to minimise the total cost. Formulate these as linear programming problems, defining your variables and making the objective and constraints clear. 1 Task C | TaskD | Task E Worker L Ed 15 12 WorkerM | 25 1B 16 Worker N 32. 41 35. 2 Tasks | TaskT | TaskU | Task V ‘Worker C 36 34 32, 35 ‘Worker D 37 32, 34 33 Worker E 42 35 37, 36 Worker F 39 34 35 | 35Questions 3 and 4 Repeat questions 1 and 2, but take the entries to be the profit eamed in allocating workers to tasks, and seek to maximise the total profit, 1 Airport | Depot | Docks Station Bring-it 322, 326 326 328 Collect-it_ | 318 325 324 325 Fetch-it 315 319 317 320 Haulit 323 322 319 321 ‘A museum is staging a special exhibition. They have been loaned exhibits from other museums and from private collectors. Seven days before the exhibition starts these exhibits will be arriving at the airport, road depot, docks and railway station and in each case the single load has to be transported to the museum. There are four local companies that could deliver the exhibits: Bring-it, Collect-it, Fetch-it and Haul-it. Since all four companies are helping to sponsor the exhibition, the museum wishes to use all four companies, allocating each company to just one arrival point. The table shows the cost, in pounds, of using each company for each task. The museum wishes to minimise its transportation costs. Reducing rows first, use the Hungarian algorithm to determine the allocation that minimises the total cost. You must make your method clear and show the table after each stage. State your final allocation and its cost. 2 Back | Breast | Butterfly | Crawl using each type of stroke during the last training session. a Use the Hungarian algorithm, reducing rows first, to find an allocation that minimises the total time it takes the team to complete all four lengths. b State the best time i the race. which this team could complete ¢ Show that there is more than one way of allocating Se Jack 18 20 19 4 Kyle 19 21 19 4 Liam 7 20 20 16 Mike 20 21 20 15 A medley relay swimming team consists of four swimmers. The first member of the team swims one length of backstroke, then the second person swims a length of breaststroke, then the next a length of butterfly and finally the fourth person a length of crawl. Each member of the team must swim just one length. All the team members could swim any of the lengths, but some members of the team are faster at one or two particular strokes. The table shows the time, in seconds, each member of the team took to swim each length Bb the team so that they can achieve this best time.4) Ss ‘Allocation (assignment) problems Grand Hall_ | Dining Room | Gallery | Bedroom | Kitchen Ale 8 19 i 4 2 Betty 12 7 14 18. 20 Charlie 10 22 18 4 19 Donna 9 15 16 15 21 Eve 14 23 20 20 19 Five tour guides work at Primkal Mansion. They talk to groups of tourists about five particularly significant rooms. Fach tour guide will be stationed in a particular room for the day, but may change rooms the next day. The tourists will listen to each talk before moving on to the next room. Once they have listened to all five talks they will head off to the gift shop. ‘The table shows the average length of each tour guide's talk in each room. A tourist party arrives at the Mansion. a Use the Hungarian algorithm, reducing rows first, to find the quickest time that the tour could take. You should state the optimal allocation and its length and show the state of, the table at each stage. b Adapt the table and re-apply the Hungarian algorithm, reducing rows frst, to find the longest time that the tour could take. You should state the optimal allocation and its duration and show the state of the table at each stage. Award ceremony | Film premiere | Celebrity party Denzel 245 378 459 Eun-Ling 250 387 467 Frank 224 350 442 Gabby 231 364 453 A company hires out chautfer-driven, luxury stretch-limousines. They have to provide cars for three events next Saturday night: an award ceremony, a film premiere and a celebrity party, The company has four chauffeurs available and the cost, in pounds, of assigning each Of them to each event is shown in the table above. The company wishes to minimise its total costs a Explain why it is necessary to add a dummy event. b Reducing rows first, use the Hungarian algorithm to determine the allocation that ‘minimises the total cost. You should state the optimal allocation and its cost and show the state of the table at each stage. Cat Cleaning | Computer Copying | _ Post Blue No 863 636 628, 739 Green 562 796 583, 478, 674 Orange No | __ 825 672 | ~_—‘583 736 Red 635 881 650 538, No Yellow 688 934 No S34 NoA large office block is to be serviced and supplied by five companies Blue supplies, Green services, Orange office supplies, Red Co and Yellow Ltd. These companies have each applied to take care of catering, cleaning, computer supplies/servicing, copying and postal services. The table shows the daily cost of using each firm, in pounds. For political reasons the owners of the office block will use all five companies, one for each of the five tasks, Some of the companies cannot offer some services and this is indicated by ‘No’. Use the Hungarian algorithm, reducing rows first, to allocate the companies to the servies in such a way as to minimise the total cost. You should state the optimal allocation and its cost and show the state of the table at each stage. Cafe | Coffee shop | Restaurant | Snack shop Ghost train 834 365 580 648, Log flume 874 375 No 593 Roller coaster 743 289 No 665 Teddie’s adventure | 899 500 794 No ‘The owners of a theme park wish to provide a café, coffee shop, restaurant and snack shop at four sites: next to the ghost train, log flume, roller coaster and teddie’s adventure. They. employ a market researcher who estimates the daily profit of each type of catering at each site. ‘The market researcher also suggests that some types of catering are not suitable at some of the sites, these are indicated by ‘No’. Using the Hungarian algorithm, determine the allocation that provides the maximum daily profit. ‘This question is a maximising question and one with incomplete data. You need to chose ‘numbers to put at the sites marked ‘No’ so that they become ‘unattractive’ to the algorithm after ‘it has been altered to look for the maximum solution. 1[2]3 [4 143 | 243 | 247 | 475 132 | 238 | 218 | 437 126 | 207 | 197 | 408 138 | 222 | 238 | 445 vals Four workers F, Q, R and § are to be assigned to four tasks 1, 2, 3 and 4. Each worker is to be assigned to one task and each task must be assigned to one worker. The cost, in pounds, of, using each worker for each task is given in the table above, The cost is to be minimised. Formulate this as a linear programming problem, defining your variables and making the objective and constraints clear.Allocation (assignment) problems 8 alpiclp P| 13 | 17 | 1s | 18 | Q [as | 19 | 12 | 19 eal R | 16 | 20 | 13 | 2 “1 s [14 [1s [17 [ 24 Krunchy Cereals Ltd will send four salesmen P, Q R and S to visit four store managers at A, 1 B, Cand D to take orders for their new products. Each salesman will visit only one store ae manager and each store manager will be visited by just one salesman. The expected value, in| thousands of pounds, of the orders won is shown in the table above, The company wishes to maximise the value of the orders. Formulate this as a linear programming problen objective and constraints clear. defining your variables and making the Summary of key points 1 To reduce a cost matrix: ‘* Subtract the least value in each row from each element of that row. ‘© Using the new matrix, subtract the least value in each column from each element in that column, 2 The Hungarian algorithm: Find the reduced cost matrix. © Find the minimum number of straight lines (horizontal or vertical) which will cover all of the zeros in the matrix. In an m x n matrix, if you cannot cover the zeros in fewer than rt lines, you have an optimal solution and you stop. In an n x n matrix, if you can cover the zeros in fewer than 1 lines, the solution can be improved, Draw in the lines and look for the smallest uncovered element, e. Add ¢ to the elements in each covered row and each covered column, adding it twice to any element covered twice. Subtract ¢ from every element in the matrix. Repeat procedure until an optimal solution is found. 3 Asa short cut, after drawing in the lines: «Increase each element covered by two lines by e. ‘+ Leave each element covered by one line unchanged. ‘+ Subtract e from each uncovered element. 4 If the problem is not x n you add a dummy row or column of zeros and proceed as for ann X nmattix.In this chapter you wil 4 —~ + lear the differences between the classical and practical problems ‘* use a minimum spanning tree method to find an upper bound and a lower bound ‘* use the nearest neighbour algorithm to find an upper cad bound. The | travelling sal ee ain This is similar to the route inspection problem in book D1, but here you seek to visit every node rather than every are, You wish to minimise the total distance travelled by a ‘salesman’ who leaves his home, visits several places and then returns home.| 3,1 You understand the terminology used. You are seeking a walk that gives us a minimum tour. ‘* Awalk in a network is a finite sequence of edges such that the end vertex of one edge is the start vertex of the next. ‘+ Awalk which visits every vertex, returning to its starting vertex, is called a tour. ‘There is no viable algorithm known for the solution of the travelling salesman problem. You therefore make use of an heuristic algorithm (this means that it is an intuitive algorithm) which should give a good answer but probably not the optimal answer, In practice we can find an upper bound and lower bound for the solution and use these to ‘trap’ the optimal solution. If our upper and lower bounds are close, then a solution between the two may be acceptable. You will therefore find upper bounds and then select the smallest and find lower bounds and select the largest, trying to ‘trap’ the optimal solution in as narrow an interval as possible. If you know that your shortest route is between 123 and 145 miles, say, and you find a route that is 123 miles long, then you know you have found ‘the optimal route. If you find a route that is 130, miles long you may decide that it is ‘optimal ‘enough’ and use it 3,2. You should know the differences between the classical and practical problems. There are two travelling salesman problems: the classical problem in which once a vertex has been visited it may not be revisited, and the practical problem in which a vertex may be revisited, ‘The difference is that: Min the classical problem you must visit each vertex only once, before returning to the start, in the practical problem you must visit each vertex at least once before returning to the start. 3,3. You can convert a network into a complete network of least distances. If you convert the network into a complete network of least distances, the classical and practical travelling salesman problems are the same._The traveling salesman problem 4 ‘To create a complete network of least distances you ensure that the triangle inequality holds for all triangles in the network. The triangle inequality states Pres the longest side of any triangle = the sum of the two shorter sides. (if you had three rods with lengths 4m, 2m and 1m, you could not form a triangle with them. The two shorter rods could not connect up.) a Equality s possible, There is active debate about whether the resulting figure Is atrlangle. on For the purposes of this tpi, equality would be acceptable di If you have a network where the triangle inequality does not hold in one or more triangles, you simply replace the longest arc in those triangles by the sum of the two smaller ones, thereby creating a network which shows the shortest distances. {In the examination this can usually be done by observation and it is not necessary to apply Dijkstra’s algorithm. If it is necessary to use Dijkstra’ algorithm you would be directed to do so. Create a table of least distances for the network below, ‘Usually in the examination you are asked to complete a table of least distances, by finding just a few missing values. u In the examination you are likely to be asked for the ‘tricky’ ones— for example [BC in this first example. So do check carefully for non-
1You can use this to fill n the first column Alelclple = [1 [13 | 19 | a Since this is not a directed 7—} network, the shortest distance from A to D is the same as the 15 = shortest distance from D to A. In this topic directed networks will not be examined in D2. miolola|> Move on to the remaining routes starting from B. Aleleclole ‘The direct route BC on the network is given as 27, but if you use BAC as A{- || 15 {19 | 31 ‘your route you get 24, so 24 is the pin |-|2| 6 | 22 feast distance from B to C. ¢ [13 [a4 | = You complete BD and BE by CBIBied Ren = observation, using BDE as the shortest E | a | 22 = route from B to E. Once again you use the table's symmetry to complete the second column. Considering the remaining routes starting at C, you get Alelclole Starting at C you have two routes to = find: CD and CE. The direct arc CE is the as ELE Ee shortest route. Bn - [a] oe [2 For CD you need to check CED (length 32) = and CABD (length 32), so you can record ama Ee oe 32. (You do not need to check CBD since o [| | 22| - ‘you found that the direct route CB was £ | si) e2 | = longer than the route CAB earlier.) Finally you complete the last ing the completed table of least differences. Alelclple al - [1] 3/19/31 6 | 1 |- |e) 6 | 2 c |i [24] - |az/ olla ls2|-|4 E [ai |22[ia la - In the examination candidates will ust have to show the final table.ling salesman problem Zo NSES re Bee The network above shows the distances, in km, between the central sorting office at $ and six post offices A, B, C, D, Eand s;A[Bl[c DIE = 2 5 { [-T[2 [19 [47 2/-[s |i 5 [- |i2[al7 1 [a7 [a2] - [3 a | ag [2a | 13 | - [a4 3 [3 7 wf - ‘The table shows a partially completed table of least distances. Complete the table of least distances for the network above, stating your shortest route for each of the entries. SA~ the shortest route is SFA length SB — the shortest route is SCB length 7 SD ~ the ehortest route is SCD length 14 SE — the shortest route is SFE length 19 ai < ‘AC —the shortest route is ABC length 7 5 BE — the shortest route is BAFE length 19 BF ~ the shortest route is BAF length 5 DE ~ the shortest route is DCSF length 19 Which gives the following table of least distances, slalelcl[olelr -|el[7l|2|4}wls 6([-l2{[7/9l[7[3 7Tl2\/-|s[wlwls 2|7|s|-[elal7z ia | 19 [17 | 2 | - | 3 [19 19 [7 [19 | 2 [3 | - [a s[s[s[7[ol-[- mim|olole)elo aim|siale >)oPhotocopy masters are available for each of these questions. Questions 1 to 4. Complete the table of least distances for each of the networks. State the route you used for each of your entries. 1 A z B Table of least differences 5 - i A[B[c[p[E > A] [2 5 D 8 c Bi[7|[-|3 c 3[-[el2 D 8[-|4 E| 5 zi | - ai A ‘Table of least differences 15 5 A[B[C|[DI[E = 7 mlolo|e|> c 2|- 3 B ‘Table of least differences 1 ay aA|Bi[c|p/ieE/F i c A[-|10 13 | 15 B10] - 3 c = 3 D | 13/3 -[2{[s B |S 3/2 |- F 5 = Table of least differences [ Alpi[cl[p/elF A | - [10] 9 | 10/17 B | 10| - | 3 | 20 10 | 20 clo [3] - ils D | 10 | 20 | 19 | - 20 | 10 E F G 7 8 - [8 [18 10 20| 8 | - |W 20 10 | 18 | 10 | -‘The traveling salesman problem 4 ‘The minimum spanning tree method to find an upper bound PRE: ‘© Find the minimum spanning tree for the network (using Prim’s algorithm or Kruskal’s algorithm). This guarantees that each vertex is included, ‘+ Double this minimum connector (in effect you keep on retracing your steps) so that completing the cycle is, guaranteed, ‘© Finally seek ‘short cuts’, (Make use of some of the non- ncluded arcs that enable you to bypass a repeat of some of the minimum spanning tree.) Finding an initial upper bound If you find a minimum spanning tree for a network, an initial attempt to locate an upper bound can be made by finding the minimum spanning tree and repeating each arc. x B re E D F G Minium spanning tree Initial upper bound, ‘This visits each vertex and returns to the start. You find the length of this route, by doubling the weight of the minimum spanning tree, and using it as an initial upper bound. HE An initial upper bound is found by finding the weight of the minimum spanning tree for the network and doubling Use Kruskal’s algorithm to find a minimum spanning tree for the network above, Hence find an initial upper bound for the travelling salesman problem.In the examination you could be asked to use Prim’s algorithm or Kruskal’s algorithm to find the minimum spanning tree. If you are not directed to a particular algorithm, you may use either. Using Kruskal’s algorithm Putting the arcs in order: {AC, AD}, CE, {BF; CD, DE} DF. {B0. FG}. {AB, EG} Include AC, AD, CE, BF, reject CD, reject: DE, include DF, reject: BD, include FG. Tree complete This gives the following minimum spanning tree The initial upper bound io 2 X BO = 6O. A | - [11 [a3 [19 | 31 B |u| - [2| 8/2 c | 13 | 24 | - | 32 | 18 D|i9/ 8 |32|- | 14 E | 31 | 22 [18 [14 | - Use the table of least distances to find an initial upper bound for the travelling salesman problem in example 1. Starting at A iy) S20 | an ae aleleclole A a [13 | 19 | 3 = | 24 When using a table itis easier eB besa aa Ee 10 use Prim’s algorithm. c 24| - | 32 | 18 D|19|@)\32| - | 4 E | a [22/3 (@ Order of arc inclusion: AB, BD, AC, DE‘The travelling salesman problem 4 Te eee tee 192, The initial upper bound is 2X 46 = 92 ‘The initial upper bound is not very good, since we repeat each arc. We can improve the initial upper bound by looking for short cuts. Example Starting from the initial upper bound found in example 4, use a short cut to reduce the upper bound to below 70. 8 Use CE(I8) instead of repeating CA(I3), AB(I), BD(B) and DE(I4), this saves B+N+ B+ 14-18 This gives the following route es 3. 8 iG > 1s 14 F Improved upper bound is now! + & + 14 +18 +13 = 64Al[ep[c[p[e|Fl[Gia A_| — | 47 | 84 | 382 | 120 | 172 | 299 | 144 B | 47 | — | 121 | 402 | 155 | 193 | 319 | 165 c | 84 | 121 | — | 456 | 200 | 246 | 373 | 218 D_| 382 | 402 | 456 | - | 413 | 220 | 155 | 289 E_| 120 | 155 | 200 | 413 | - | 204 | 286 | 131 F_| 172 | 193 | 246 | 220 | 204 | - | 144 | 70 G_| 299 | 319 | 373 | 155 | 286 | 144 | - | 160 H_| 144 | 165 | 218 | 289 | 131 | 70 | 160 | - a Using Frim’s algorithm ise the total distance travelled. © Use short cuts to reduce this upper bound to a value below 1300. i S20 tena 6|7 | alelecl|o FG [a [ = | 47 | 84 [322| 120 | 172 [209] 144 5 = | 121 | 402 | 165 | 193 | 319 | 165 | ¢ [@4| 1a | - [456 | 200] 246 | 373 | 218 |p |382|402|456| - | 413 | 220 | (65)| 289 E |@O)| 155 |200| 415 | - | 204|286| 121 F | 172 | 193 |246|220| 204] — | 144 |Go) |_@ | 299| s19 | 373 | 165 | 286 |Gaa)| - | 160 H | 144 | 165 | 218 | 289|G@an)| 70 | 160] - Order of arc selection: AB, B fe b The initial upper bound fe 2X 751 Gan 4 E 120) H Ta 70 F AC, AE, EH, HE, FG, GD @ TH 155 The table shows the distance, in miles, between eight cities. A politician has to visit each city, starting and finishing at A. She wishes to m a Find a minimum spanning tree for this network. bb Hence find an upper bound for this problem, © iadaptea)‘The travelling salesman problem 4 © Looking at the tree, likely shortcuts are AD and BC. AD saves 120 + 131 + 70 +144 + 155 — 382 = 238 Pres BC saves 47 + 84 ~ 121 =10 This leaves the following tour : Les "eon 382, Tour ABCAEHFGDA Tour length = 47 + 121 + 84 + 120 + 131+ 70 + 144 +155 + 382 = 1254 Selecting the better upper bound In example 6 there are many other shortcuts that could be tried. For example, here are three others. {BD saves 265, so this shortcut alone would have been sufficient 402, cs ‘Tour ABDGFHEACA, length 1237 B+ AP +FD 172. ‘Tour ABCAEHFGDFA, length 1264 iii CD alone saves 248, 456 Tour ABAEHFGDCA, length 1254 Of these the best upper bound is 1237 since this is the smallest. Aim to make the upper bound as low as possible to reduce the interval in which the optimal solution is contained,a Find a minimum spanning tree for the network above and hence find an initial upper bound for the travelling salesman problem. b Use a shortcut to find a better upper bound, State the route given by your improved upper bound and state its length, aA;Bli[c pie A | — [a3 [aa [19 [aa B [3 - [12] 7 | 16 c {ula} -fuls pf i9 {7 [ul] - |i E 4 [i6[ 8 |u| - A council employee needs to service five sets of traffic lights located at A, B, C, D and E. The table shows the distance, in miles between the lights. She will start and finish at A and wishes to minimise her total travelling distance. a Find the minimum spanning tree for the network. b Hence find an initial upper bound for the length of the employee's route. © Use shortcuts to reduce the upper bound to a value below 65. d State the route given by your improved upper bound and state its length, a Find a minimum spanning tree for the network above and hence find an initial upper bound for the travelling salesman problem. b Use shortcuts to reduce the upper bound to below 240. € State the route given by your improved upper bound and state its length.‘The traveling salesman problem 4 4 s[v[w[|x|y|z s | - | 75 | 30 | 85 | 70 : v | 7% | - [55 | 30 | 40 Pres w | 30 — | 65 | 45 | 55 x) 55 6 - | 15) 10 y | 70 45 | 15 | - | 20 z | 7 5510 | 20) - wot The table shows the time, in minutes, taken to travel between a surgery S and five farms V, W, X, Y and Z. A vet needs to visit animals at each of the farms and wishes to minimise the total travel time, He will start and finish at the surgery, S. eS a 9. a Find a minimum spanning tree for the network above and hence find an initial upper bound for the travelling salesman problem. 1b Use the method of shortcuts to reduce the upper bound to below 200, State the route given by your improved upper bound and state its length. 3,5. You can use a minimum spanning tree method to find a lower bound. | This method finds a lower bound for the classical problem. ‘The ideal solution would be one where each vertex is visited only once, and thus each vertex will have only two ‘shortest ates incident on it in the solution. If you find the ideal optimal solution it would be possible to remove any vertex and the two arcs linking it into the tour, leaving you with a minimum ‘spanning tree for the remaining vertices. This is the essence of the algorithm. The minimum spanning tree method to find a lower bound « Remove each vertex in turn, together with its arcs. © Find the residual minimum spanning tree (RMST) and its length. Add to the RMST the ‘cost’ of reconnecting the deleted vertex by the two shortest, distinct, ares and note the totals. ‘« The greatest of these totals is used for the lower bound. ‘+ Make the lower bound as high as possible to reduce the interval in which the optimal solution is contained. + You have found an optimal solution if the lower bound gives a tout, or the lower bound has the same value as the upper bound. ‘This method of deletion and reconnection will not, in general, give a viable tour. ‘The one most likely to be a tour is the greatest, which is why itis selected.A[B[CI[DI/E A -|u/)i9) a B |u| - |i s | 2 | c | 13 | 2[ - [32 | 18 p | i9 | 8 | 32 | - | 4 E | 31 | 22 | 18 | 14 | - ‘By deleting vertex A, find a lower bound to the travelling salesman problem for the network in example 4. b Comment on your answer. In the examination you will be directed to delete specific vertices. You will not hhave to check all the vertices, unless you are specifically instructed to do so. a When Ais deleted, the table for the residual network becomes || eel eee es ea Ren om Me: Le [- [ee lez c lal -|a2l® p|@®|s2| - [4 E | 22| 6 |@| - Using Prim's algorithm starting at B, the order of arc selection is BD, DE and EC The residual minimum spanning tree is B D E c os 3 ry 18 Weight of residual minimum spanning tree = B + 14 +18 = 40 The two least arcs from A are AB (11) and AC (13) B D E Lower bound = weight of RMST + weights of 2 least arcs from A =40+1413 = 64ling salesman problem b Either: The lower bound is a tour, therefore it is optimal. ag 4 or: The improved upper bound (found in example 5) is G4. PRes Since the improved upper bound = 64 = loner bound, . wwe have found the optimal solution for this travelling salesman problem. alsei[c[pl[eE;[F[G[H = | 47 | 84 | 382 | 120 | 172 | 299 | 144 121 | 402 | 155 | 193 | 319 | 165, 84 | 121] - | 456 | 200 | 246 | 373 | 218 382 | 402 [456 | - | 413 | 220 | 155 | 289 120 | 155 | 200 [413 | — | 204 | 286 | 131 172 | 193 | 246 | 220 | 204 | — | 144 | 70 299 | 319 | 373 | 155 | 286 144| - | 160 144 | 165 | 218 | 289 | 131 | 70 | 160 | — a By deleting vertices A then G, find two lower bounds to the travelling salesman problem for the network above (from example 6). b Select the better lower bound of the two found in part a, give a reason for your answer. ‘© Taking your answer to b and using the better upper bound, 1237, found on page 71, write ne down the smallest interval that must contain deleted, in turn, to find other lower bounds. the length of the optimal route. aI Deleting A and using Frim's algorithm starting at B z2[7[s[slel[¢4 in| EDN | ea em |ken| a = _| 121 | 402| 155 | 193 | s19 | 165 Gap| - | 486 | 200 | 246 | 373 | 218 402|456| - | 413 | 220 | 8)| 229 @)| 200] 413 | - | 204| 286] 131 econo 193 | 246 [220 | 204| - | 144 need to make your method ola|> 1 zlalm|m)o a= for finding the RMST clear 319 | 373 | 155 | 286 |@4| - | 160 Feet ee Issulficient tod H_ | 165 | 216 [200 [Gap 70 | 160 | — ttck yOu Gare applied PAS algorithm correctly. alamo Order of arc selection: BC, BE, EH, HF, FG, GDThe residual minimum spanning tree ist a B E H E G D o__+___+_+ __. __4 _4 ai” 188 iat 70 148155 Weight of RMST = 776 Two least arcs from A are AB (47) and AC (B4) C a1 Boiss E 131 H 70 F 144 G 155 D ‘This is not a tour. In general you do not get a tour when finding a lower bound. Lower bound by deleting A = 7/6 + 47 + 84 = 907 Deleting G and using Prim’s algorithm starting at A 1fz2[s[7[4]e[s5 alelclolelri[y A | - | 47 | 84 [302] 120 | 172 | 144 B |G@A| — | 121 | 402 | 166 | 193 | 108 ¢ [Ga] 7 | — [456 [200 | 246 | 216 |p |302|402|456| - | 4% |€20] 260 E |@20)| 155 |200| 413 | - | 204] 11 F_| 172 | 198 [24 | 220|204| - [GO H | 144 | 165 | 218 | 280 |Gad| 70 | - Order of arc selection: AB, AC, AE, EH, HF and FD ‘The residual minimum epanning tree is: Baw 4 E H F D 720° is * 70° 220 cos Weight of RMST = 672 Two least arcs are GF (144) and GD (165) Bee E H F D Once again we do not get a tour when We ‘reconnect’ G. The lower ia a eee hhound rarely gives a tour. If it does give a tour we have an optimal solution. Lower bound by deleting G = 672 + 144 + 155 = 971‘The travelling salesman problem 4 b The better lower bound is the higher one, 971, the one obtained by ine deleting G. Phes This will reduce the size of the interval containing the optimal solution. The better lower bound is 971, the better upper bound is 1237 971 < optimal solution < 1287 Rix, ‘We use < for the lower bound, because we can see itis not a solution. 29. We use = with the upper bound, because it may be the optimal solution. a By deleting vertex A, find a lower bound to the travelling salesman problem for the network above. b Comment on your answer. 2 A;Bl[c > D/E A | [13 [1 | 19 | 14 B13 | - [12] 7 | 16 c/[ufwl- [nies pili f[7[ul-|[u E | 14 [16 | 8 | 4 [ - A council employee needs to service five sets of traffic lights located at A, B, C, D and E. ‘The table shows the distance, in miles between the lights. She will start and finish at A and wishes to minimise her total travelling distance, a By deleting vertices A then B find two lower bounds for the employee's route. b Select the better lower bound, ing a reason for your answer. Dimitri 7 <<a By deleting vertices A then B, find two lower bounds for the travelling salesman © Use inequalities, your answer to b and the improved upper bound found in exercise 3B a problem, b Select the better lower bound, giving a reason for your answer. —s see Question 3, to write down the smallest interval containing the optimal route 4 si[vj[wi|x|y|{z s | — [75 [30 [ss [70 | 70 v_| 7s | - [55 | 30 | 40 | 15 w | 30 | 55 | - | 6s | 45 | 55 x [ss | 30 [65 | - [1s | 10 y | 70 | 40 | 45 | 15 | - | 20 z | 70 | 15 [55 | 10 | 20 | - The table shows the time, in minutes, taken to travel between a surgery S and five farms V, W, X, Yand Z. A vet needs to visit animals at each of the farms and wishes to minimise the total travel time, He will start and finish at the surgery, S. a By deleting vertices S then V, find two lower bounds for the vet's route. b Select the better lower bound, gi ing a reason for your answer. ¢ Use inequalities, your answer to Bb and the improved upper bound found in exercise 3B. Question 4, to write down the smallest interval containing the optimal route. [36 You can use the nearest neighbour algorithm to find an upper bound. ‘The particular value of the upper bound is that it gives a solution, probably not the optimal solution, but a tour that could be used, It's difficult to find a good set of shortcuts in a large network, so the minimum spanning tree method can be difficult to use. There are other heuristic algorithms to help find an upper bound and one is the nearest neighbour algorithm, The method is as follows.The nearest neighbour algorithm 1. Select each vertex in tum as a starting point, ‘The traveling salesman problem 4 2 Go to the nearest vertex which has not yet been visited. 3. Repeat step 2 until all vertices have been visited and then return to the start vertex using the shortest route. 4 Once all vertices have been used as the starting vertex, select the tour with the smallest length RI. as the upper bound. ont? In the examination you wil be directed to start with specific vertices. You will only have tocheck al 2 7 the vertices, if you are specifically instructed to do so. Sea pee ere reer eee ‘ad ‘The nearest neighbour algorithm is what is often done by students who implement Prim’s algorithm: = ne aaa eas eo alspi[cl[p/e Al - | 8 | 7 | 29 | 13 Bi) 38 | - [9 [2/1 cl7[9/- [ale D | 29 | 24 | 23 | - | 2 EB | wliu[e6 [a | - Apply the nearest neighbour algorithm, using A then B then C as starting vertices, to find an upper bound to the travelling salesman problem. Nearest neighbour tour starting at A ATER HEEEEE LEEEB HEED ISH A ‘This demonstrates the failing in the nearest neighbour algorithm, the last two arcs were ‘forced’ on us and both are long arcs.B A CG & bb 8 Bw) 8 You now have three answers: BO, G6 and 74. Select 66 as the best upper bound, since this gives the shortest tour A[se[c[p[el[r[G{[u A 47 | 84 | 382/120 | 172 | 299 | 144 B | 47 | — | 121 | 402 | 155 | 193 | 319 | 165 c | 84 | 121 | = | 456 | 200 | 246 | 373 | 218 D_| 382 | 402 | 456 | - | 413 | 220 | 155 | 289 B | 120 | 155 | 200 | 413 | - | 204 | 286 | 131 F | 172 | 193 | 246 | 220 | 204) - | 144 | 70 G_| 299 | 319 | 373 | 155 | 286 | 144 | - | 160 H_| 144 | 165 | 218 | 289 | 131 | 70 | 160 | = This is the table of distances from example 8. We found that the optimal solution lay in the following interval 971 < optimal solution < 1237. a Use the nearest neighbour algorithm, using A then B as starting fee vertices, to find upper bounds for the travelling salesman problem. be used, in turn, to b Review the interval containing the optimal solution and amend it it __findother upper necessary, giving a reason for your answer.a Nearest neighbour tour starting at A A 8 G6 Woof @ b> A 47 12 200 11 70 144 65 382 Nearest neighbour tour starting at B [Leer subse sosen(: eotetly) f04tl 220ber(<)BtsnIUBesee)) 47° 84 200 131 70 144 65 402 b The interval is now 971 < optimal solution =< 1235. We replace the upper bound of 1237 with the better upper bound of 1233, since It is lower. This reduces the interval containing the optimal solution. 1) (This is the same problem as described in exercise 3C Question 2) A;B[c[D/E A | - [13 [a1 [49 | a4 Bw] - | i2/ 7 | 16 e/ufiwl-|ules p/i9| 7 {a |- |i E 14 [16 | 8 | 14] - A council employee needs to service five sets of trafic lights located at A, B, C, D and E. The table shows the distance, in miles between the lights. She wishes to minimise her total travelling distance.I a Starting at D, find a nearest neighbour route to give an upper bound for the council employee's route. b Show that there are two nearest neighbour routes starting from E, ¢ Select the value that should be given as the upper bound, give a reason for your answer. (This isthe same problem as described in exercise 3C Question 4) s[v[w[x|[y][z s | - | 75 | 30 | 55 [70 | 70 v_| 75 | - | 55 | 30 | 40 | 15 w | 30 | 55 65 | 45 x | 55 | 30 | 65 | - | 15 | 10 y | 70 | 40 | 45 | 15 20 70 | 15 | 55 | 10 | 20 | - N The table shows the time, in minutes, taken to travel between a surgery S and five farms V, W, X, Yand Z. A vet needs to visit animals at each of the farms and wishes to minimise the total travel time. a Starting at Z, find a nearest neighbour route. b Find two further nearest neighbour routes starting at X then V. € Select the value that should be given as the upper bound, give a reason for your answer. r[s[tilul[vi[w R_| — | 150 | 210 | 150 | 120 | 240 s_| 150 | - | 210 | 120 | 210 | 240 T | 210 | 210} ~ | 120] 150 | 180, u_| 150 | 120 | 120 | - | 180 | 270 Vv 120 | 210 | 150 | 180 w_| 240 | 240 | 180 | 270 | 300 300 A printing company prints six magazines R, S, T, U, V and W, each week. The printing equipment needs to be set up differently for each magazine and the table shows the time, in minutes, needed to set up the equipment from one magazine to another. The printer must print magazine R at the start of the first day each week so the equipment is already set up to print magazine R, and must be left set up for magazine R at the end of the week. The other ‘magazines can be printed in any order. a If the magazines were printed in the order RSTUVWR, how long would it take in total to set up the equipment? b Show that there are two nearest neighbour routes starting from U, ¢ Show that there are three nearest neighbour routes starting fom V. Select the value that should be given as the upper bound, give a reason for your answer.‘The travelling salesman problem 4 2 ee nS a co 450 a Use an efficient algorithm to find a minimum connector for the network above. You must make your method clear. b Hence find an initial upper bound for the travelling salesman problem. © Use the method of short cuts to find an upper bound below 6100. 4 3 B © 3 ‘The network above shows a number of hostels in a national park and the possible paths joining them. The numbers on the edges give the lengths, in km, of the paths. a Draw a complete network showing the shortest distances between the hostels. (You may do this by inspection. The application of an algorithm is not required.) b Use the nearest neighbour algorithm on the complete network to obtain an upper bound to the length of a tour in this network which starts and finishes at A and visits each hostel exactly once. € Interpret your result in part b in terms of the original network.ws SY mi ee a Network N The table of least distances below was formed from the network, N, above. s[alp[c[pD[E|F s|-|s]7/2 u/s Als |- [27 [19 [a7 [3 Bil 7[2]/-[s /i7/iw[s e[z{[7 [s|-|iwlal7 p | 14 | 19 | 17 | 12 | - | 13 | 19 E | 19 [17/19 | 21/13 | - | 14 Fl s | 3 7 [a9 [14 | = The table shows the distances, in km, between the central sorting office at offices A, B, C, D, Eand F and six post A postal worker will leave the sorting office, go to each post office to collect mail and return to the sorting office. He wishes to minimise his route a Use Prim’s algorithm, starting at S, to obtain two minimum spanning trees. State the order in which you select the arcs. b Hence find an initial upper bound for the postal worker's route, € Starting from this upper bound, use shortcuts to reduce the upper bound to a value below 60km. You must state the shortcuts you use. Starting at C, and then at D, find two nearest neighbour routes stating their lengths. € Select the better upper bound from your answers to ¢ and d, give a reason for your answer. £ Interpret your answer to e in terms of the original network, N, of roads g Using the table of least distances, and by deleting C, find a lower bound for the postal worker's route.‘The travelling salesman problem 4 a Explain the difference between the classical and practical travelling salesman problem. Plav[rR[s|[tilulv P| - | 19 | 30 | 45 | 38 | 33 | 29 Q | 19 | - | 28 | 27 | 50 | 23 | 55 R | 30 | 28 | — | si | 29 | 49 | so s [45 [27 [51 [ - | 7] ala T | 38 | 50 | 29 | 77 | - | 69 | 37 u | 33 | 23 | 49 | 21 | 9 | - | 56 v_| 39 | 5 | so | 71 | 37 | 56 | — ‘The table shows the travel time, in minutes, between seven town halls P, Q R, , T, Uand V. Kim works at P and must visit each of the other town halls to deliver leaflets. She wishes to minimise her route. b Find a minimum connector for the network. You must make your method clear by listing the arcs in order of selection. ¢ Use the minimum connector and shortcuts to find an upper bound below 220, You must list the shortcuts you use and your final route, d Starting at P, find a nearest neighbour route and state its length. € Find a lower bound for the length of the route by deleting P. £ Looking at your answers to ¢, d and e, use inequalities to write down the smallest interval containing the optimal solution, 5 A{pilc|pi{[e|rie A_| — [103] 89 | 42 | sa | 143 | 153 B | 103 | - | 60 | 98 | 56 | 99 | 59 c | 89 | 60 | - | 65 | 38 | se | 77 p | 42 | 98 | 65 | - | 45 | 111 | 139 E | 54 | 56 | 38) 45 | - | 95 | 100 F [143 [99 [58 | 95 | - | 75 G | 153 | 59 | 77/139] 100) 75 | - A computer supplier has outlets in seven cities A, B, C, D, E, Fand G. The table shows the distances, in km, between each of these seven cities. John lives in city A and has to visit each Of these cities to advise on displays. He wishes to plan a route starting and finishing at A, visiting each city and covering a minimum distance. a Obtain a minimum spanning tree for this network explaining briefly how you applied the algorithm that you used, (Start with A and state the order in which you selected the ares used in your tree.) b Hence determine an initial upper bound for the length of the route travelled by John. Explain why the upper bound found in this way is unlikely to give the minimum route length, Starting from your initial upper bound and using an appropriate method, find an upper bound for the length of the route which is less than 430 km, € By deleting city A, determine a lower bound for the length of John’s route. £ Explain under what circumstances a lower bound obtained by this method might be an optimum solution. 2 ee nS a hed oe6 Li clo|.s E London (L) = | 80 | s6 | 120 | 131 | 200 Cambridge (©) 80 | - | 100 | 98 | 87 | 250 Oxford (0) 36 | 100 | - | 68 | 103 | 154 Birmingham (B) | 120 | 98 | 68 | - | 54 | 161 Nottingham (N)_| 131 | 87 | 103 | 54 | - | 209 Exeter (E) 200 | 250 | 154 | 161 | 209 | — A sales representative, Sheila, has to visit clients in six cities, London, Cambridge, Oxford, Birmingham, Nottingham and Exeter. The table shows the distances, in miles, between these six cities, Sheila lives in London and plans a route starting and finishing in London, She wishes to visit each city and drive the minimum distance. a Starting from London, use Prim’s algorithm to obtain a minimum spanning tree. Show your working, State the order in which you selected the arcs and draw the tree b i. Hence determine an initial upper bound for the length of the route planned by Sheila. ii Starting from your initial upper bound and using shortcuts, obtain a route which is less than 660 miles. © By deleting Exeter from the table determine a lower bound for the length of Sheila's route. Summary of key points 1 Awalk in a network is a finite sequence of edges such that the end vertex of one edge is the start vertex of the next 2 Awalk which visits every vertex, returning to its starting vertex, is called a tour. 3° The optimal solution js found between the best upper bound and best lower bound, 4 In the classical travelling salesman problem you must visit each vertex only once, before returning to the start In the practical travelling salesman problem you must visit each vertex at least ‘once before returning to the start. 6 If you convert a network into a complete network of least distances, the practical and classical travelling salesman problems are the same. ‘To create a complete network of least distances, you ensure that the triangle inequality holds for all triangles in the network: the longest side = the sum of the two shorter sides
You might also like
9FM0 Topic Test - D1 - 3 - Dijkstras and Floyds Algorithms (Word)
PDF
No ratings yet
9FM0 Topic Test - D1 - 3 - Dijkstras and Floyds Algorithms (Word)
15 pages
Modelling Population Growth of South Korea and Predictions by Using Exponential and Logistic Models.
PDF
No ratings yet
Modelling Population Growth of South Korea and Predictions by Using Exponential and Logistic Models.
18 pages
A Power Problem - Isaac Physics 2
PDF
No ratings yet
A Power Problem - Isaac Physics 2
1 page
Math EE IB
PDF
0% (1)
Math EE IB
15 pages
Study Pack MA100 Inside All
PDF
No ratings yet
Study Pack MA100 Inside All
92 pages
AQA Assembly Language Questions and MS
PDF
No ratings yet
AQA Assembly Language Questions and MS
9 pages
Sample Assessment Materials Model Answers - Core Pure For As Further Mathematics
PDF
No ratings yet
Sample Assessment Materials Model Answers - Core Pure For As Further Mathematics
27 pages
Edexcel GCE Mathematics Mechanics 1 M1 (6677)
PDF
No ratings yet
Edexcel GCE Mathematics Mechanics 1 M1 (6677)
8 pages
4BS1 02 Que 20210511
PDF
50% (2)
4BS1 02 Que 20210511
20 pages
Faster and Cheaper - How Ride-Sourcing Fills A Gap in Low-Income Los Angeles Neighborhoods
PDF
No ratings yet
Faster and Cheaper - How Ride-Sourcing Fills A Gap in Low-Income Los Angeles Neighborhoods
29 pages
Edexcel - D2
PDF
No ratings yet
Edexcel - D2
285 pages
Algebraic Proof JustMaths Answers
PDF
No ratings yet
Algebraic Proof JustMaths Answers
3 pages
A1 Gold Level Model Answers IGCSE9 1 MA
PDF
No ratings yet
A1 Gold Level Model Answers IGCSE9 1 MA
12 pages
Edexcel GCE: 6671 Pure Mathematics P1 (New Syllabus) Advanced/Advanced Subsidiary
PDF
No ratings yet
Edexcel GCE: 6671 Pure Mathematics P1 (New Syllabus) Advanced/Advanced Subsidiary
6 pages
Edexcel AS and A Level Modular Mathematics - Further Pure Mathematics 1 PDF
PDF
No ratings yet
Edexcel AS and A Level Modular Mathematics - Further Pure Mathematics 1 PDF
177 pages
FM Modelling With Algorithms
PDF
No ratings yet
FM Modelling With Algorithms
117 pages
MA261
PDF
No ratings yet
MA261
75 pages
SM FF M Further Pure Maths
PDF
No ratings yet
SM FF M Further Pure Maths
23 pages
A Level Maths Pure 1 Mark Scheme Predicted Paper Hench Maths
PDF
No ratings yet
A Level Maths Pure 1 Mark Scheme Predicted Paper Hench Maths
14 pages
Mathematics: Pearson Edexcel International Advanced Level
PDF
No ratings yet
Mathematics: Pearson Edexcel International Advanced Level
28 pages
Hodder - Worked Solutions
PDF
No ratings yet
Hodder - Worked Solutions
141 pages
Edexcel IAL Pure Mathematics P2 June 2022 Wma12-01-Que-20220520
PDF
No ratings yet
Edexcel IAL Pure Mathematics P2 June 2022 Wma12-01-Que-20220520
32 pages
QS 015/2 Matriculation Programme Examination Semester I Session 2016/2017
PDF
100% (1)
QS 015/2 Matriculation Programme Examination Semester I Session 2016/2017
28 pages
Notes November 2020 Chapter 23: Functions and Graphs Grade: 8 Subject: Mathematics
PDF
No ratings yet
Notes November 2020 Chapter 23: Functions and Graphs Grade: 8 Subject: Mathematics
2 pages
C4 ExamQuestions Chp6 Integration1 General
PDF
No ratings yet
C4 ExamQuestions Chp6 Integration1 General
49 pages
3D A Level Decision Mathematics 1 QP
PDF
No ratings yet
3D A Level Decision Mathematics 1 QP
36 pages
Monday 14 January 2019: Further Pure Mathematics F1
PDF
No ratings yet
Monday 14 January 2019: Further Pure Mathematics F1
32 pages
P3 Vectors: 132 Minutes
PDF
100% (1)
P3 Vectors: 132 Minutes
22 pages
Wec13 01 Rms 20240815
PDF
No ratings yet
Wec13 01 Rms 20240815
22 pages
P3 Merged Removed
PDF
No ratings yet
P3 Merged Removed
216 pages
Math AA IA IB
PDF
No ratings yet
Math AA IA IB
21 pages
Availability Bloomfield's 14 Mar 24
PDF
100% (1)
Availability Bloomfield's 14 Mar 24
43 pages
AI Lab1
PDF
No ratings yet
AI Lab1
10 pages
WMA12 01 Que 20190619
PDF
No ratings yet
WMA12 01 Que 20190619
32 pages
IAL Maths Statistics 3 SB
PDF
No ratings yet
IAL Maths Statistics 3 SB
35 pages
New A-Level Maths For Edexcel: Year 1 & 2 Exam Practice Workbook
PDF
No ratings yet
New A-Level Maths For Edexcel: Year 1 & 2 Exam Practice Workbook
10 pages
4ma1 1hr Rms 20220825 PDF
PDF
No ratings yet
4ma1 1hr Rms 20220825 PDF
23 pages
Maths Decision Mathematics 2
PDF
No ratings yet
Maths Decision Mathematics 2
330 pages
Maths Kunja
PDF
No ratings yet
Maths Kunja
460 pages
1306 M3 June 2013 - Withdrawn Paper Mark Scheme
PDF
No ratings yet
1306 M3 June 2013 - Withdrawn Paper Mark Scheme
11 pages
Igcse Pure Maths (9-1) : Lecture 2: Circular Measure
PDF
No ratings yet
Igcse Pure Maths (9-1) : Lecture 2: Circular Measure
15 pages
Engineering Unit 10
PDF
No ratings yet
Engineering Unit 10
33 pages
Mock - 3s
PDF
No ratings yet
Mock - 3s
20 pages
8MA0 21 MSC 20201217
PDF
No ratings yet
8MA0 21 MSC 20201217
8 pages
Fourier Series Tutorial: DR Chris Tisdell
PDF
No ratings yet
Fourier Series Tutorial: DR Chris Tisdell
8 pages
WMA11 Sample
PDF
100% (1)
WMA11 Sample
5 pages
Bisection Method
PDF
No ratings yet
Bisection Method
34 pages
A Level Economics (Macro) Notes by Calvin Wong
PDF
No ratings yet
A Level Economics (Macro) Notes by Calvin Wong
21 pages
Invariant Points and Lines
PDF
No ratings yet
Invariant Points and Lines
14 pages
7408 1 QP Physics A 8oct21 AM
PDF
No ratings yet
7408 1 QP Physics A 8oct21 AM
44 pages
AQA COMP3 QP Jun14
PDF
No ratings yet
AQA COMP3 QP Jun14
36 pages
MA100 MT Course Pack 2020-21
PDF
No ratings yet
MA100 MT Course Pack 2020-21
222 pages
AS Mathematics Specimen Papers - Paper 1 Pure Mathematics
PDF
No ratings yet
AS Mathematics Specimen Papers - Paper 1 Pure Mathematics
10 pages
A Level Mathematics Practice Paper 8
PDF
No ratings yet
A Level Mathematics Practice Paper 8
12 pages
A Level Further Maths Practice Paper 1
PDF
No ratings yet
A Level Further Maths Practice Paper 1
6 pages
Edexcel A Level Scheme of Work
PDF
No ratings yet
Edexcel A Level Scheme of Work
33 pages
D2 (New) PDF
PDF
No ratings yet
D2 (New) PDF
284 pages
Transportation Problems
PDF
No ratings yet
Transportation Problems
31 pages
OR Ch-3
PDF
No ratings yet
OR Ch-3
30 pages
Or Chapter 3 Newww
PDF
No ratings yet
Or Chapter 3 Newww
59 pages
chinese nine ring puzzle fun
PDF
No ratings yet
chinese nine ring puzzle fun
8 pages
2. Relative Velocity.docx
PDF
No ratings yet
2. Relative Velocity.docx
49 pages
Adobe Scan 02 Oct 2024 (1)
PDF
No ratings yet
Adobe Scan 02 Oct 2024 (1)
1 page
Adobe Scan 14 Jul 2025
PDF
No ratings yet
Adobe Scan 14 Jul 2025
2 pages
Uniform Circular Motion Practice Qs With Answers
PDF
No ratings yet
Uniform Circular Motion Practice Qs With Answers
17 pages
Ben Ford Clock 3 Pages
PDF
No ratings yet
Ben Ford Clock 3 Pages
3 pages
What's New in Chrome Window
PDF
No ratings yet
What's New in Chrome Window
2 pages
CM
PDF
No ratings yet
CM
139 pages
There Are Six Times As Many Students As Professors
PDF
No ratings yet
There Are Six Times As Many Students As Professors
16 pages
Chap4 Fortran Language
PDF
No ratings yet
Chap4 Fortran Language
7 pages
Work - Energy.Power: Challenging MCQ Questions by The Physics Cafe
PDF
0% (1)
Work - Energy.Power: Challenging MCQ Questions by The Physics Cafe
14 pages
Relative Motion Problems
PDF
No ratings yet
Relative Motion Problems
5 pages
Fake Forces 3 - Sometimes They Are Fantastic
PDF
No ratings yet
Fake Forces 3 - Sometimes They Are Fantastic
8 pages
An Introduction To Exoplanets Printable
PDF
No ratings yet
An Introduction To Exoplanets Printable
246 pages