Now we will examine a few highly simplified illustrations of Hungarian Method for solving an assignment problem.
The Funny Toys Company has four men available for work on four separate jobs. Only one man can work on any one job. The cost of assigning each man to each job is given in the following table. The objective is to assign men to jobs in such a way that the total cost of assignment is minimum.
This is a minimization example of assignment problem. We will use the Hungarian Algorithm to solve this problem.
Identify the minimum element in each row and subtract it from every element of that row. The result is shown in the following table.
"A man has one hundred dollars and you leave him with two dollars, that's subtraction." -Mae West
On small screens, scroll horizontally to view full calculation
Identify the minimum element in each column and subtract it from every element of that column.
Make the assignments for the reduced matrix obtained from steps 1 and 2 in the following way:
An optimal assignment is found, if the number of assigned cells equals the number of rows (and columns). In case you have chosen a zero cell arbitrarily, there may be alternate optimal solutions. If no optimal solution is found, go to step 5.
Use Horizontal Scrollbar to View Full Table Calculation
Draw the minimum number of vertical and horizontal lines necessary to cover all the zeros in the reduced matrix obtained from step 3 by adopting the following procedure:
Select the smallest element (i.e., 1) from all the uncovered elements. Subtract this smallest element from all the uncovered elements and add it to the elements, which lie at the intersection of two lines. Thus, we obtain another reduced matrix for fresh assignment.
Now again make the assignments for the reduced matrix.
Since the number of assignments is equal to the number of rows (& columns), this is the optimal solution.
The total cost of assignment = A1 + B4 + C2 + D3
Substituting values from original table:
20 + 17 + 17 + 24 = Rs. 78.