You are on page 1of 50

Assignment Problem

Assignment Problem

• How to assign the given jobs to some workers on a one-to-


one basis so that the jobs are completed in the least time or
at the least cost.
• How to deal with situations when the number of jobs do not
match with the number of job performers.
• How should the salesmen of a company be assigned to
different sales zones so that the total expected sales are
maximised?
• How to schedule the flights or the bus routes between two
cities so that the layover times for the crew can be
minimised?
Introduction
• It involves assignment of people to projects, jobs to machines,
workers to jobs and teachers to classes etc., while minimizing the
total assignment costs.
• One of the important characteristics of assignment problem is that
only one job (or worker) is assigned to one machine (or project).
• An assignment problem is a special type of linear programming
problem where the objective is to minimize the cost or time of
completing a number of jobs by a number of persons.
• This method was developed by D. Konig, a Hungarian
mathematician and is therefore known as the Hungarian method of
assignment problem.
• In order to use this method, one needs to know only the cost of
making all the possible assignments.
• Each assignment problem has a matrix (table) associated with
it. Normally, the objects (or people) one wishes to assign are
expressed in rows, whereas the columns represent the tasks (or
things) assigned to them.
• The number in the table would then be the costs associated
with each particular assignment.
Application Areas of Assignment Problem
• Though assignment problem finds applicability in various
diverse business situations, we discuss some of its main
application areas:
• In assigning machines to factory orders.
• In assigning sales/marketing people to sales territories.
• In assigning contracts to bidders by systematic bid-evaluation.
• In assigning teachers to classes.
• In assigning accountants to accounts of the clients.
Method for Solving Assignment Prob
• Step 1. Determine the cost table from the given problem.
(i) If the no. of sources is equal to no. of destinations, go to step 3.
(ii) If the no. of sources is not equal to the no. of destination, go to
step2.
• Step 2. Add a dummy source or dummy destination, so that
the cost table becomes a square matrix. The cost entries of the
dummy source/destinations are always zero.
• Step 3. Locate the smallest element in each row of the given
cost matrix and then subtract the same from each element of
the row.
• Step 4. In the reduced matrix obtained in the step 3, locate the
smallest element of each column and then subtract the same
from each element of that column. Each column and row now
have at least one zero.
• Step 5. In the modified matrix obtained in the step 4, search
for the optimal assignment as follows:
(a) Examine the rows successively until a row with a single zero is
found. Enrectangle this row ( )and cross off (X) all other zeros
in its column. Continue in this manner until all the rows have
been taken care of.
(b) Repeat the procedure for each column of the reduced matrix.
(c) If a row and/or column has two or more zeros and one cannot
be chosen by inspection then assign arbitrary any one of these
zeros and cross off all other zeros of that row / column.
(d) Repeat (a) through (c) above successively until the chain of
assigning ( ) or cross (X) ends.
• Step 6. If the number of assignment (􀀀) is equal to n (the
order of the cost matrix), an optimum solution is reached.
If the number of assignment is less than n(the order of the
matrix), go to the next step.
• Step7. Draw the minimum number of horizontal and/or
vertical lines to cover all the zeros of the reduced matrix.
• Step 8. Develop the new revised cost matrix as follows:
(a)Find the smallest element of the reduced matrix not covered by
any of the lines.
(b)Subtract this element from all uncovered elements and add the
same to all the elements laying at the intersection of any two
lines.
• Step 9. Go to step 6 and repeat the procedure until an
optimum solution is attained.
Ex. A production supervisor is considering how he should assign
the four jobs that are to be performed, to four of the workers.
He wants to assign the jobs to the workers such that the
aggregate time to perform the jobs is the least. Based on
previous experience, he has the information on the time taken
by the four workers in performing these jobs, as given in table.

Worker Job

A B C D

1 45 40 51 67

2 57 42 63 55

3 49 52 48 64

4 41 45 60 55
Initial Solution : VAM
Worker Job Supply

A B C D

1 45 [ɛ ] 40 [ɛ ] 51 67 [1] 1

2 57 42 [1] 63 55 1

3 49 [ɛ ] 52 48 [1] 64 1

4 41 [1] 45 60 55 1

Demand 1 1 1 1 4

Total Time : 1 x 67 + 1 x 42 + 1 x 48 + 1 x 41 = 198


