0% found this document useful (0 votes)
375 views22 pages

Assigment: Hungarian Method

1. The document describes solving an assignment problem using the Hungarian method. It provides examples of both minimizing total cost and maximizing total profit. 2. The key steps of the Hungarian method are to subtract the minimum value in each row and column from the matrix to obtain a reduced cost matrix, then systematically assign zeros to match rows and columns until an optimal solution is reached. 3. The first example minimizes operator assignment time for 5 tasks, with the optimal solution being 25 hours total. The second example maximizes monthly sales for 5 salesmen across 5 districts.

Uploaded by

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

Assigment: Hungarian Method

1. The document describes solving an assignment problem using the Hungarian method. It provides examples of both minimizing total cost and maximizing total profit. 2. The key steps of the Hungarian method are to subtract the minimum value in each row and column from the matrix to obtain a reduced cost matrix, then systematically assign zeros to match rows and columns until an optimal solution is reached. 3. The first example minimizes operator assignment time for 5 tasks, with the optimal solution being 25 hours total. The second example maximizes monthly sales for 5 salesmen across 5 districts.

Uploaded by

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

ADVANCED APPAREL MANUFACTURING MANAGEMENT

ASSIGMENT
Hungarian Method

Harshita Khurana | Shreya Taneja | Varshita Bhadauria

Submitted to: Dr. Ankur Saxena


Assignment
An assignment problem is a particular case of a transportation problem where the given
resources are allocated to an equal number of activities with an aim of either minimizing
total cost, distance, time or maximizing profit.

Objective
- Understand the features of assignment problems and transportation problems.
- Formulate an assignment problem as a square matrix.
- Apply the Hungarian method to solve an assignment problem.
- Make appropriate changes in the Hungarian method to solve an unbalanced
assignment problem, profit maximization assignment problem, etc.

Hungarian Method: Assignment Problem


This method is based on the following principle:

- If a constant is added to, or subtracted from, every element of a row and/or a


column of the given cost matrix of an assignment problem, the resulting
assignment problem has the same optimal solution as the original problem.

Steps in Hungarian Method


1. Identify the minimum element in each row and subtract it from every element of that
row.

2. Identify the minimum element in each column and subtract it from every element of
that column.

3. Make the assignments for the reduced matrix obtained from steps 1 and 2 in the
following way:
i) For each row or column with a single zero value cell that has not be assigned
or eliminated, box that zero value as an assigned cell.

ii) For every zero that becomes assigned, cross out (X) all other zeros in the
same row and the same column.

iii) If for a row and a column, there are two or more zeros and one cannot be
chosen by inspection, then you are at liberty to choose the cell arbitrarily for
assignment.

iv) The above process may be continued until every zero cell is either assigned
or crossed (X).

4. An optimal assignment is found, if the number of assigned cells equals the number of
rows (and columns). In case you have chosen a zero cell arbitrarily, there may be
alternate optimal solutions. If no optimal solution is found, go to step 5.

5. Draw the minimum number of vertical and horizontal lines necessary to cover all the
zeros in the reduced matrix obtained from step 3 by adopting the following procedure:

i) Mark all the rows that do not have assignments.

ii) Mark all the columns (not already marked) which have zeros in the marked
rows.

iii) Mark all the rows (not already marked) that have assignments in marked
columns.

iv) Repeat steps 5 (i) to (iii) until no more rows or columns can be marked.

v) Draw straight lines through all unmarked rows and marked columns.

6. Select the smallest element from all the uncovered elements. Subtract this smallest
element from all the uncovered elements and add it to the elements, which lie at the
intersection of two lines. Thus, we obtain another reduced matrix for fresh assignment.

7. Go to step 3 and repeat the procedure until you arrive at an optimal assignment.
Example 1
Assign the five tasks to five operators. The assigning time is given in Table.

Operator Job
J1 J2 J3 J4 J5

O1 3 6 1 5 4

O2 9 8 5 6 3

O3 10 12 8 7 11

O4 6 9 12 10 15

O5 12 8 7 8 10

Solution
This is a minimization example of assignment problem. Using the Hungarian
Algorithm to solve this problem.

1. We’ll check whether the matrix is balanced or not. Since the number of rows are equal to
number of columns, the matrix is balanced.

2. Identify the minimum element in each row and subtract it from every element of
that row. The result is shown in the following table.
Operator Job
J1 J2 J3 J4 J5

O1 2 5 0 4 3

O2 6 5 2 3 0

O3 3 5 1 0 4

O4 0 3 6 4 9

O5 5 1 0 1 3

3. Identify the minimum element in each column and subtract it from every element
of that column

Operator Job
J1 J2 J3 J4 J5

O1 2 4 0 4 3

O2 6 4 2 3 0

O3 3 4 1 0 4

O4 0 2 6 4 9

O5 5 0 0 1 3
4. Assign the tasks to the operators. Select a row that has a single zero and assign
by squaring it. Strike off remaining zeros if any in that row or column. Repeat the
assignment for other tasks. The final assignment is shown in table below.

