This document discusses solving assignment problems using the Hungarian method. It begins with an introduction to assignment problems, noting they involve allocating resources to activities on a one-to-one basis to minimize costs. The document then provides the steps of the Hungarian method, which involves subtracting minimum row and column elements to obtain zeros, and systematically drawing rectangles around zeros to find an optimal assignment. An example applying the Hungarian method to assign programmers to application programs is provided to illustrate the process.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
54 views16 pages
4
This document discusses solving assignment problems using the Hungarian method. It begins with an introduction to assignment problems, noting they involve allocating resources to activities on a one-to-one basis to minimize costs. The document then provides the steps of the Hungarian method, which involves subtracting minimum row and column elements to obtain zeros, and systematically drawing rectangles around zeros to find an optimal assignment. An example applying the Hungarian method to assign programmers to application programs is provided to illustrate the process.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 16
5
UNIT 5 ASSIGNMENT PROBLEMS
Structure 5.1 Introduction Objectives 5.2 Assignment Problem and Its Solution 5.3 Some Special Cases Maximisation Problem The Unbalanced Assignment Problem Alternative Optimal Solutions Restriction on Assignments 5.4 Travelling Salesman Problem 5.5 Summary 5.6 Solutions/Answers 5.1 INTRODUCTION In Block 1 of this course, we have discussed the basic concepts related to Linear Programming Problems and the Simplex method for solving them. The Transportation Problem was also discussed in Block 1. In this unit, we explain the Assignment problem and discuss various methods for solving it. The assignment problem deals with allocating various resources (items) to various activities (receivers) on a one to one basis, i.e., the number of operations are to be assigned to an equal number of operators where each operator performs only one operation. For example, suppose an accounts officer has 4 subordinates and 4 tasks. The subordinates differ in efficiency and take different time to perform each task. If one task is to be assigned to one person in such a way that the total person hours are minimised, the problem is called an assignment problem. Though the assignment problem is a special case of transportation problem, it is not solved using the methods described in Unit 4. We use another method called the Hungarian method for solving an assignment problem. It is shorter and easier compared to any method of finding the optimal solution of a transportation problem. In this unit, we discuss various types of assignment problems, including travelling salesman problem and apply the Hungarian method for solving these problems. In the next unit, we shall discuss the fundamental structure and operating characteristics of a queueing system and explain a single server M/M/1 queueing model with Poisson input and exponential service time. Objectives After studying this unit, you should be able to: formulate an assignment problem; determine the optimal solutions of assignment problems using the Hungarian method; obtain the solutions for special cases of assignment problems, i.e, maximisation problem, unbalanced assignment problem, alternative optimal solutions and restriction on assignments; and solve the travelling salesman problem as an assignment problem. Optimisation Techniques-II 6 5.2 ASSIGNMENT PROBLEM AND ITS SOLUTION An assignment problem may be considered as a special type of transportation problem in which the number of sources and destinations are equal. The capacity of each source as well as the requirement of each destination is taken as 1. In the case of an assignment problem, the given matrix must necessarily be a square matrix which is not the condition for a transportation problem. Suppose there are n persons and n jobs and the assignment of jobs has to be done on a one-to-one basis. This assignment problem can be stated in the form of an n×n matrix of real numbers (known as the cost matrix) as given in the following table: Person Job 1 2 . . . j . . . n 1 2 . . . i . . . n C11 C12 . . . C1j … C1n C21 C22 . . . C2j … C2n . . . Ci1 Ci2 . . . Cij … Cin . . . Cn1 Cn2 . . . Cnj … Cnn where cij represents the amount of time taken by ith person to complete the j th job. Let xij denote the j th job assigned to the ith person. Then, mathematically, the assignment problem can be stated as follows: Minimise Z = n m ij ij i 1 j 1 c x , where i 1,2,...,n and j 1,2,...,n. subject to th th ij th th 1 if thei person isassigned the j job x 0 if thei person is not assigned the j job ì ï = í ï î , th i1 i2 in th 1j 2 j nj x x ... x 1, i 1,2,...,n (one jobisdoneby thei person) x x ... x 1, j 1,2,...,n (onlyoneperson isassigned the j job) The constant cij in the above problem represents time. It may be cost or some other parameter which is to be minimised in the assignment problem under consideration. Note that an assignment problem is a special type of transportation problem and may be solved as one. However, we use another method known as the Hungarian method for solving it. This method is shorter and easier compared to any other method of finding the optimal solution of a transportation problem. Let us explain the Hungarian method of finding the optimal solution of an assignment problem. Assignment Problems 7 Hungarian Method of Solving an Assignment Problem The steps for obtaining an optimal solution of an assignment problem are as follows: 1. Check whether the given matrix is square. If not, make it square by adding a suitable number of dummy rows (or columns) with 0 cost/time elements. 2. Locate the smallest cost element in each row of the cost matrix. Subtract the smallest element of each row from every element of that row. 3. In the resulting cost matrix, locate the smallest element in each column and subtract the smallest element of each column from every element of that column. 4. In the resulting matrix, search for an optimum assignment as follows: i) Examine the rows successively until a row with exactly one zero is found. Draw a rectangle around this zero (as 0 ) and cross out all other zeroes in the corresponding column. Proceed in this manner until all the rows have been examined. If there is more than one zero in any row, do not touch that row; pass on to the next row. ii) Repeat step (i) above for the columns of the resulting cost matrix. iii) If a row or column of the reduced matrix contains more than one zeroes, arbitrarily choose a row or column having the minimum number of zeroes. Arbitrarily select any zero in the row or column so chosen. Draw a rectangle around it and cross out all the zeroes in the corresponding row and column. Repeat steps (i), (ii) and (iii) until all the zeroes have either been assigned (by drawing a rectangle around them) or crossed. iv) If each row and each column of the resulting matrix has one and only one assigned 0, the optimum assignment is made in the cells corresponding to 0 . The optimum solution of the problem is attained and you can stop here. Otherwise, go to the next step. 5. Draw the minimum number of horizontal and/or vertical lines through all the zeroes as follows: i) Tick mark ( ) the rows in which assignment has not been made. ii) Tick mark ( ) columns, which have zeroes in the marked rows. iii) Tick mark ( ) rows (not already marked) which have assignments in marked columns. Then tick mark ( ) columns, which have zeroes in newly marked rows, if any. Tick mark ( ) rows (not already marked), which have assignments in these newly marked columns. iv) Draw straight lines through all unmarked rows and marked columns. 6. Revise the cost matrix as follows: i) Find the smallest element not covered by any of the lines. ii) Subtract this from all the uncovered elements and add it to the elements at the intersection of the two lines. iii) Other elements covered by the lines remain unchanged. 7. Repeat the procedure until an optimum solution is attained. Optimisation Techniques-II 8 We now illustrate the procedure with the help of an example. Example 1: A computer centre has four expert programmers and needs to develop four application programmes. The head of the computer centre, estimates the computer time (in minutes) required by the respective experts to develop the application programmes as follows: Programmes A B C D Programmers 1 120 100 80 90 2 80 90 110 70 3 110 140 120 100 4 90 90 80 90 Find the assignment pattern that minimises the time required to develop the application programmes. Solution: Let us subtract the minimum element of each row from every element of that row. Note that the minimum element in the first row is 80. So 80 is to be subtracted from every element of the first row, i.e., from 120, 100, 80 and 90, respectively. As a result, the elements of the first row of the resulting matrix would be 40, 20, 0, 10, respectively. Similarly, we obtain the elements of the other rows of the resulting matrix. Thus, the resulting matrix is: A B C D 1 40 20 0 10 2 10 20 40 0 3 10 40 20 0 4 10 10 0 10 Let us now subtract the minimum element of each column from every element of that column in the resulting matrix. The minimum element in the first column is 10. So 10 is to be subtracted from every element of the first column, i.e., from 40, 10, 10, and 10, respectively. As a result, the elements of the first column of the resulting matrix are 30, 0, 0, 0, respectively. Similarly, we obtain the elements of the other columns of the resulting matrix. Thus, the resulting matrix is: A B C D 1 30 10 0 10 2 0 10 40 0 3 0 30 20 0 4 0 0 0 10 Now, starting from first row onward, we draw a rectangle around the 0 in each row having a single zero and cross all other zeroes in the corresponding column. Here, in the very first row we find a single zero. So, we draw a rectangle around it and cross all other zeroes in the corresponding column. We get Assignment Problems 9 A B C D 1 30 10 0 10 2 0 10 40 0 3 0 30 20 0 4 0 0 0 10 In the second, third and fourth row, there is no single zero. Hence, we move column-wise. In the second column, we have a single zero. Hence, we draw a rectangle around it and cross all other zeroes in the corresponding row. We get A B C D 1 30 10 0 10 2 0 10 40 0 3 0 30 20 0 4 0 0 0 10 In the matrix above, there is no row or column, which has a single zero. Therefore, we first move row-wise to locate the row having more than one zero. The second row has two zeroes. So, we draw a rectangle arbitrarily around one of these zeroes and cross the other one. Let us draw a rectangle around the zero in the cell (2, A) and cross the zero in the cell (2, D). We cross out the other zeroes in the first column. Note that we could just as well have selected the zero in the cell (2, D), drawn a rectangle around it and crossed all other zeroes. This would have led to an alternative solution. In this way, we are left with only one zero in every row and column around which a rectangle has been drawn. This means that we have assigned only one operation to one operator. Thus, we get the optimum solution as follows: A B C D 1 30 10 0 10 2 0 10 40 0 3 0 30 20 0 4 0 0 0 10 Note that the assignment of jobs should be made on the basis of the cells corresponding to the zeroes around which rectangles have been drawn. Therefore, the optimum solution for this problem is: 1 C, 2 A, 3 D, 4 B This means that programmer 1 is assigned programme C, programmer 2 is assigned programme A, and so on. The minimum time taken in developing the programmes is = 80 + 80 + 100 + 90 = 350 min. Example 2: A company is producing a single product and selling it through five agencies situated in different cities. All of a sudden, there is a demand for the product in five more cities that do not have any agency of the company. Optimisation Techniques-II 10 The company is faced with the problem of deciding on how to assign the existing agencies to dispatch the product to the additional cities in such a way that the travelling distance is minimised. The distances (in km) between the surplus and deficit cities are given in the following distance matrix. Deficit City Surplus city I II III IV V A 160 130 175 190 200 B 135 120 130 160 175 C 140 110 155 170 185 D 50 50 80 80 110 E 55 35 70 80 105 Determine the optimum assignment schedule. Solution: Subtracting the minimum element of each row from every element of that row, we have I II III IV V A 30 0 45 60 70 B 15 0 10 40 55 C 30 0 45 60 75 D 0 0 30 30 60 E 20 0 35 45 70 Subtracting the minimum element of each column from every element of that column, we have I II III IV V A 30 0 35 30 15 B 15 0 0 10 0 C 30 0 35 30 20 D 0 0 20 0 5 E 20 0 25 15 15 We now assign zeroes by drawing rectangles around them as explained in Example 1. Thus, we get I II III IV V A 30 0 35 30 15 B 15 0 0 10 0 C 30 0 35 30 20 D 0 0 20 0 5 E 20 0 25 15 15 Since the number of assignments is less than the number of rows (or columns), we proceed from Step 5 onwards of the Hungarian method as follows: i) we tick mark ( ) the rows in which the assignment has not been made. These are the 3 rd and 5 th rows. Assignment Problems 11 ii) we tick mark ( ) the columns which have zeroes in the marked rows. This is the 2nd column. iii) we tick mark ( ) the rows which have assignments in marked columns. This is the 1 st row. iv) again we tick mark ( ) the column(s) which have zeroes in the newly marked row. This is the 2nd column, which has already been marked. There is no other such column. So, we have I II III IV V A 30 0 35 30 15 B 15 0 0 10 0 C 30 0 35 30 20 D 0 0 20 0 5 E 20 0 25 15 15 We draw straight lines through unmarked rows and marked columns as follows: I II III IV V A 30 0 35 30 15 B 15 0 0 10 0 C 30 0 35 30 20 D 0 0 20 0 5 E 20 0 25 15 15 We proceed as follows, as explained in step 6 of the Hungarian method: i) We find the smallest element in the matrix not covered by any of the lines. It is 15 in this case. ii) We subtract the number ‘15’ from all the uncovered elements and add it to the elements at the intersection of the two lines. iii) Other elements covered by the lines remain unchanged. Thus, we have I II III IV V A 15 0 20 15 0 B 15 15 0 10 0 C 15 0 20 15 5 D 0 15 20 0 5 E 5 0 10 0 0 Optimisation Techniques-II 12 We repeat Steps 1 to 4 of the Hungarian method and obtain the following matrix: I II III IV V A 15 0 20 15 0 B 15 15 0 20 0 C 15 0 20 15 5 D 0 15 20 0 5 E 5 0 10 0 0 Since each row and each column of this matrix has one and only one assigned 0, we obtain the optimum assignment schedule as follows: A V, B III, C II, D I, E IV Thus, the minimum distance is 200 + 130 + 110 + 50 + 80 = 570 km. You should pause here and try to solve the following assignment problem to check your understanding. E1) A solicitor’s firm employs typists on an hourly piece-rate basis for their daily work. There are five typists for service and their charges and speeds are different. According to the contract, only one job is given to one typist. Find the least cost allocation for the following data: P Q R S T A 85 75 65 85 75 B 90 180 66 90 78 C 75 66 57 75 69 D 80 72 60 80 72 E 76 64 56 72 68 5.3 SOME SPECIAL CASES In this section, we consider some special cases of the assignment problem such as the maximisation problem, unbalanced assignment problem, alternative optimal solutions and restriction on assignments and discuss the techniques to solve them. 5.3.1 Maximisation Problem There may be an assignment problem in the form of maximisation problem. For example, profits (or anything else like revenues), which need maximisation may be given in the cells instead of costs/times. To solve such a problem, we find the opportunity loss matrix by subtracting the value of each cell from the largest value chosen from amongst all the given cells. When the value of a cell is subtracted from the highest value, it gives the loss of amount caused by not getting the opportunity which would have given the highest value. The matrix so obtained is known as the opportunity loss matrix and is handled in the same way as the minimisation problem. Let us explain this case with the help of an example. Example 3: Five salesmen are to be assigned to five districts. Estimates of sales revenue (in thousands) for each salesman are given as follows: Assignment Problems 13 A B C D E 1 32 38 40 28 40 2 40 24 28 21 36 3 41 27 33 30 37 4 22 38 41 36 36 5 29 33 40 35 39 Find the assignment pattern that maximises the sales revenue. Solution: Since we are to maximise the sales revenue, we need to convert it into minimisation form before applying the Hungarian method. For this, we obtain the opportunity loss matrix by subtracting every element in the given table from the largest element in it. In this case, the largest element is 41. Thus, we obtain the following opportunity loss matrix: 9 3 1 13 1 1 17 13 20 5 0 14 8 11 4 19 3 0 5 5 12 8 1 6 2 Now, we apply the Hungarian method (Steps 1 to 4) and finally obtain the following result matrix: A B C D E 1 8 0 0 7 0 2 0 14 12 14 4 3 0 12 8 6 4 4 19 1 0 0 5 5 11 5 0 0 1 Since the number of assigned zeroes is less than the number of rows, we apply Step 5 of the Hungarian method and draw the minimum number of horizontal/vertical lines that cover all the zeroes as shown in the following table: A B C D E 1 8 0 0 7 0 2 0 14 12 14 4 3 0 12 8 6 4 4 19 1 0 0 5 5 11 5 0 0 1 Let us now, select the minimum element from amongst the uncovered elements, which is 4 in this case. We subtract the element 4 from each of the uncovered elements and add it to the elements which lie at the intersection of the horizontal and vertical lines. Other covered elements remain unaltered. Then applying the Hungarian method to the resulting matrix, we get Optimisation Techniques-II 14 A B C D E 1 12 0 0 7 0 2 0 10 8 10 0 3 0 8 4 2 0 4 23 1 0 0 5 5 15 5 0 0 1 Since the number of assigned zeroes is equal to the number of rows, the optimum assignment has been attained and is given as: 1 B, 2 A, 3 E, 4 C, 5 D Thus, the maximum sales revenue = 38 + 40 + 37 + 41 + 35 thousand rupees = 191 thousand rupees. 5.3.2 The Unbalanced Assignment Problem The assignment problem wherein the number of rows is not equal to the number of columns is said to be an unbalanced assignment problem. Such a problem is handled by introducing dummy row(s) if the number of rows is less than the number of columns and dummy column(s) if the number of columns is less than the number of rows. All the elements of such a dummy row/column are taken as zero. The augmented problem is then solved by the Hungarian method as explained earlier. Example 4: To stimulate interest and provide an atmosphere for intellectual discussion, the faculty of mathematical sciences in an institute decides to hold special seminars on four contemporary topics – Statistics, Operations Research, Discrete Mathematics, Matrices. Each such seminar is to be held once a week. However, scheduling these seminars (one for each topic and not more than one seminar per day) has to be done carefully so that the number of students unable to attend is kept to a minimum. A careful study indicates that the number of students who cannot attend a particular seminar on a specific day is as follows: Statistics Operations Discrete Matrices Research Mathematics Monday 50 40 60 20 Tuesday 40 30 40 30 Wednesday 60 20 30 20 Thursday 30 30 20 30 Friday 10 20 10 30 Find an optimal schedule for the seminars. Also find the number of students who will be missing at least one seminar. Solution: Here the number of rows is 5 and the number of columns is 4. Therefore, the given assignment problem is unbalanced. As the number of columns is one less than the number of rows, we introduce one dummy column to convert the given assignment problem into a balanced problem. The number of students in each cell of this column is taken as zero. Thus, the problem takes the following form: Assignment Problems 15 Statistics Operations Research Discrete Mathematics Matrices Dummy Monday 50 40 60 20 0 Tuesday 40 30 40 30 0 Wednesday 60 20 30 20 0 Thursday 30 30 20 30 0 Friday 10 20 10 30 0 Now, on applying the Hungarian method (Steps 1 to 4), we get Statistics Operations Research Discrete Mathematics Matrices Dummy Monday 40 20 50 0 0 Tuesday 30 10 30 10 0 Wednesday 50 0 20 0 0 Thursday 20 10 10 10 0 Friday 0 0 0 10 0 Since the number of assigned zeroes < number of rows, we apply Step 5 of the Hungarian method and draw the minimum number of horizontal/vertical lines that cover all the zeroes as shown in the following table: Statistics Operations Research Discrete Mathematics Matrices Dummy Monday 40 20 50 0 0 Tuesday 30 10 30 10 0 Wednesday 50 0 20 0 0 Thursday 20 10 10 10 0 Friday 0 0 0 10 0 We select the minimum element from amongst the uncovered elements, which is 10 in this case. We subtract this element, i.e., 10 from each uncovered element and add it to the elements which lie at the intersection of the horizontal/vertical lines. Other covered elements will remain unaltered. Thus, the resulting matrix is: 40 20 50 0 10 20 0 20 0 0 50 0 20 0 10 10 0 0 0 0 0 0 0 10 10 Now, on applying the Hungarian method, we have 40 20 50 0 10 20 0 20 0 0 50 0 20 0 10 10 0 0 0 0 0 0 0 10 10 Optimisation Techniques-II 16 Since each row and each column of the matrix has one and only one assigned 0, optimum assignment is made in the cells containing those zeroes around which rectangles have been drawn as Monday Matrices, Wednesday Operations Research, Thursday Discrete Mathematics, Friday Statistics The total number of students who will be missing at least one seminar = 20 + 20 + 20 + 10 = 70 5.3.3 Alternative Optimal Solutions Such solutions exist if while assigning zeroes, i.e., while carrying out Step 4 of the Hungarian method, we neither find any row nor any column, which has a single zero. Then we first move row-wise and then column-wise to locate a row/column having two zeroes. We draw a rectangle arbitrarily around any one of these zeroes and cross the other. Alternatively, the zero around which rectangle has been drawn could have been crossed and the rectangle could have been drawn around the other zero. This will lead to two alternative optimum solutions. While assigning zeroes, i.e., while carrying out Step 4 of the Hungarian method, we may neither find any row nor any column, which has single or two zeroes. Then we first move row-wise and then column-wise to locate a row/column having three or more zeroes. This will lead to three or more alternative solutions. Note that there are two alternative solutions in Example 1. 5.3.4 Restriction on Assignments Sometimes, in an assignment problem, there may be a case when a particular resource (say, a person) cannot be assigned a particular activity (say, a job). To handle such a problem, we assign a very large cost (or time or anything else which is to be minimised) to that case and represent it by ∞ or M, where M denotes a very high cost. This is done to restrict the entry of this pair of resource-activity in the final solution. Example 5: A company has taken the third floor of a multi-storied building for rent to locate one of its zonal offices. There are five main rooms in this floor to be assigned to five managers. Each room has its own advantages and disadvantages. Some have two cupboards, some are closer to the washrooms or to the canteens, some are of big sizes and are on different floors, etc. Each of the five managers were asked to rank their room preferences amongst the rooms 201, 302, 103, 304 and 205. Their preferences were recorded in a table as indicated below: MANAGERS M1 M2 M3 M4 M5 302 302 103 302 201 ROOMS 103 304 201 205 302 304 205 304 304 304 201 205 103 302 Most of the managers did not include all five rooms in the list since they were not satisfied with some of them. Assuming that their preferences can be quantified by numbers, find out which manager should be assigned which room so that their total preference ranking is minimum. Assignment Problems 17 Solution: Let us give the ranks 1, 2, 3, 4 and 5 to the first, second, third, fourth and fifth preferences. We assign to the cells for which no preference is given. Thus, the given problem can be represented by the following assignment table: 201 302 103 304 205 M1 1 2 3 M2 4 1 2 3 M3 2 5 1 3 4 M4 1 4 3 2 M5 1 2 3 Let us now solve this assignment problem using the Hungarian method. Following Steps 1 to 4, we get 201 302 103 304 205 M1 0 1 1 M2 3 0 0 1 M3 1 4 0 1 2 M4 0 3 1 0 M5 0 1 1 Now, since each row and each column has one and only one assigned zero, the optimum assignment, i.e., the assignment with maximum satisfaction is made and is given by: M1 302, M2 304, M3 103, M4 205, M5 201. 5.4 TRAVELLING SALESMAN PROBLEM Consider a travelling salesman who has to visit a certain number of cities in his assigned territory. For each city of his territory, he wishes to visit each city once and only once and arrive back in the city from where he started. He knows the distances (or cost or time) of journey between every pair of cities, and wishes to determine the tour schedule that represents the least distance/cost/time. Such types of problems can be solved by the assignment algorithm. The difference between a travelling salesman problem and an assignment problem is that in an assignment problem, different destinations are assigned to different sources but in a travelling salesman problem, a destination is assigned to a source. Then this destination becomes another source to which we assign another destination, which in turn becomes another source, and so on. Let us explain this point further with the help of an example. Example 6: A travelling salesman has to visit five cities. He wishes to start from a particular city, visit each city once and then return to his starting point. The travelling time (in hours) for each city from a particular city is given below: Optimisation Techniques-II 18 To From A B C D E A ∞ 5 8 4 5 B 5 ∞ 7 4 5 C 8 7 ∞ 8 6 D 4 4 8 ∞ 8 E 5 5 6 8 ∞ What is the sequence of visits of the salesman so that the total travelling time is minimised? Solution: Applying the Hungarian method to this problem, we get A B C D E A 0 2 0 0 B 0 1 0 0 C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 As per the above assignment, the salesman should travel from A to D, D to B, B to A, i.e., A D B A. The above solution is not a complete solution of the travelling salesman problem as the salesman returns to A without travelling through all the cities. So, we proceed as follows: Since the assignment of zeroes has not given the solution of the travelling salesman problem, we bring the next minimum non-zero element into the solution. Thus, we obtain the next best solution by bringing 1 into the solution. Had there not been 1 in any cell, we would have taken the minimum, but greater than 1 value from amongst all the values of the table. Here, we have 1 and it appears in two places in this problem. One of these is chosen arbitrarily. Let us choose the cell (B, C) and form a rectangle around the value in this cell and cross out the zeroes in its row and column. Now, we apply the Hungarian method for the assignment of zeroes. Thus, we have A B C D E A 0 2 0 0 B 0 1 0 0 C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 Alternatively, we get A B C D E A 0 2 0 0 B 0 1 0 0 C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 Assignment Problems 19 In the case of the first alternative, the optimum assignment is A D A, but this is not the solution of the travelling salesman problem. In the case of the second alternative, the optimum assignment is A E C B D A This is the complete solution for the problem as starting from A, the salesman returns to A visiting all the other cities. The minimum time taken by him to travel to all the cities is 5 + 6 + 7 + 4 + 4 = 26 hrs. You may like to solve the following exercise to check your understanding. E2) Solve the following travelling salesman problem so as to minimise the cost per cycle: To From A B C D E A ∞ 3 6 2 3 B 3 ∞ 5 2 3 C 6 5 ∞ 6 4 D 2 2 6 ∞ 6 E 3 3 4 6 ∞ What is the sequence of visits of the salesman so that total travelling time is minimised? Let us now summarise the main points which have been covered in this unit. 5.5 SUMMARY 1. In an assignment problem, the number of operations is assigned to an equal number of operators where each operator performs only one operation. So, an assignment problem may be considered as a special type of transportation problem in which the capacity of each of the sources as well as the requirement of each of the destinations is taken as 1. In an assignment problem, the given matrix must necessarily be a square matrix, which is not the condition for a transportation problem. Such problems are solved using the Hungarian method, which is shorter and easier compared to any other method of finding the optimal solution. 2. There may be assignment problems where maximisation is required to be done instead of minimisation. To handle such a problem, we find the opportunity loss matrix by subtracting the value of each cell from the largest value chosen from amongst all the given cells. When the value of a cell is subtracted from the highest value, it gives the loss of amount caused by not getting the opportunity which would have given the highest value. The matrix so obtained is known as the opportunity loss matrix and is handled in the same way as the minimisation problem. 3. The assignment problem wherein the number of rows is not equal to the number of columns is said to be an unbalanced problem. Such a problem is handled by introducing dummy row(s) if the number of rows is less than the number of columns and dummy column(s) if the number of columns is less than the number of rows. All elements for such a dummy row/column are taken as zero. The augmented problem is then solved by the Hungarian method. Optimisation Techniques-II 20 4. While assigning zeroes in an assignment problem, if we neither find any row nor any column which has single zero, then we first move row-wise and then column-wise to locate a row/column having two (if not two, then three or more) zeroes. Then a rectangle is formed arbitrarily around one of these zeroes and the others are crossed. Alternatively, the zero around which the rectangle has been made could have been crossed and the rectangle could have been formed around any of the other zeroes. This leads to alternative optimum solutions. 5. Sometimes, there may be restriction on assigning a particular activity to a particular resource. Then a very large cost (or time or anything else which is to be minimised) is considered and represented by ∞ or M for such a restricted pair. 6. The travelling salesman problem wherein there are a certain number of cities to be visited by a salesman in his assigned territory can also be solved as an assignment problem. The only difference between the travelling salesman problem and an assignment problem is that in an assignment problem different destinations are assigned to different sources. But in a travelling salesman problem, a destination is assigned to a source and then that destination becomes another source to which another destination is assigned, and so on. This is because, in a travelling salesman problem, for each city of his territory, the salesman wishes to visit each city once and only once and arrive back at the city from where he started. He wishes to determine the tour schedule that represents the least distance/cost/time. 5.6 SOLUTIONS /ANSWERS E1) Applying the Hungarian method of solving an assignment problem, we finally get P Q R S T A 2 4 2 4 0 B 4 106 0 6 0 C 0 0 2 2 2 D 0 4 0 2 0 E 2 2 2 0 2 Thus, the least cost allocation is given by : A T, B R, C Q, D P, E S and the total minimum cost is ` (75 + 66 + 66 + 80 + 72 = `359. E2) Applying the Hungarian method of solving an assignment problem, we reduce the cost matrix and make assignments in rows and columns having single zeroes. Assignment Problems 21 A B C D E A 1 3 0 1 √ B 1 2 0 1 √ C 2 1 2 0 D 0 0 3 4 E 0 0 0 3 √ Now, we draw the minimum number of lines to cover all the zeroes. Then we subtract the lowest element from all the elements not covered by any of lines and add the same at the intersection of two lines. We have A B C D E A 0 2 0 0 √ B 0 1 0 0 √ C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 √ As per the above assignment, the salesman should travel from A to D, D to B, B to A , i.e., A D B A. The above solution is not a complete solution of the travelling salesman problem as the salesman returns to A without travelling through all the cities. So, we proceed as follows: Since the assignment of zeroes has not given the solution of the travelling salesman problem, we bring the next minimum non-zero element in the solution. Thus, we obtain the next best solution by bringing 1 into the solution. Had there not been 1 in any cell, we would have taken the minimum, but greater than 1 value from amongst all the values of the table. Here, we have 1 and it appears in two places in this problem. One of these is chosen arbitrarily. Let us choose the cell (B, C) and form a rectangle around the value in this cell and cross out the zeroes in its row and column. Now, we apply the Hungarian method for the assignment of zeroes. Thus, we have A B C D E A 0 2 0 0 B 0 1 0 0 C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 Optimisation Techniques-II 22 Alternatively, we get A B C D E A 0 2 0 0 B 0 1 0 0 C 2 1 3 0 D 0 0 3 4 E 0 0 0 4 In the case of the first alternative, the optimum assignment is A D A, but this is not the solution of the travelling salesman problem. In the case of the second alternative, the optimum assignment is A E C B D A, i.e., 3 + 4 + 5 + 2 + 2 = 16 hr