Initial Solution : Non-optimal
Worker Job Supply ui

A B C D

1 45 [ɛ ] 40 [ɛ ] 51 67 [1] 1 0

2 57 42 [1] 63 55 1 2

3 49 [ɛ] 52 48 [1] 64 1 4

4 41 [1] 45 60 55 1 - 4

Demand 1 1 1 1 4

vj 45 40 44 67
Initial Solution : Non-optimal

Worker Job Supply ui

A B C D

1 45 [ɛ ] 40 [ɛ ] (-7) 51 67 [1] 1 0

2 (-10) 57 42 [1] (-17) 63 (+14) 55 1 2

3 49 [ɛ ] (-8) 52 48 [1] (+7) 64 1 4

4 41 [1] (-9) 45 (-20) 60 (+8) 55 1 - 4

Demand 1 1 1 1 4

vj 45 40 44 67
Initial Solution : optimal
Worker Job Supply ui

A B C D

1 45 [ɛ ] 40 [1 ] (-7) 51 ( -14) 67 1 0

2 (-10) 57 42 [ɛ] (-17) 63 55 [1] 1 2

3 49 [ɛ ] (-8) 52 48 [1] (-7) 64 1 4

4 41 [1] (-9) 45 (-20) 60 (-6) 55 1 - 4

Demand 1 1 1 1 4

vj 45 40 44 53

Total Time = 1 x 40 + 1 x 55 + 1 x 48 + 1 x 41 = 184


Hungarian Assignment Method (HAM)
Step 1 : Locate the smallest cost element in each row of the cost table. Now
subtract this smallest element from each element in that row. As a result,
there shall be at least one zero in each row of the new table, called the
Reduced cost table.
Step 2: In this reduced cost table obtained, consider each column and locate
the smallest element in it. Subtract the smallest value from every other
entry in the column. As a result, there would be at least one zero in each of
the rows and columns of the second reduced cost table.
Step 3: Draw the minimum number of horizontal and vertical lines that are
required to cover all the ‘Zero’. If the number of lines drawn is equal to n
(the number of rows/columns) the solution is optimal, and proceed to step
6. If the number of lines drawn is smaller than n, go to step 4.
Step 4: Select the smallest uncovered (by the lines) cost element. Subtract
this element from all uncovered elements including itself and add this
element to each value located at the intersection of any two lines.
Step 5: Repeat steps 3 and 4 until an optimal solution is obtained.
Step 6: Make the job assignments to ‘Zero’ elements.
a) Locate a row which contains only one ‘zero’ element. Assign the job
corresponding to this element. Cross out the zeros, if any, in the column
corresponding to the element
b) Repeat (a) for each of such rows which contain only one zero. Similarly,
perform the same operation in respect of each column containing only
one ‘zero’, crossing out the zero, if any, in the row
c) If there is no row or column with only a single ‘Zero’ left, then select a
row/column arbitrarily and choose one of the jobs and make the
assignment. Now cross the remaining zeros in the column and row in
respect of which the assignment is made.
d) Repeat steps (a) through (c) until all assignments are made.
e) Determine the total cost with reference to the original cost table
Ex. Worker Job

A B C D

1 45 40 51 67

2 57 42 63 55

3 49 52 48 64

4 41 45 60 55

Step 1 : Locate the smallest cost element in each row of the


cost table. Now subtract this smallest element from each
element in that row. As a result, there shall be at least one zero
in each row of the new table, called the Reduced cost table.
Step 1
Worker Job

A B C D

1 5 0 11 27

2 15 0 21 13

3 1 4 0 16

4 0 4 19 14

Step 1 : Locate the smallest cost element in each row of the


cost table. Now subtract this smallest element from each
element in that row. As a result, there shall be at least one zero
in each row of the new table, called the Reduced cost table.
Worker Job
A B C D
1 5 0 11 27
2 15 0 21 13
3 1 4 0 16
4 0 4 19 14

Step 2: In this reduced cost table obtained, consider each


column and locate the smallest element in it. Subtract the
smallest value from every other entry in the column. As a
result, there would be at least one zero in each of the rows
and columns of the second reduced cost table.
Step 2
Worker Job

A B C D

1 5 0 11 14

2 15 0 21 0

3 1 4 0 3

4 0 4 19 1