Operator Job
J1 J2 J3 J4 J5

O1 2 4 0 4 3

O2 6 4 2 3 0

O3 3 4 1 0 4

O4 0 2 6 4 9

O5 5 0 0 1 3

The total time of assignment = O1J3 + O2J5 + O3J4 + O4J1 + O5J2

Substituting values from original table:


1+3+7+6+8= 25 hours
Example 2
A marketing manager has five salesmen and sales districts. Considering the capabilities
of the salesmen and the nature of districts, the marketing manager estimates that sales
per month (in hundred rupees) for each salesman in each district would be as follows.
Find the assignment of salesmen to districts that will result in maximum sales.

Salesman District
D1 D2 D3 D4 D5

S1 90 105 60 50 65

S2 80 90 110 40 60

S3 40 50 75 55 80

S4 80 85 65 45 50

S5 70 80 85 65 70

Solution
This is a maximization example of assignment problem. Using the Hungarian
Algorithm to solve this problem.

1. This is a maximization problem and has to be converted into a minimization problem by


subtracting all the elements from the largest element of the sales table. The highest
value is 110. So we subtract each value from 110. The conversion is shown in
the following table.
Salesman District
D1 D2 D3 D4 D5

S1 20 5 50 60 45

S2 30 20 0 70 50

S3 70 60 35 55 30

S4 30 25 45 65 60

S5 40 30 25 45 40

2. Identify the minimum element in each row and subtract it from every element of
that row. The result is shown in the following table.

Salesman District
D1 D2 D3 D4 D5

S1 15 0 45 55 40

S2 30 20 0 70 50

S3 40 30 5 25 0

S4 5 0 20 40 35

S5 15 5 0 20 15
3. Identify the minimum element in each column and subtract it from every element
of that column.

Salesman District
D1 D2 D3 D4 D5

S1 10 0 45 35 40

S2 25 20 0 50 50

S3 35 30 5 5 0

S4 0 0 20 20 35

S5 10 5 0 0 15

4. Make the assignments for the reduced matrix obtained from steps 1 and 2 in the
following way:

a. For each row or column with a single zero value cell that has not be
assigned or eliminated, box that zero value as an assigned cell.

b. For every zero that becomes assigned, cross out (X) all other zeros in the
same row and the same column.

c. If for a row and a column, there are two or more zeros and one cannot be
chosen by inspection, choose the cell arbitrarily for assignment.

d. The above process may be continued until every zero cell is either
assigned or crossed (X).
Salesman District
D1 D2 D3 D4 D5

S1 10 0 45 35 40

S2 25 20 0 50 50

S3 35 30 5 5 0

S4 0 0 20 20 35

S5 10 5 0 0 15

Optimum assignment is S1D2+S2D3+S3D5+S4D1+S5D4

i.e., 105 + 110 + 80 + 80 + 65 = 440 (in hundred rupees).

Maximum sales would be Rs 44,000.


Example 3
The Funny Toys Company has four men available for work on four separate jobs. Only
one man can work on any one job. The cost of assigning each man to each job is given
in the following table. The objective is to assign men to jobs in such a way that the total
cost of assignment is minimum.

Person Job
1 2 3 4

A 20 25 22 28

B 15 18 23 17

C 19 17 21 24

D 25 23 24 24

Solution
This is a minimization example of assignment problem. Using the Hungarian
Algorithm to solve this problem.

1. Identify the minimum element in each row and subtract it from every element of
that row. The result is shown in the following table.
Person Job
1 2 3 4

A 0 5 2 8

B 0 3 8 2

C 2 0 4 7

D 2 0 1 1

2. Identify the minimum element in each column and subtract it from every element
of that column.

Person Job
1 2 3 4

A 0 5 1 7

B 0 3 7 1

C 2 0 3 6

D 2 0 0 0
3. Make the assignments for the reduced matrix obtained from steps 1 and 2 in the
following way:

a. For each row or column with a single zero value cell that has not be
assigned or eliminated, box that zero value as an assigned cell.

b. For every zero that becomes assigned, cross out (X) all other zeros in the
same row and the same column.

c. If for a row and a column, there are two or more zeros and one cannot be
chosen by inspection, choose the cell arbitrarily for assignment.

d. The above process may be continued until every zero cell is either
assigned or crossed (X).

4. An optimal assignment is found, if the number of assigned cells equals the


number of rows (and columns). In case you have chosen a zero cell arbitrarily,
there may be alternate optimal solutions. If no optimal solution is found, go to
step 4.

Person Job
1 2 3 4

A 0 5 1 7

B 0 3 7 1

C 2 0 3 6

D 2 0 0 0
5. Draw the minimum number of vertical and horizontal lines necessary to cover all
the zeros in the reduced matrix obtained from step 3 by adopting the following
procedure:

i. Mark all the rows that do not have assignments.

ii. Mark all the columns (not already marked) which have zeros in the marked
rows.

