0% found this document useful (0 votes)
227 views26 pages

Assignment Problem Using Hungarian Method

The Hungarian method is a optimization algorithm used to solve the assignment problem in polynomial time. It proceeds in two phases: 1. The first phase involves row and column reduction to transform the cost matrix into a form with all zeros on the main diagonal. This is done by subtracting row and column minimums. 2. If the number of zeros does not equal the number of rows/columns after phase 1, the second phase adds the minimum nonzero value to rows/columns to transform the matrix further until an optimal assignment is reached. The example demonstrates applying the Hungarian method to an assignment problem involving 5 jobs and 5 operators, arriving at an optimal assignment with a total processing time of 38 hours.

Uploaded by

Muhammad Faisal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
227 views26 pages

Assignment Problem Using Hungarian Method

The Hungarian method is a optimization algorithm used to solve the assignment problem in polynomial time. It proceeds in two phases: 1. The first phase involves row and column reduction to transform the cost matrix into a form with all zeros on the main diagonal. This is done by subtracting row and column minimums. 2. If the number of zeros does not equal the number of rows/columns after phase 1, the second phase adds the minimum nonzero value to rows/columns to transform the matrix further until an optimal assignment is reached. The example demonstrates applying the Hungarian method to an assignment problem involving 5 jobs and 5 operators, arriving at an optimal assignment with a total processing time of 38 hours.

Uploaded by

Muhammad Faisal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 26

Assignment Problem

Using Hungarian
Method
OPERATIONAL RESEARCH
MCS - FINAL
Hungarian Method Steps
Phase I
Step 1:
If number of rows is not equal to number of
columns, then add dummy rows or columns
with cost 0, to make it a square matrix.
Hungarian Method Steps
Step 2:
A. Row Reduction:  Identify the minimum element in
each row and subtract it from each element of that
row.
B. Column Reduction: Identify the minimum element
in each column and subtract it from every element of
that column.
Hungarian Method Steps
Step 3:
Make assignment in the cost table
A. Row Scanning: Identify rows with exactly one
unmarked 0. Make an assignment to this single
0 by make a square ( [0] ) around it and cut
column.
Hungarian Method Steps
B. Column Scanning: Identify columns with
exactly one unmarked 0. Make an assignment to
this single 0 by make a square ( [0] ) around it
and cut rows.
Hungarian Method Steps
C. If a row and/or column has two or more
unmarked 0 and one cannot be chosen by
inspection, then choose the cell arbitarily.
Hungarian Method Steps
d. Continue this process until all number of
assigned 0 are equal to number of
rows/Column.
Hungarian Method Steps
Step 3:
A. if number of assigned 0 are not equal to
number of rows/Column than goto Phase II
Hungarian Method Steps
Phase II
Step 1:
Find minimum undeleted cell value or on
marked cell value.
Hungarian Method Steps
Step 2:
Add this value on the cell where there is
intersection because of cutting rows and
column due to row and column scanning.
Hungarian Method Steps
Step 3:
Subtract the minimum value from the un
marked cells
Hungarian Method Steps
Step 4:
Repeat from Step 3 of Phase I.
Example
Solve the following assignment problem using Hungarian method. The matrix
entries represent the processing time in hours.
   
OPERATORS
 
  O1 O2 O3 O4 O5
J1 9 11 14 11 7
J2 6 15 13 13 10
JOBS J3 12 13 6 8 8
J4 11 9 10 12 9
J5 7 12 14 10 14
Example
Highlighting Row Minimum
    OPERATORS
    O1 O2 O3 O4 O5
J1 9 11 14 11 7
J2 6 15 13 13 10
JOBS J3 12 13 6 8 8
J4 11 9 10 12 9
J5 7 12 14 10 14
Example
Row Reduction
    OPERATORS
    O1 O2 O3 O4 O5
J1 9-7 11-7 14-7 11-7 7-7
J2 6-6 15-6 13-6 13-6 10-6
JOBS J3 12-6 13-6 6-6 8-6 8-6
J4 11-9 9-9 10-9 12-9 9-9
J5 7-7 12-7 14-7 10-7 14-7
Example
Row Reduction - Answer
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 7 4 0
J2 0 9 7 7 4
JOBS J3 6 7 0 2 2
J4 2 0 1 3 0
J5 0 5 7 3 7
Example
Highlight Column Minimum
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 7 4 0
J2 0 9 7 7 4
JOBS J3 6 7 0 2 2
J4 2 0 1 3 0
J5 0 5 7 3 7
Example
Column Reduction:
    OPERATORS
    O1 O2 O3 O4 O5
J1 2-0 4-0 7-0 4-2 0-0
J2 0-0 9-0 7-0 7-2 4-0
JOBS J3 6-0 7-0 0-0 2-2 2-0
J4 2-0 0-0 1-0 3-2 0-0
J5 0-0 5-0 7-0 3-2 7-0
Example
Column Reduction - Answer:
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 7 2 0
J2 0 9 7 5 4
JOBS J3 6 7 0 0 2
J4 2 0 1 1 0
J5 0 5 7 1 7
Example
Row Scanning
Column  Scanning   OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 7 2 0
J2 0 9 7 5 4
JOBS J3 6 7 0 0 2
J4 2 0 1 1 0
J5 0 5 7 1 7
Example
Row Scanning
Column Scanning
Example
Min value = 1
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 7-1 2-1 0
J2 0 9 7-1 5-1 4
JOBS J3 6+1 7+1 0 0 2+1
J4 2 0 1-1 1-1 0
J5 0 5 7-1 1-1 7
Example
Min value = 1
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 6 1 0
J2 0 9 6 4 4
JOBS J3 7 8 0 0 3
J4 2 0 0 0 0
J5 0 5 6 0 7
Example
Row and Column Scanning
    OPERATORS
    O1 O2 O3 O4 O5
J1 2 4 6 1 0
J2 0 9 6 4 4
JOBS J3 7 8 0 0 3
J4 2 0 0 0 0
J5 0 5 6 0 7
Example
Row and Column Scanning
Example
Optimized Results.

J1 05 7
J2 01 6
J3 03 6
J4 02 9
J5 04 10
    38 hours

You might also like