Assignment Model and Hungarian Method
Assignment Model and Hungarian Method
Jobs
1 2 ... n
The assignment model is a special case of the transportation model, where the
workers represent origins and jobs represent destinations. The offer
(demand) at each origin (destination) is equal to 1. The cost of 'transporting' the worker
workijIn fact, the assignment model can be solved directly.
as a transport model (or as a regular PL). However, the fact
that the supply and demand are equal to 1 leads to the development of an algorithm of
simple solution called Hungarian method. Although the new solution method appears
it is totally foreign to the transport model, in reality the algorithm has its origin
in the simplex method, just like the transportation model.
We will use two examples to present the mechanics of the new algorithm. The si-
The following section provides an explanation of the procedure based on the simplex method.
Example 5.4-1
Joe Klyne's three children, John, Karen, and Terri, want to earn some money for their expenses.
Mr. Klyne chose three tasks for his children: to mow the lawn, to paint the door of the
garage and wash the family cars. To avoid early competition among the heirs
he asks them to submit individual (secret) bids for what they consider a payment
8Like with the transportation method, the classical Hungarian method (designed mainly for calculations
Annuals) is something of the past, and is presented here for historical reasons. Currently, that type is not required.
of calculations, since the problem can be solved using highly efficient PL computer codes
clients. Perhaps the benefit of studying these classical techniques is that they are based on a complex theory.
which reduces the solution steps to simple rules suitable for manual calculations.
[Link]
202 Chapter 5 Transport model and its variants
TABLE 5.33 Application of the Hungarian method to the assignment problem from example 5.4-1
Step 1: Step 2:
John 6 0 0
Karen 0 5 1
Terri 2 3 0
just for each of the three tasks. Table 5.32 summarizes the bids received. The children re-
they will weigh their father's decision regarding the assignment of the tasks.
The assignment problem will be solved by the Hungarian method.
Step 1. Determinei, the minimum cost element in the row of the original cost matrix, and
remove it from all the elements of the row, i51, 2, 3.
Step 2. For the matrix created in step 1, determinej, the minimum cost element of the
column, and subtract it from all the elements of the column, j51, 2, 3.
Step 3. Based on the matrix from step 2, try to determine a feasible assignment between
all resulting zero entries.
3a. If that allocation can be found, it is optimal.
3b. Otherwise, more calculations are required (as explained in example 5.4-2).
Table 5.33 demonstrates the application of the two steps to the current problem.
The cells with underlined zero entries in step 3 give the optimal (feasible) solution: John
Karen gets the job of painting, Karen gets the job of mowing the lawn, and Terri gets the job of washing the cars.
vials of the family. The total cost for Mr. Klyne is $918,185. This amount always
it will be the same (p11p21p3)1(q11q21q3)5(91918)1(01110)5$27. (A justification
this result is given in the following section.)
As indicated in step 3 of the Hungarian method, the zeros created by the steps
1 and 2 may not provide a feasible solution directly. In this case, they are needed
more steps to determine the optimal (feasible) allocation. The following example of-
show this situation.
Example 5.4-2
Suppose that the situation analyzed in example 5.4-1 is expanded to four children and four tasks.
Table 5.34 summarizes the cost elements of the problem.
[Link]
5.4 Allocation model 203
Task
1 2 3 4
1 $1 $4 $6 $3
2 $9 $7 $10 $9
Child
3 $4 $5 $11 $7
4 $8 $7 $8 $5
Task
1 2 3 4
1 0 3 2 2
2 2 0 0 2
Child
3 0 1 4 3
4 3 2 0 0
Task
1 2 3 4
1 0 3 2 2
2 2 0 0 2
Child
3 0 1 4 3
4 3 2 0 0
[Link]
204 Chapter 5 Transport model and its variations
Task
1 2 3 4
1 0 2 1 1
2 3 0 0 2
Child
3 0 0 3 2
4 4 2 0 0
Moment of AMPL.
The file [Link] provides the AMPL model for the assignment model. The mo-
the work is similar to that of the transport model.
(i) (ii)
$3 $8 $2 $10 $3 $3 $9 $2 $2 $7
$6 $5 $2 $7 $5 $6 $1 $5 $6 $6
$6 $4 $2 $7 $5 $9 $4 $7 $10 $3
$8 $4 $2 $3 $5 $2 $5 $4 $2 $1
$7 $8 $6 $7 $7 $9 $6 $2 $4 $6
Work
1 2 3 4
[Link]