0% found this document useful (0 votes)
7 views6 pages

Hungarian Method

The Hungarian method is an optimization technique for solving assignment problems in polynomial time, introduced by Harold Kuhn in 1955. It involves a series of steps including matrix manipulation and assignment of tasks to minimize costs or maximize profits. The method ensures that each task is assigned to a resource in an efficient manner, ultimately leading to an optimal solution.

Uploaded by

Pritam Chavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Hungarian Method

The Hungarian method is an optimization technique for solving assignment problems in polynomial time, introduced by Harold Kuhn in 1955. It involves a series of steps including matrix manipulation and assignment of tasks to minimize costs or maximize profits. The method ensures that each task is assigned to a resource in an efficient manner, ultimately leading to an optimal solution.

Uploaded by

Pritam Chavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Hungarian method

The Hungarian method is a computational optimization technique that


addresses the assignment problem in polynomial time and foreshadows
following primal-dual alternatives. In 1955, Harold Kuhn used the term
“Hungarian method” to honour two Hungarian mathematicians, Dénes
Kőnig and Jenő Egerváry. Let’s go through the steps of the Hungarian
method with the help of a solved example.

Hungarian Method to Solve Assignment Problems

The Hungarian method is a simple way to solve assignment problems. Let


us first discuss the assignment problems before moving on to learning the
Hungarian method.

What is an Assignment Problem?

A transportation problem is a type of assignment problem. The goal is to


allocate an equal amount of resources to the same number of activities.
As a result, the overall cost of allocation is minimised or the total profit is
maximised.

Because available resources such as workers, machines, and other


resources have varying degrees of efficiency for executing different
activities, and hence the cost, profit, or loss of conducting such activities
varies.

Assume we have ‘n’ jobs to do on ‘m’ machines (i.e., one job to one
machine). Our goal is to assign jobs to machines for the least amount of
money possible (or maximum profit). Based on the notion that each
machine can accomplish each task, but at variable levels of efficiency.

Hungarian Method Steps

Check to see if the number of rows and columns are equal; if they are, the
assignment problem is considered to be balanced. Then go to step 1. If it
is not balanced, it should be balanced before the algorithm is applied.

Step 1 – In the given cost matrix, subtract the least cost element of each
row from all the entries in that row. Make sure that each row has at least
one zero.

Step 2 – In the resultant cost matrix produced in step 1, subtract the


least cost element in each column from all the components in that
column, ensuring that each column contains at least one zero.

Step 3 – Assign zeros


 Analyse the rows one by one until you find a row with precisely one
unmarked zero. Encircle this lonely unmarked zero and assign it a
task. All other zeros in the column of this circular zero should be
crossed out because they will not be used in any future
assignments. Continue in this manner until you’ve gone through all
of the rows.

 Examine the columns one by one until you find one with precisely
one unmarked zero. Encircle this single unmarked zero and cross
any other zero in its row to make an assignment to it. Continue until
you’ve gone through all of the columns.

Step 4 – Perform the Optimal Test

 The present assignment is optimal if each row and column has


exactly one encircled zero.

 The present assignment is not optimal if at least one row or column


is missing an assignment (i.e., if at least one row or column is
missing one encircled zero). Continue to step 5. Subtract the least
cost element from all the entries in each column of the final cost
matrix created in step 1 and ensure that each column has at least
one zero.

Step 5 – Draw the least number of straight lines to cover all of the zeros
as follows:

(a) Highlight the rows that aren’t assigned.

(b) Label the columns with zeros in marked rows (if they haven’t already
been marked).

(c) Highlight the rows that have assignments in indicated columns (if they
haven’t previously been marked).

(d) Continue with (b) and (c) until no further marking is needed.

(f) Simply draw the lines through all rows and columns that are not
marked. If the number of these lines equals the order of the matrix, then
the solution is optimal; otherwise, it is not.

Step 6 – Find the lowest cost factor that is not covered by the straight
lines. Subtract this least-cost component from all the uncovered elements
and add it to all the elements that are at the intersection of these straight
lines, but leave the rest of the elements alone.

Step 7 – Continue with steps 1 – 6 until you’ve found the highest suitable
assignment.
Example 1
The present assignment is optimal because each row and column contain
precisely one encircled zero.

Where 1 to II, 2 to IV, 3 to I, 4 to V, and 5 to III are the best assignments.

Hence, z = 15 + 14 + 21 + 20 + 16 = 86 hours is the optimal time.


Example 2

X1 X2 X3 X X
4 5
A 15 29 35 20 38
B 21 27 33 17 36
C 17 25 37 15 42
D 14 31 39 21 40
E 19 30 40 19 18

Row Reduction:

X1 X2 X3 X X
4 5
A 0 14 20 5 23
B 4 10 16 0 19
C 2 10 22 0 27
D 0 17 25 7 26
E 1 12 22 1 0

Column Reduction :

X1 X2 X3 X X
4 5
A 0 14 20 5 23
B 4 10 16 0 19
C 2 10 22 0 27
D 0 17 25 7 26
E 1 12 22 1 0

X1 X2 X3 X X
4 5
A 0 14 20 5 23
B 4 10 16 0 19
C 2 10 22 0 27
D 0 17 25 7 26
E 1 12 22 1 0

You might also like