Chapter - Assignment Problems
Chapter - Assignment Problems
Chapter - Assignment Problems
X ij 1 i 1,2,3...,
n
j 1,2,3...,
m X
j1
ij n
1 0or1
i1 X ij
ASSIGNMENT PROBLEMS:Hungarian
Method
• Developed by Hungarian mathematician D
Konig.
• In this method, opportunity cost is found and
allocation is done to the
Steps in Hungarian Method
• Step1 Develop cost table from the given
problem (If number of row and columns are
not equal, then a dummy row or column must
be added. The costs for dummy cells are zero.
• Step 2: Find the opportunity cost table
– Locate smallest element in each row of the given
cost table and then subtract that from each
element of that row, and
Job3 8 5 0 0 0
Job4 0 4 2 0 5
Job5 3 5 6 0 8
Step 4
• If the number of assigned cells is equal to the
number of rows or columns then the solution is
optimal. The total cost associated with this solution
is obtained by adding original cost figures in
occupied cells.
• If zero cell was chosen arbitrarily, then there exists
alternative solution
• If optimal solution is not found that proceed to step
5
Step 5
• Revise the opportunity cost table by the following
procedure
– For each row in which no assignment is made, mark a
tick ( )
– Examine the marked rows. If any zero cell occurs in those rows,
mark a ( ) to the respective columns that contain
those zeroes.
– Examine marked columns. If any assigned zero occurs in these
columns, then tick the respective rows that contain those
zeroes
– Repeat this process until no more rows and columns can be
marked
– Draw a straight line through each marked column and each
unmarked row.
– If the number of lines drawn (or total assignments) is equal to
the number of rows or columns then the current solution is
optimal, otherwise go to step 6.
Jobs/Employ Sujay Pawan Prasad Mohan Hari
ees
Job1 5 0 8 10 11
Job2 0 6 15 10 3
Job3 8 5 0 0 0
Job4 0 4 2 0 5
Job5 3 5 6 0 8
Step 6 &7
• Step 6:
– From cells not covered by any line, choose the smallest
element. Call this value k.
– Subtract k from every element in the cell not covered by a
line.
– Add k to every element in the cell covered by the two
lines, i.e intersection of two lines.
– Element in cells covered by one line remains
unchanged
• Step 7: Repeat Steps 3 to 6 until an optimal solution
is obtained.
K=2
Job4 0 2 0 0 3
Job5 3 3 4 0 6
Sub-assembly\Contractor A B C D
1 15 13 14 17
2 11 12 15 13
3 18 12 10 11
4 15 17 14 16
Sub- A B C D Sub-assembly A B C D
assembly \Contractor
\Contract 1 15 13 14 17
or
2 11 12 15 13
1 2 0 1 4
3 18 12 10 11
2 0 1 4 2
4 15 17 14 16
3 8 2 0 1
4 1 3 0 2
Sub-assembly\Contractor A B C D
1 2 0 1 3
2 0 1 4 1
3 8 2 0 0
4 1 3 0 1
Example A3: Multiple optimal solutions
Job\Machines A B C D E Job\Machines A B C D E
1 9 3 1 13 1 1 8 2 0 12 0
2 1 17 13 20 5 2 0 16 12 19 4
3 0 14 8 11 4 3 0 14 8 11 4
4 19 3 0 5 5
4 19 3 0 5 5
5 11 7 0 5 1
5 12 8 1 6 2
Column B and D does not have any zero, therefore we subtract smallest element from these
columns, remaining columns are retained. Assignments are made
Job\Machines 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
Job\Machines 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
1 12 0 0 7 0
: In the table, job 2 and job 3 have
2 0 10 8 10 0 zeroes at common locations for
employee A and E. Therefore two
3 0 8 4 2 0 alternative solutions are possible.
4 23 1 0 0 5 Similarly two more alternative
solutions are possible with the job 4
5 15 5 0 0 1 and 5.
Alternative solutions are shown
below
Alternative 1 Alternative 2
Job\Machines A B C D E Job\Machines A B C D E
1 12 0 0 7 0 1 12 0 0 7 0
2 0 10 8 10 0 2 0 10 8 10 0
3 0 8 4 2 0 3 0 8 4 2 0
4 23 1 0 0 5 4 23 1 0 0 5
5 15 5 0 0 1 5 15 5 0 0 1
Alternative 3 and 4 are presented. All the alternative solutions are
optimal as number of allocations are equal to 5
Alternative 3 Alternative 4
Job\Machines A B C D E Job\Machines A B C D E
1 12 0 0 7 0 1 12 0 0 7 0
2 0 10 8 10 0 2 0 10 8 10 0
3 0 8 4 2 0 3 0 8 4 2 0
4 23 1 0 0 5 4 23 1 0 0 5
5 15 5 0 0 1 5 15 5 0 0 1
Example A4: Unbalanced Assignment Problem
A city corporation has decided to carry out road repairs on main four arteries of the
city. The government has agreed to make a special grant of Rs. 50 lakh towards the
cost with a condition that the repairs be done at the lowest cost and quickest time. If
the conditions warrant, a supplementary token grant will also be considered
favourably. The corporation has floated tenders and five contractors have sent in their
bids. In order to expedite work only one road will be awarded to only one contractor.
Find the best way of assigning repair work to the contractors and the costs.
If I is necessary to seek supplementary grants, what should be the amount sought?
Which of the five contractors will be unsuccessful in his bid?
R1 R2 R3 R4
C1 9 14 19 15
C2 7 17 20 19
C3 9 18 21 18
C4 10 12 18 19
C5 10 15 21 16
Number of roads < number of contractors. Therefore in order to make it a square
matrix, a dummy road is added
R1 R2 R3 R4 Dummy
C1 9 14 19 15 0
C2 7 17 20 19 0
C3 9 18 21 18 0
C4 10 12 18 19 0
C5 10 15 21 16 0
As each row already contains zero, subtract smallest number from each
column for the elements in that column
R1 R2 R3 R4 Dummy
C1 2 2 1 0 0
C2 0 5 2 4 0
C3 2 6 3 3 0
C4 3 0 0 4 0
C5 3 3 3 1 0
Examine row and do allocation for rows/columns having one zeros. Strike off other
zeroes. As there are only four allocations, this solution is not optimal
R1 R2 R3 R4 Dummy
C1 2 2 1 0 0
C2 0 5 2 4 0
C3 2 6 3 3 0
C4 3 0 0 4 0
C5 3 3 3 1 0
R1 R2 R3 R4 Dummy
C1 2 2 1 0 0
C2 0 5 2 4 0
C3 2 6 3 3 0
C4 3 0 0 4 0
C5 3 3 3 1 0
Among the remaining cells, 1 is the least, Subtract from the cells that are not covered
by line (Row c3, c5). Add it to cells in intersection of lines. Other remain same.
Reallocation is done. This is not optimal as well
R1 R2 R3 R4 Dummy
C1 2 2 1 0 1
C2 0 5 2 4 1
C3 1 5 2 2 0
C4 3 0 0 4 1
C5 2 2 2 0 0
R1 R2 R3 R4 Dummy
C1 2 2 1 0 0
C2 0 5 2 4 0
C3 2 6 3 3 0
C4 3 0 0 4 0
C5 3 3 3 1 0
Lines are drawn based on the rules. Minimum value is k=1. Subtract 1 from cells that
are not covered and add to cells that are at intersection. Resultant table is the second
table shown. The allocations are done.
R1 R2 R3 R4 Dummy
C1 2 2 1 0 1
C2 0 5 2 4 1
C3 1 5 2 2 0
C4 3 0 0 4 1
C5 2 2 2 0 0
R1 R2 R3 R4 Dummy
C1 1 1 0 0 1
C2 0 5 2 5 2
C3 0 4 1 2 0
C4 3 0 0 5 2
C5 1 1 1 0 0
This solution is optimal as number allocations is 5. Total Cost= 19+7+12+16=54
Find the best way of assigning repair work to the contractors and the costs.
Assignment schedule
Road1 Road2 Road3 Road4
C2 C4 C1 C5