You are on page 1of 32

Assignment Problem

Assignment Problem
An assignment problem seeks to minimize the total cost of assignment of m workers to n
jobs, given that the cost of worker i performing job j is cij
It assumes all workers are assigned one job each to perform
Assignment problems can be formulated as linear programming problems or transportation
problem and solved
• How to assign the given jobs to some workers on one to one basis, when completion time
of performance is given for each combination and it is desired that the jobs are completed
in least time or least cost
• Assignment of people to machines, clerks to various checkout counters, service crew to
different districts, sales man different sales zones etc, minimize time or cost
• How to schedule a flight or bus route between cities, so that the layover time for the crew
can be minimum
Assignment Problem
• Given the order of preference that different managers have for their hotel rooms on its
floors, what pattern of assignment of rooms to the managers will satisfy their
requirements the most ?
• How to deal with situation when the number of jobs do not match with number of job
performers, when some job(s) cannot be given or performed by a particular person?
• In fact, the assignment method works for any problem in which one to one matching is
called for in a given payoffs, where the total payoff is sought to be minimized or
maximized.
There are four methods of solving assignment problems
1. Brute Force method
2. Complete enumeration
3. Transportation method
4. Simplex method and
5. ‘Hungarian method’ (commonly used for solving assignment problems)
Example -1 Travelling Salesman Problem / Brute Force approach
Mr. Iyer is a salesman with Delite Manufacturing company. He wants to visit four cities,
say 1,2,3,and 4 starting with city 1 where he is stationed. The distance between various
cities is given in the table
From To city
City 1 2 3 4
1 - 10 15 20
2 5 - 9 10
3 6 13 - 12
4 8 8 9 -

Mr.Iyer wants to develop a tour through three other cities and return to his home city
in such a way that he has to travel the minimum distance. Note that the distance
between from to a city and back is not the same. ex. from 1-2 and 2-1
Example -1 Travelling Salesman Problem Brute Force approach
From To city
 Follow the best permutation City 1 2 3 4
 Simply iterate through all of them and select the best
one. 1 - 10 15 20
1 2 5 - 9 10
3 6 13 - 12
4 8 8 9 -
2 3 4 1 2

3 4
3 4 2 4
2 3

4 3 4 2
3 2
1 1 1 1 1 1
Example -1 Travelling Salesman Problem Brute Force approach
 Follow the best permutation and combination; From To city
 Simply iterate through all of them and select the best one. City 1 2 3 4
15+25=40
1 - 10 15 20
10+25=35 1 20+23 = 43 2 5 - 9 10
3 6 13 - 12
9+20=29 25 25 9+18=27 4 8 8 9 -
13+18=31
10+15=25 2 3 4 23
12+13=25 8+15=23 1 2

9+6=15
12+8 =20 10+8=18 8+5=13
9+6=15 13+5=18
3 4
3 4 2 4
2 3
8 8 5
6
6 5
4 3 4 2
3 2
1 1 1 1 1 1
Example -1 Travelling Salesman Problem Brute Force approach
 Follow the best permutation and combination; From To city
 Simply iterate through all of them and select the best one. City 1 2 3 4
15+25=40
1 - 10 15 20
10+25=35 1 20+23 = 43 2 5 - 9 10
3 6 13 - 12
9+20=29 25 25 9+18=27 4 8 8 9 -
13+18=31
19+15=25 2 3 4 23
12+13=25 8+15=23 1 2

9+6=15
12+8 =20 10+8=18 8+5=13
9+6=115 13+5=18
3 4
3 4 2 4
2 3
8 8 5
6
6 5
4 3 4 2
shortest route is 1 - 2 – 4 - 3 – 1
3 2 = 35 Km or miles
1 1 1 1 1 1
Example 2
A production supervisor is considering how to assign four jobs that are to be performed
by four workers. Based on previous experience, he has the information on the time taken in
minutes by the four workers in performing these jobs, as given in the 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
He wants to assign the jobs to the workers, such that the aggregate time to perform the jobs is
the least. Help him in assigning the jobs by
a). Complete enumeration method
b). Transportation method
c). Simplex method and (d). Hungarian Method
Solution 1, as complete Enumeration Method
 All possible assignments are listed and the assignment involving the minimum cost (or
maximum profit, if the problem is of the maximization type) is selected
 In case there are more than one assignment patterns involving the same least cost, they
all shall represent optimal solutions – the problem has multiple optima then
 In general for n workers n job problem, there n! number of ways in which the jobs can
be assigned to workers (4! = 4x3x2x1 = 24)

S.No. Assignment Time


1 1A,2B,3C,4D 45+42+48+55 = 190 Worker Job

2 1A,2B,4C,3D 45+42+60+64 = 211 A B C D

3 1A,3B,2C,4D 45+52+63+55 = 215 1 45 40 51 67

4 1A,3B,4C,2D 45+52+60+55 = 212 2 57 42 63 55


5 1A,4B,2C,3D 45+45+63+64 = 217 3 49 52 48 64
- - 4 41 45 60 55
24 4A,3B,2C,1D 41+52+63+67 = 223
Solution 2 - as a transportation problem
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

