Assignments Problems Hungarian Method
Assignments Problems Hungarian Method
Assignments Problems Hungarian Method
Hungarian Method:
The Hungarian Method is discussed in the form of a series of computational steps as follows, when
the objective function is that of minimization type.
Step 1:
From the given problem, find out the cost table. Note that if the number of origins is not equal to
the number of destinations then a dummy origin or destination must be added.
Step 2:
In each row of the table find out the smallest cost element, subtract this smallest cost element from
each element in that row. So, that there will be at least one zero in each row of the new table. This
new table is known as First Reduced Cost Table.
Step 3:
In each column of the table find out the smallest cost element, subtract this smallest cost element
from each element in that column. As a result of this, each row and column has at least one zero
element. This new table is known as Second Reduced Cost Table.
Step 4:
1. For each row or column with a single zero element cell that has not be assigned or
eliminated, box that zero element as an assigned cell.
2. For every zero that becomes assigned, cross out all other zeros in the same row and for
column.
3. If for a row and for a column there are two or more zero and one can’t be chosen by
inspection, choose the assigned zero cell arbitrarily.
4. The above procedures may be repeated until every zero element cell is either assigned
(boxed) or crossed out.
Step 5:
An optimum assignment is found, if the number of assigned cells is equal to the number of rows (and
columns). In case we had chosen a zero cell arbitrarily, there may be an alternate optimum. If no
optimum solution is found i.e. some rows or columns without an assignment then go to Step 6.
Step 6:
Draw a set of lines equal to the number of assignments which has been made in Step 4, covering all
the zeros in the following manner
1. Mark check (√) to those rows where no assignment has been made.
2. Examine the checked (√) rows. If any zero element cell occurs in those rows, check (√) the
respective columns that contains those zeros.
3. Examine the checked (√) columns. If any assigned zero element occurs in those columns,
check (√) the respective rows that contain those assigned zeros.
4. The process may be repeated until now more rows or column can be checked.
5. Draw lines through all unchecked rows and through all checked columns.
Step 7:
Examine those elements that are not covered by a line. Choose the smallest of these elements and
subtract this smallest from all the elements that do not have a line through them.
Add this smallest element to every element that lies at the intersection of two lines. Then the
resulting matrix is a new revised cost table.
Repeat Step 4.
Jobs
1 2 3 4
A 20 25 22 28
Persons B 15 18 23 17
C 19 17 21 24
D 25 23 24 24
Solution
Step 1:-
Jobs
1 2 3 4
A 20 25 22 28
Persons B 15 18 23 17
C 19 17 21 24
D 25 23 24 24
Step 2:-
Jobs
1 2 3 4
A 0 5 2 8
Persons B 0 3 8 2
C 2 0 4 7
D 2 0 1 1
Step 3:-
Jobs
1 2 3 4
A 0 5 1 7
Persons B 0 3 7 1
C 2 0 3 6
D 2 0 0 0
Step 4:-
Jobs
1 2 3 4
A 0 5 1 7
Persons B 0 3 7 1
C 2 0 3 6
D 2 0 0 0
Step 5:-
Step 6:-
Jobs
1 (Tick) 2 3 4
A (Tick) 0 5 1 7
Persons B (Tick) 0 3 7 1
C 2 0 3 6
D 2 0 0 0
Step 7:-
Jobs
1 2 3 4
A 0 4 0 6
Persons B 0 2 6 0
C 3 0 3 6
D 3 0 0 0
Jobs
1 2 3 4 5
Workers A 5 2 4 2 5
B 2 4 7 6 6
C 6 7 5 8 7
D 5 2 3 3 4
E 8 3 7 8 6
F 3 6 3 5 7
Solution
Step 1:-
Jobs
1 2 3 4 5 6
Workers A 5 2 4 2 5 0
B 2 4 7 6 6 0
C 6 7 5 8 7 0
D 5 2 3 3 4 0
E 8 3 7 8 6 0
F 3 6 3 5 7 0
Step 2:-
Jobs
1 2 3 4 5 6
Workers A 5 2 4 2 5 0
B 2 4 7 6 6 0
C 6 7 5 8 7 0
D 5 2 3 3 4 0
E 8 3 7 8 6 0
F 3 6 3 5 7 0
Step 3:-
Jobs
1 2 3 4 5 6
Workers A 3 0 1 0 1 0
B 0 2 4 4 2 0
C 4 5 2 6 3 0
D 3 0 0 1 0 0
E 6 1 4 6 2 0
F 1 4 0 3 3 0
Step 4:-
Jobs
1 2 3 4 5 6
Workers A 3 0 1 0 1 0
B 0 2 4 4 2 0
C 4 5 2 6 3 0
D 3 0 0 1 0 0
E 6 1 4 6 2 0
F 1 4 0 3 3 0
Step 5:-
This is not an optimum Solution.
Step 6:-
Jobs
1 2 3 4 5 6 (Tick)
Workers A 3 0 1 0 1 0
B 0 2 4 4 2 0
C (Tick) 4 5 2 6 3 0
D 3 0 0 1 0 0
E (Tick) 6 1 4 6 2 0
F 1 4 0 3 3 0
Step 7:-
Jobs
1 2 3 4 5 6
Workers A 3 0 1 0 1 1
B 0 2 4 4 2 1
C 3 4 1 5 2 0
D 3 0 0 1 0 1
E 5 0 3 5 1 0
F 1 4 0 3 3 0
Worker A is assigned to Job 4
Offices
W X Y Z
Employee A 160 220 240 200
B 100 320 260 160
C 100 200 460 250
Jobs
1 2 3 4 5
1 70 30 X 60 30
Computer 2 X 70 50 30 30
Machines 3 60 X 50 70 60
4 60 70 20 40 X
5 30 30 40 X 70
Solution
“Substitute X = high Value” and solve the problem with the above
steps.
Find which line of service is connected with which other line so as to reduce the waiting time
to the minimum.
Departure Route Arrival at Arrival at Route Departure
from Number Coimbatore Chennai Number from
Chennai Coimbatore
06:00 1 12:00 11:30 a 05:30
07:30 2 13:30 15:00 b 09:00
11:30 3 17:30 21:00 c 15:00
19:00 4 01:00 00:30 d 18:30
00:30 5 06:30 06:00 e 00:00
Solution
Let Crew resides at Chennai and rest at Coimbatore. Waiting times is as follows:-
Routes
a b c d e
1 17.5 21 A 6.5 12
Routes 2 16 19.5 A 5 10.5
3 12 15.5 21.5 A 6.5
4 4.5 8 4 17.5 23
5 23 A 8.5 12 17.5
Let Crew resides at Coimbatore and rest at Chennai. Waiting times is as follows:-
Routes
a b c d e
1 18.5 15 9 5.5 A
Routes 2 20 16.5 10.5 7 A
3 A 20.5 14.5 11 5.5
4 7.5 A 22 18.5 13
5 13 9.5 A A 18.5
Combine matrix to find the optimum solution considering stay and rest in both the location
is as follows:-
Routes
a b c d e
1 17.5* 15 9 5.5 12*
Routes 2 16* 16.5 10.5 5* 10.5*
3 12* 15.5* 14.5 11 5.5
4 4.5* 8* 14* 17.5* 13
5 13 9.5 8.5* 12* 17.5*
Now solve it using Hungarian Method.
Final Answer is
Routes Residence of the Crew Waiting Time
1–c Coimbatore 9
2–d Chennai 5
3–e Coimbatore 5.5
4–a Chennai 4.5
5–b Coimbatore 9.5