Академический Документы
Профессиональный Документы
Культура Документы
X
j 1
ij 1 i 1,2,3..., n
m
X
i 1
ij 1 j 1,2,3..., n
X ij 0or1
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
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 solution example
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
5 11 5 0 0 1
For each row in which no assignment is
made, mark a tick ( row 3 )
Examine the marked rows. If any zero cell
occurs in those rows, mark to the
respective columns that contain those
zeroes. (column A)
Examine marked columns. If any assigned
zero occurs in these columns, then tick
the respective rows that contain those
zeroes (Row 2)
Repeat this process until no more rows
The above solution is not optimal as and columns can be marked
only four lines are there Draw a straight line through each marked
column and each unmarked row. (column
A, ROW 1,4,5)
Among the uncovered elements, 4 is the minimum. Subtract 4 from
all the uncovered elements and add the same to elements
correspond to intersection of lines. We get the following matrix:
Job\Machines A B C D E
Job\Machines A B C D E 1 8 0 0 7 0
1 12 0 0 7 0 2 0 14 12 14 4
2 0 10 8 10 0 3 0 12 8 6 4
3 0 8 4 2 0 4 19 1 0 0 5
4 23 1 0 0 5 5 11 5 0 0 1
5 15 5 0 0 1
Job\Machines A B C D E
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
faviurably. 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
Profit in Factories
Product F1 F2 F3 F4
A 1 8 4 1
B 5 7 6 25
C 3 5 4 2
D 3 1 6 2