iii. Mark all the rows (not already marked) that have assignments in marked
columns.

iv. Repeat steps 5 (ii) and (iii) until no more rows or columns can be marked.

v. Draw straight lines through all unmarked rows and marked columns.

Person Job
1 2 3 4

A 0 5 1 7

B 0 3 7 1

C 2 0 3 6

D 2 0 0 0

6. Select the smallest element (i.e., 1) from all the uncovered elements. Subtract
this smallest element from all the uncovered elements and add it to the elements,
which lie at the intersection of two lines. Thus, we obtain another reduced matrix
for fresh assignment.
Person Job
1 2 3 4

A 0 4 0 6

B 0 2 6 0

C 3 0 3 6

D 3 0 0 0

Since the number of assignments is equal to the number of rows (& columns), this is
the optimal solution.

The total cost of assignment = A1 + B4 + C2 + D3

Substituting values from original table:


20 + 17 + 17 + 24 = Rs. 78.
Example 4
At the head office of a company there are five registration counters. Five persons
are available for service.
How should the counters be assigned to persons so as to maximize the profit?

Counter Person
A B C D E

1 30 37 40 28 40

2 40 24 27 21 36

3 40 32 33 30 35

4 25 38 40 36 36

5 29 62 41 34 39

Solution
1. This is a maximization problem and has to be converted into a minimization problem by
subtracting all the elements from the largest element of the sales table. The highest
value is 62. So we subtract each value from 62. The conversion is shown in the
following table.
Counter Person
A B C D E

1 32 25 22 34 22

2 22 38 35 41 26

3 22 30 29 30 27

4 37 24 22 26 26

5 33 0 21 28 23

2. Identify the minimum element in each row and subtract it from every element of
that row. The result is shown in the following table.

Counter Person
A B C D E

1 10 3 0 12 0

2 0 16 13 19 4

3 0 8 7 8 5

4 15 2 0 4 4

5 33 0 21 28 23
3. Identify the minimum element in each column and subtract it from every element
of that column.

Counter Person
A B C D E

1 10 3 0 8 0

2 0 16 13 15 4

3 0 8 7 4 5

4 15 2 0 0 4

5 33 0 21 24 23

4. Make the assignments for the reduced matrix obtained from steps 2 and 3 in the
following way:

a. For each row or column with a single zero value cell that has not be
assigned or eliminated, box that zero value as an assigned cell.

b. For every zero that becomes assigned, cross out (X) all other zeros in the
same row and the same column.

c. If for a row and a column, there are two or more zeros and one cannot be
chosen by inspection, choose the cell arbitrarily for assignment.

d. The above process may be continued until every zero cell is either
assigned or crossed (X).
Counter Person
A B C D E

1 10 3 0 8 0

2 0 16 13 15 4

3 0 8 7 4 5

4 15 2 0 0 4

5 33 0 21 24 23

5. Draw the minimum number of vertical and horizontal lines necessary to cover all
the zeros in the reduced matrix.

Counter Person
A B C D E

1 10 3 0 8 0

2 0 16 13 15 4

3 0 8 7 4 5

4 15 2 0 0 4

5 33 0 21 24 23
6. Select the smallest element from all the uncovered elements, i.e., 4. Subtract this
element from all the uncovered elements and add it to the elements, which lie at
the intersection of two lines. Thus, we obtain another reduced matrix for fresh
assignment. Repeating step 4, we obtain a solution which is shown in the
following table.

Counter Person
A B C D E

1 14 3 0 8 0

2 0 12 9 11 0

3 0 4 3 2 1

4 19 2 0 0 4

5 37 0 21 24 23

The total cost of assignment = 1C + 2E + 3A + 4D + 5B

Substituting values from original table:


40 + 36 + 40 + 36 + 62 = 214.
Example 5
A computer centre has four expert programmers and needs to develop four application
programs. The head of the computer centre, estimates the computer time (in minutes) required
by the respective experts to develop the application programs as follows:

Programmers Programs
1 2 3 4

A 120 100 80 90

B 80 90 110 70

C 110 140 120 100

D 90 90 80 90

Find the assignment pattern that minimises the time required to develop the application
programs.

Solution
This is a minimization example of assignment problem. Using the Hungarian
Algorithm to solve this problem.

1. We’ll check whether the matrix is balanced or not. Since the number of rows are equal to
number of columns, the matrix is balanced.

2. Identify the minimum element in each row and subtract it from every element of
that row. The result is shown in the following table.
Programmers Programs
1 2 3 4

A 40 20 0 10

B 10 20 40 0

C 10 40 20 0

D 10 10 0 10

3. Identify the minimum element in each column and subtract it from every element
of that column.

Programmers Programs
1 2 3 4

A 30 10 0 10

B 0 10 40 0

C 0 30 20 0

D 0 0 0 10

The total time taken = A3 + B1 + C4 + D2

80 + 80 + 100 + 90 = 350 min.

You might also like