The optimality condition for transportation problem is m + n – 1 (routes should be


assigned)
Solution 2 - Simples method
Minimise :
Z = 45X11+40X12+51X13+67X14+ 57X21 + 42X22+63X23+55X24+49X31+52X32+48X33+ 64X34 +41X41+45X42
+60X43 +55X44
Worker Job Supply
 Subject to
A B C D
X11+X12+X13+X14 =1 X11+X21+X31+X41 =1 1 45 40 51 67 1
X21+X22+X23+X24 =1 X12+X22+X32+X42 =1 2 57 42 63 55 1
X31+X32+X33+X34 =1 X13+X23+X33+X43 =1 3 49 52 48 64 1
X41+X42+X43+X44 =1 X14+X24+X34+X44 =1
4 41 45 60 55 1
all Xij ‘s = 0 or 1 Demand 1 1 1 1

 In simplex method, variables X1,X2, X3  0

 In assignment problems the decision variables take only one of the two variables
Xi = 0 or Xi =1 ( accordingly as an is made or not made)

It is relatively tedious to solve problems in this format. Thus this approach to the solution is not considered.
Solution 2 - Simples method
Minimise :
Z = 45X11+40X12+51X13+67X14+ 57X21 + 42X22+63X23+55X24+49X31+52X32+48X33+ 64X34 +41X41+45X42
+60X43 +55X44
Worker Job Supply
A B C D
1 45 40 51 67 1
2 57 42 63 55 1
3 49 52 48 64 1
4 41 45 60 55 1
Demand 1 1 1 1
all Xij ‘s = 0 or 1

 In simplex method, variables X1,X2, X3, X4  0

 In assignment problems the decision variables take only one of the two variables
Xi = 0 or Xi =1

It is relatively tedious to solve problems in this format. Thus this approach to the solution is not considered.
Solution 3 - Hungerian method (HAM)
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.
• Subtract this smallest element from each element in that row. As a result there shall be at
least one zero in each row of this new table, called the reduced cost 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
Step 1 – row reduction
Worker Job
A B C D
1 5 0 11 27 - 40
2 15 0 21 13 - 42
3 1 4 0 16 - 48
4 0 4 19 14 - 41
Solution 3 - Hungerian Method (HAM)
Step 2
• In reduced cost table, consider each column and locate the smallest element in it.
• Subtract the smallest value from every other entry in the column. As a consequence of this
action, there would be at least one zero in each of the rows and columns in this 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 1 – row reduction
Worker Job
A B C D
1 5 0 11 27 - 40
2 15 0 21 13 - 42
3 1 4 0 16
- 48
4 0 4 19 14 - 41
Step 2 Column reduction
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

-0 -0 -0 - 13
Step 3
• Scan the rows and assign the job if there is only one zero and cover it with a vertical line
• Scan the columns and assign the if there is only one zero and cover it with horizontal line

• 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

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

Since the number of assignments (lines drawn) is equal to number of rows 4 = n


optimal solution is obtained, then proceed to Step 6
Step 6
• Given the optimal solution, make the job assignment as indicated by the ‘zero’ element.
a) Locate a row which contains only one ‘zero’ element. Assign the job corresponding to
this element to its corresponding person.
• cross out the zeros, if any, in the column corresponding to the element, which is
indicative of the fact that the particular job and person are no more available.

b). Repeat (a) for each of such rows which contain only one zero.
• Perform the same operation in respect of each column containing only one ‘zero’
element, crossing out the zero’s if any in the row in which the element lies.

c). If there is no row or column with only a single ‘zero’ element left, then select a row /
column arbitrarily and chose one of the jobs (or persons) and make the assignment .
• Now cross the remaining zeros in and column and row in respect of which the
assignment is made.

d). Repeat steps (a) through (c) until all assignment are made
e). Determine the total cost with reference to the original cost table
Step 3 row scanning and column scanning
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

For optimality number of assignments (lines drawn) should be equal to number of rows
n=4
Worker Job
The final pattern of assignment is
A B C D
1B 2D 3C 4A
1 45 40 51 67
= 40 + 55 + 48 + 41 = 184 minutes
2 57 42 63 55
3 49 52 48 64
4 41 45 60 55
• If the number of lines drawn is smaller than ‘n’ go to step 4

Step 4
• Select smallest uncovered (by the line) 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.
• The cost element through which only one line passes remain unaltered.

Step 5
• Repeat steps 3 and 4 until an optimal solution is obtained then go to Step 6
Example -3
A production manager wants to assign one job each to minimize the total time taken in
hours to complete the jobs. Solve his problem using Hungarian method.

Worker Job
A B C D E
1 9 11 14 11 7
2 6 15 13 13 10
3 12 13 6 8 8
4 11 9 10 12 9
5 7 12 14 10 14
Example -3 LCM
A production manager wants to assign one job each to minimize the total time taken in
hours to complete the jobs. Solve his problem using Hungarian method.
Worker Job
A B C D E
1 9 11 14 11 7
2 6 15 13 13 10
3 12 13 6 8 8
4 11 9 10 12 9
5 7 12 14 10 14
LCM : 2A = 6
3C = 6
1E =7
4B = 9
5D = 10

