CMAP
CMAP
• Consider
Assigning jobs to machines/persons. OR
Assigning employees to projects. OR
Assigning products to plants.
• Let there be n jobs and n machines/persons/facilities.
If job i is done on machine j, the cost is cij.
Each machine can process only one job,
each job is to be processed by one machine only,
and all jobs must be processed.
Which job should be assigned to which machine to
minimize cost?
Integrality Property of Transportation Problem
In the reduced matrix, if we can find an assignment using only zero cost, it has
to be optimal.
Example: J1 J2 J3 J4
M1 8 3 6 5
M2 5 7 2 3
M3 5 6 9 2
M4 3 2 1 8
Subtracting smallest entry from each row.
5 0 3 2
3 5 0 1
3 4 7 0
3 0 3 2
2 1 0 7
1 5 0 1
1 4 7 0
0 1 0 7
Subtracting smallest entry from each column.
3 0 3 2
1 5 0 1
1 4 7 0
0 1 0 7
7 0 1 3
4 8 1 0
4 0 5 1
7 0 0 3
0 1 6 7
4 8 0 0
4 0 4 1
0 1 5 7
Subtracting smallest entry from each column.
7 0 0 3
4 8 0 0
4 0 4 1
0 1 5 7
Example:
J1 J2 J3 J4 J5
M1
M2
M3
M4
M5
J1 J2 J3 J4 J5
Find the smallest element among
M1 0 4 5 8 0
those not covered with the lines.
M2 7 0 0 4 6
Subtract this value from all
uncovered elements, and add it to M3 0 5 3 0 9
elements at the intersection of 8 7 0 0 6
M4
lines.
M5 4 1 0 0 0
J1 J2 J3 J4 J5
M1
M2
M3
M4
M5
Note:
• To cover zeros in an n×n assignment problem with (n - ) assigned zeros, at
most (n - ) lines are required.
• Assignment cost is to be read from the given initial table. (= Sum of the
entries corresponding to the assigned zeros in the initial table)
Optimal Cost
J1 J2 J3 J4 J5
M1
M2
M3
M4
M5
Overall cost = 1 + 2 + 3 + 3 + 3 = 12
The Hungarian Method
Step 1:
Reduce the cij matrix so that there is at least one zero in each
row and column. (There should not be any negative values.)
Step 2:
Assign zeros as many as possible. If number of assigned zeros
is n (complete assignment). STOP, optimal solution is obtained.
Else, Cover all zeros in the reduced matrix with as few lines as
possible. go to Step 3.
Step 3:
Let be the smallest uncovered element. Subtract from each
uncovered element of the matrix, and add it to elements at the
intersection of two lines. Go back to Step 2.
Practice Examples
Another exercise