0% found this document useful (0 votes)
22 views15 pages

CMAP

The document describes the assignment problem and the Hungarian method for solving it. It can be summarized as: 1) The assignment problem involves assigning n jobs to n machines/persons/facilities to minimize costs, where the cost of assigning job i to machine j is cij. 2) The Hungarian method is an algorithm that solves the assignment problem in polynomial time by finding an optimal assignment with minimum cost. 3) It works by first reducing the cost matrix so there is at least one zero in each row and column. It then assigns the zeros and iteratively covers remaining zeros until reaching a complete assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views15 pages

CMAP

The document describes the assignment problem and the Hungarian method for solving it. It can be summarized as: 1) The assignment problem involves assigning n jobs to n machines/persons/facilities to minimize costs, where the cost of assigning job i to machine j is cij. 2) The Hungarian method is an algorithm that solves the assignment problem in polynomial time by finding an optimal assignment with minimum cost. 3) It works by first reducing the cost matrix so there is at least one zero in each row and column. It then assigns the zeros and iteratively covers remaining zeros until reaching a complete assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Assignment Problem

• 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

• Solution is required to be integral i.e. (0 or 1)


• Can this be solved as LP?
o Yes!
• If all demands and supplies are integral, then there is
always an optimal solution in which xij values are
integral for a transportation problem.
• Property applies for Assignment Problem also, as it is
a special case of transportation problem.
Problem Reduction
Each row and each column has exactly one assignment.
J1 J2 J3 J1 J2 J3
M1 M1 0 7 3 0
M2 M2 11 0 14 11
M3 M3 0 5 7 4

Consider subtracting/adding a constant to all cost elements in a row or


column.
It does not change the optimal solution.
Problem Reduction: Subtract the smallest element from each row/column
until there is at least one zero in each row and in each column of cost matrix.

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

1) Go along a row, if a single zero is found, surround it (assign it),


cross the other zeros in the same column.
2) Do the same for the column.
Repeat 1 and 2 till all the zeros are either surrounded or crossed.

IF NO row/column contains a single zero then choose a zero arbitrarily


and surround it, cross the other zeros in the corresponding row as well as
in the column
Example: J1 J2 J3 J4
M1 12 5 6 8
M2 7 11 4 3
M3 8 4 9 5
M4 3 4 9 10
Subtracting smallest entry from each row.

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

Reduced matrix is:


J1 J2 J3 J4 J5
M1
M2
M3
M4
M5
When complete assignment is not obtained?
J1 J2 J3 J4 J5
M1
M2
M3
M4
M5

• If complete assignment is not possible using existing zeros, then we


need to create more zeros by the following process:
 Cover ALL the zeros using as few lines as possible.
 Find the smallest element among those not covered with the lines.
 Subtract this value from all uncovered elements and add it to
elements at the intersection of lines.
Reaching to a new reduced matrix
J1 J2 J3 J4 J5 J1 J2 J3 J4 J5
M1 M1 0 6-2 7-2 8 0
M2 M2 5+2 0 0 2+2 4+2
M3 M3 0 7-2 5-2 0 9
M4 M4 8 9-2 2-2 0 6
M5 M5 4 3-2 2-2 0 0

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

If complete assignment is obtained, it is an optimal solution, if not, again


draw the minimum number of lines to cover all the zeros and repeat the
process.

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

You might also like