Step 2: In this reduced cost table obtained, consider each


column and locate the smallest element in it. Subtract the
smallest value from every other entry in the column. As a
result, there would be at least one zero in each of the rows
and columns of the second reduced cost table.
Step 3 & 4
Worker Job

A B C D

1 5 0 11 14

2 15 0 21 0

3 1 4 0 3

4 0 4 19 1

Step 3: Draw the minimum number of lines covering all zeros. As a


general , we should first cover those rows/columns which contain larger
number of zeros.
Step 4: Count the number of lines. Which is 4, equal to number of
rows/column, so optimal solution is obtained.
Step 4
Worker Job

A B C D

1 5 0 11 14

2 15 0 21 0

3 1 4 0 3

4 0 4 19 1

Step 4: Make the assignment after scanning the rows and


columns for unit zeros.
Total Time = 40 + 55 + 48 + 41 = 184 minutes
Ex. Using the following cost matrix, determine (a) optimal job
assignment and (b) the cost of assignments.

Machinist Job

1 2 3 4 5

A 10 3 3 2 8

B 9 7 8 2 7

C 7 5 6 2 4

D 3 5 8 2 4

E 9 10 9 6 10
Step 1: Obtain row reduction

Machinist Job

1 2 3 4 5

A 8 1 1 0 6

B 7 5 6 0 5

C 5 3 4 0 2

D 1 3 6 0 2

E 3 4 3 0 4
Step 2: Obtain column reduction

Machinist Job

1 2 3 4 5

A 7 0 0 0 4

B 6 4 5 0 3

C 4 2 3 0 0

D 0 2 5 0 0

E 2 3 2 0 2

Since the number of lines covering all zeros is less than the number of
columns/rows, we have to modify the table
The least of the uncovered cell values is 2. this would be subtracted from each of
the uncovered values and added to each value lying at the intersection of lines.
Step 3:Reduced cost table

Machinist Job

1 2 3 4 5

A 7 0 0 2 6

B 4 2 3 0 3

C 2 0 1 0 0

D 0 2 5 2 2

E 0 1 0 0 2

Number of lines is 5 and number of rows/columns are 5, so


solution is optimal
Step 4:Assignment of Job

Machinist Job

1 2 3 4 5

A 7 0 0 2 6

B 4 2 3 0 3

C 2 0 1 0 0

D 0 2 5 2 2

E 0 1 0 0 2

Total cost associated = 3 + 2 + 4 + 3 + 9 = 21


Examples
• A job 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 such that the total cost of
assignment is minimum.
Step 1
• Identify the minimum element in each row and subtract it
from every element of that row.
Step 2
• Identify the minimum element in each column and subtract it
from every element of that column.
• Make the assignment for the reduced matrix obtain from steps
1 and 2 in the following way:
• Draw the minimum number of vertical and horizontal lines
necessary to cover all the zeros in the reduced matrix obtained
from last step
• 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.
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
Substitute the values from original table: 20 + 17 + 24 + 17 = 78.
Solve the following assignment Problem by Hungarian
assignment method

Worker Job

1 2 3

A 4 2 7

B 8 5 3

C 4 5 6
Step 1 : Obtain Row reduction

Worker Job

1 2 3

A 2 0 5

B 5 2 0

C 0 1 2

Ans. A-2, B-3, C-1, Total Time = 2 + 3 + 4 = 9 Minutes.


ABC company is engaged in manufacturing 5 brands of packed snacks. It has
five manufacturing setups, each capable of manufacturing any of its brands
one at a time. The cost to make a brand on these setups vary according to the
following table.
Machinist Setup

S1 S2 S3 S4 S5

B1 4 6 7 5 11

B2 7 3 6 9 5

B3 8 5 4 6 9

B4 9 12 7 11 10

B5 7 5 9 8 11

Assuming five setups and five brands, find the optimum


assignment of products on these setups resulting in the minimum
cost
Step 1: Obtain row reduction
Machinist Setup

S1 S2 S3 S4 S5

B1 0 2 3 1 7

B2 4 0 3 6 2

B3 4 1 0 2 5

B4 2 5 0 4 3

B5 2 0 4 3 6
Step 2: Obtain column reduction
Machinist Setup

S1 S2 S3 S4 S5

B1 0 2 3 0 5

