Assignment Problem Hungarian Method. Example : Solve the following assignment problem 1 2 3 4 A 8 12 12 14 B 2 12 14 6 C 4 10 8 4 D 6 4 2 8 Solution 1. Subtract the smallest element from each row, then subtract the smallest element from each column. 2. Cover all zeros with the least possible number of lines. If the number of lines is equal to the number of rows, you are optimal. 3. If not, look at the smallest number not covered by a line. Add this to every number covered by two lines; subtract it from every number not covered by any line. Repeat steps 2 and 3. 1 2 3 4 A 8 12 12 14 B 2 12 14 6 C 4 10 8 4 D 6 4 2 8 1 1 2 3 4 A 8 12 12 14 8 B 2 12 14 6 2 C 4 10 8 4 4 D 6 4 2 8 2 1 2 3 4 A 0 4 4 6 8 B 0 10 12 4 2 C 0 6 4 0 4 D 4 2 0 6 2 1 2 3 4 A 0 4 4 6 B 0 10 12 4 C 0 6 4 0 D 4 2 0 6 0 2 0 0 1 2 3 4 2 A 0 2 4 6 B 0 8 12 4 C 0 4 4 0 D 4 0 0 6 0 2 0 0 1 2 3 4 A 0 0 2 6 B 0 6 10 4 C 0 2 2 0 D 6 0 0 8 0 2 0 0 1 2 3 4 A 0 0 2 6 B 0 6 10 C 0 2 2 0 D 6 0 0 8 0 2 0 0 Total Minimum Cost = 12+2+4+2=20 Maximization Problem 3 To sign an assignment problem whose objective is to maximise, the problem should first be converted to a minimisation problem before the application of the Hungarian Method. 1. Convert the problem to a minimisation problem by multiplying all the elements cij of the assignment matrix by-1. 2. If some of the elements of the cost matrix are negative ,add a sufficiently large positive number to the corresponding rows and columns so that all the cost elements would become nonnegative. 3. We now have an assignment problem with a minimisation objective and all cost elements nonnegative. The Hungarian Method can now be applied directly Solve the following maximisation assignment problem: A B C D 1 20 60 50 55 2 60 30 80 75 3 80 100 90 80 4 65 80 75 70 A B C D 1 -20 -60 50 -55 2 -60 -30 80 75 3 -80 -100 -90 -80 4 -65 -80 -75 -70 4 A B C D 1 80 40 50 45 2 40 70 20 25 3 20 0 10 20 4 35 20 25 30 A B C D 1 80 40 50 45 40 2 40 70 20 25 20 3 20 0 10 20 0 4 35 20 25 30 20 A B C D 1 40 0 10 5 40 2 20 50 0 5 20 3 20 0 10 20 0 4 15 0 5 10 20 5 A B C D 1 40 0 10 5 2 20 50 0 5 3 20 0 10 20 4 15 0 5 10 15 0 0 5 A B C D 1 25 0 10 0 2 5 50 0 0 3 5 0 10 15 4 0 0 5 5 15 0 0 5 TOTAL = 55+80+65+100= 300 3B 4A 2C 1D 6 Tutorial 1 (Assignment) 1. Find the optimal assignment of four jobs and four machines when the cost of assignment is given by the following table J1 J2 J3 J4 M1 10 9 8 7 M2 3 4 5 6 M3 2 1 1 2 M4 4 3 5 6 Answer: total minimum cost 20 M1-J3, M2-J1, M3-J4 ,M4-J2 OR M1-J3, M2-J4, M3-J2, M4-J1 7 2. Solve the following assignment problems with the objectives as stated: (a) Maximise j 1 2 3 4 5 1 28 20 36 36 28 i 2 25 30 32 33 30 3 35 23 36 37 33 4 33 25 32 33 35 5 34 26 40 42 35 4 1 2 8 4 10 5 5 7 9 5 1 (b) Minimise j 1 2 3 4 5 1 4 1 7 10 2 i 2 2 3 4 0 8 3 0 5 2 3 9 (a) Max = 178 ,(1,3),(2,2),(3,1),(4,5),(5,4) (b) Min =5 ,(1,4),(2,1),(3,3),(4,2),(5,5) 3. (a) (b) Sometimes the number of agents in an assignment problem is not equal to the number of tasks. Describe briefly how one can adapt such a problem so that the Hungarian method can be used to optimise it Tony's Cash and Carry has just leased a new store and is attempting to determine where the various departments should be located within the store. The store manager has four locations that could accommodate one department each, the five departments under consideration being a shoe, a toy, an autoparts, a hardware, and an electronics department. After a careful study of the layout of the store, and based on his experience of similar stores, the store manager has made estimates of the expected profit (in hundreds of thousands of pounds sterling) for each department in each location. Location Department 1 2 3 4 Shoe 10 6 10 8 Toy 15 18 5 11 Auto-parts 17 10 13 16 Hardware 14 12 13 10 Electronics 14 16 6 12 Use the Hungarian method to determine (i) a choice of departments and their locations that will achieve the maximum possible expected profit; (ii) the maximum possible expected annual profit attainable, (iii) whether any alternative optimal solution exists. 8 9 4. A company is in the process of deciding which of five salespeople to assign to each of five sales districts in a particular region. Each person is likely to achieve a different sales volume in each district. Estimates of these sales are shown in the table below. The company wishes to maximize total sales volume. However, due to personnel rotation policies which cannot be violated, it is not possible to assign salesperson B to district 1 nor salesperson A to district 2. Solve the problem using the Hungarian method and write a short report to the company indicating which assignments should be made and the volume of sales likely to result. Salesperson A B C D E 1 65 90 106 84 86 District 2 3 73 55 67 87 86 96 69 79 74 79 4 58 75 89 77 75 5 63 80 70 77 73 Determine how and to what extent, if at all, the personnel restrictions affect the total estimated sales value. 10 11 12
© Copyright 2026 Paperzz