38 Mins
Step 1 – row reduction
Worker Job
A B C D E
1 9 11 14 11 7 7

2 6 15 13 13 10 6
3 12 13 6 8 8 6
4 11 9 10 12 9 9
5 7 12 14 10 14 7

Worker Job

A B C D E
1 2 4 7 4 0
2 0 9 7 7 4
3 6 7 0 2 2
4 2 0 1 3 0
5 0 5 7 3 7
Step 2 – column reduction
Worker Job
A B C D E
1 2 4 7 4 0
2 0 9 7 7 4
3 6 7 0 2 2
4 2 0 1 3 0
0 5 7 3 7
0 0 0 2 0

Worker Job
A B C D E
1 2 4 7 2 0
2 0 9 7 5 4
3 6 7 0 0 2
4 2 0 1 1 0
5 0 5 7 1 7
Step 3 – row and column scanning
Worker Job
A B C D E
1 2 4 7 2 0
2 0 9 7 5 4
3 6 7 0 0 2
4 2 0 1 1 0
5 0 5 7 1 7

For optimality number of assignments (lines drawn) should be equal to number of


rows n =5
1. If optimality is not obtained
2. Identify the minimum value of un deleted cell, that is 1 in this case
3. Add undeleted cell’s minimum value at the intersection points
4. subtract this value from all the undeleted cell values
5. Keep the other values same
6. Go to step 1 i.e row scanning and column scanning
Step 4 – Revise the intersection and un assigned cell values Step 4
a) Select smallest
Worker Job uncovered (by the
A B C D E line) cost element.
1 2 4 7 2 0 b) Subtract this
2 0 9 7 5 4 element from all
3 6 7 0 0 2 uncovered
4 2 0 1 1 0 elements including
5 0 5 7 1 7 itself and
c) add this element to
Worker Job each value located
A B C D E at the intersection
1 2 4 6 1 0 of any two lines.
2 0 9 6 4 4 d) The cost element
3 7 8 0 0 3 through which
4 2 0 0 0 0
only one line
passes remain
0 5 6 0 7
unaltered.
Repeat Steps 1,2 and 3
Worker Job
A B C D E
1 2 4 6 1 0
2 0 9 6 4 4
3 7 8 0 0 3
4 2 0 0 0 0
5 0 5 6 0 7
For optimality number of assignments (lines drawn) should be equal to number of rows n =5
optimality is obtained

Assign worker Job Time


1 E 7
2 A 6
3 C 6
4 B 9
5 D 10
Total time = 38 hours
Example – 4 unbalanced problem with restriction on allotment
Following tables give the cost of performing different jobs by different workers.
Job-person marking X indicates that the individual cannot perform that particular
job. using this information find
(i) optimal assignment of job and
(ii) cost of the total assignment

Worker Job
A B C D E
1 27 18 X 20 21
2 31 24 21 12 17
3 20 17 20 X 16
4 22 28 20 16 27
Reduced cost (row and column reduction)
Worker Job
A B C D E
1 27 18 M 20 21
2 31 24 21 12 17
3 20 17 20 M 16
4 22 28 20 16 27
5 0 0 0 0 0
1. Balance the problem and assign high costs for the jobs which can’t be done by the worker
Worker Job
A B C D E
1 9 0 M 2 3 18

2 19 12 9 0 5 12

3 4 1 4 M 0 16
4 6 12 4 0 11 16
5 0 0 0 0 0
Scan the rows and columns
Worker Job
A B C D E
1 9 0 M 2 3
2 19 12 9 0 5
3 4 1 4 M 0
4 6 12 4 0 11
5 0 0 0 0 0

For optimality number of assignments (lines drawn) should be equal to number of rows n =5

1. If optimality is not obtained


2. Identify the minimum value of un deleted cell, that is 4 in this case
3. Add undeleted cell’s minimum value at the intersection points
4. subtract this value from all the undeleted cell values
5. Keep the other values same
6. Go to step 1 i.e row scanning and column scanning
Scan the rows and columns
Worker Job
A B C D E
1 9 0 M 2 3
2 19 12 9 0 5
3 4 1 4 M 0
4 6 12 4 0 11
5 0 0 0 0 0

Worker Job
A B C D E
1 5 0 M 2 3
2 15 12 5 0 5
3 0 1 0 M 0
4 2 12 0 0 11
5 0 4 0 4 4
Scan the rows and columns
Worker Job
A B C D E
1 5 0 M 2 3
2 14 12 5 0 5
3 0 1 0 M 0
4 2 12 0 0 11
5 0 4 0 4 4

For optimality number of assignments (lines drawn) should be equal to number of rows n =5
optimality is obtained

Assign worker Job Time


1 B 18
2 D 12
3 E 16
4 C 20
5 A 0
Total time = 66 hours

You might also like