B2 4 0 3 5 0

B3 4 1 0 1 3

B4 2 5 0 3 1

B5 2 0 4 2 4

Since the number of lines covering all zeros is less than the number of
columns/rows, we have to modify the table
The lest of the uncovered cell values is 1. This would be subtracted from each of
the uncovered values and added to each value lying at the intersection of lines.
Step 3: Reduce cost table
Machinist Setup

S1 S2 S3 S4 S5

B1 0 3 4 0 5

B2 4 1 4 5 0

B3 3 1 0 0 2

B4 1 5 0 2 0

B5 2 0 4 1 3

Since the number of lines covering all zeros is equal to columns/rows, so


solution is optimal
Step 4: Assignment
Machinist Setup

S1 S2 S3 S4 S5

B1 0 3 4 0 5

B2 4 1 4 5 0

B3 3 1 0 0 2

B4 1 5 0 2 0

B5 2 0 4 1 3

Ans: B1-S1, B2-S5, B3-S4, B4-S3, B5-S2, Total cost = 4+5+6+7+5 = 27


Unbalanced assignment Problems

• When number of columns and number of rows are equal, the


problem is balanced problem, and when not, it is called an
unbalanced problem.
• In such situations, dummy column/row, whichever is smaller
in number, are inserted with zeros as the cost elements.
Constrained Assignment problems

• Sometimes a worker cannot perform a certain job or is not to


be assigned a particular job. To cope with this situation, the
cost of performing that job by such person is taken to be
extremely large (M).
Person Job

J1 J2 J3 J4 J5

P1 27 18 X 20 21

P2 31 24 21 12 17

P3 20 17 20 X 16

P4 22 28 20 16 27
Step 1: Reduce row table

Person Job

J1 J2 J3 J4 J5

P1 27 18 M 20 21

P2 31 24 21 12 17

P3 20 17 20 M 16

P4 22 28 20 16 27
P5
0 0 0 0 0
(Dummy)
Step 1: Reduce row/column table

Person Job

J1 J2 J3 J4 J5

P1 9 0 M 2 3

P2 19 12 9 0 5

P3 4 1 4 M 0

P4 6 12 4 0 11
P5
0 0 0 0 0
(Dummy)

Since the number of lines covering all zeros is not equal to columns/rows, so
solution is not optimal
Step 2: Reduce cost table

Person Job

J1 J2 J3 J4 J5

P1 9 0 M 6 3

P2 15 8 5 0 1

P3 4 1 4 M 0

P4 2 8 0 0 7
P5
0 0 0 4 0
(Dummy)

Since the number of lines covering all zeros is equal to columns/rows, so


solution is optimal
Step 3: Assignment

Person Job

J1 J2 J3 J4 J5

P1 9 0 M 6 3

P2 15 8 5 0 1

P3 4 1 4 M 0

P4 2 8 0 0 7
P5
0 0 0 4 0
(Dummy)

Ans: Assignment is P1-J2, P2-J4, P3-J5, P4-J3, J1 would remain


unassigned. Total Cost = 18 + 12 + 16 + 20 = 66
• In the modification of a plant layout of a factory four new machines
M1, M2, M3, and M4 are to be installed in the machine shop. There are
five vacant places A, B, C, D and E available. Because of limited space,
machine M2 cannot be placed at C and M3 cannot be placed at A. The
cost of locating a machine at a place in hundreds of rupees is as under

A B C D E

M1 9 11 15 10 11

M2 12 9 -- 10 9

M3 -- 11 14 11 7

M4 14 8 12 7 8

Find the optimal assignment schedule.


Step 1: Reduce row/column table

A B C D E

M1 0 2 6 1 2

M2 3 0 M 1 0

M3 M 4 7 4 0

M4 7 1 5 0 1

M5
0 0 0 0 0
(dummy)

Since the number of lines covering all zeros is equal to columns/rows, so


solution is optimal
Step 2: Assignment

A B C D E

M1 0 2 6 1 2

M2 3 0 M 1 0

M3 M 4 7 4 0

M4 7 1 5 0 1

M5
0 0 0 0 0
(dummy)

Ans: Assignment is M1-A, M2-B, M3-E, M4-D, Place C will be


unassigned. Total cost in hundreds of rupees = 9+9+7+7=32.

You might also like