You are on page 1of 22

Operations Research Unit 7

Sikkim Manipal University Page No. 132


Unit 7 Assignment Problem
Structure:
7.1 Introduction
Objectives
7.2 Mathematical Formulation of the Problem
7.3 Hungarian Method Algorithm
7.4 Routing Problem
Unbalanced AP
Infeasible assignments
Maximisation in AP
7.5 Travelling Salesman Problem
7.6 Summary
7.7 Glossary
7.8 Terminal Questions
7.9 Answers
7.10 Case Study

7.1 Introduction
In the previous unit we dealt with the formulation of Transportation Problem
(TP), transportation algorithm (MODI method), and the initial basic feasible
solution. We also discussed about how to get the optimum solution. In this
unit, we will deal with assignment problem. The assignment problem is a
special case of transportation problem, where the objective is to minimise
the cost or time of completing a number of jobs by a number of persons, and
to maximise revenue and sales efficiently.
In other words, when the problem involves the allocation of n different
facilities to n different tasks, it is often termed as an assignment problem.
This model is mostly used for planning. The assignment model is useful in
solving problems, such as assignment of machines to jobs, assignment of
salesman to sales territories, travelling salesman problem, and many more
similar situations. It may be noted that with n facilities and n jobs, there
are n possible assignments.
One way of finding an optimal assignment is to write all the n possible
arrangements, evaluate their total cost, and select the assignment model
Operations Research Unit 7
Sikkim Manipal University Page No. 133
offering the minimum cost. This method can be unfeasible due to
involvement of computational procedures. In this unit, we will study an
efficient method for solving assignment problems.
Lets say there are n jobs in a factory having n machines to process the
jobs. A job i (=1 n), when processed by machine j (=1 n) is assumed to
incur a cost C
ij.
The assignment is to be made in such a way that each job
can be associated with one and only one machine. You can then determine
an assignment of jobs to the machines to minimise the overall cost.
The cost data is given as a matrix where rows correspond to jobs and
columns to machines and there are as many rows as the number of
columns. The number of jobs and number of machines should be equal.
Assignment becomes a problem because each job requires different skills
and the capacity or efficiency of each person with respect to these jobs can
be different. This gives rise to cost differences. If each person is able to do
all the jobs with the same efficiency then all costs will be the same and each
job can be assigned to any person. When assignment is a problem it
becomes an optimisation problem. Therefore, you can compare an
assignment problem to a transportation problem. The cost element is given
and is a square matrix and the requirement at each destination is one and
the availability at each origin is also one.
Additionally, you have a number of origins, which equal the number of
destinations. Therefore, the total demand is equal to the total supply. There
is only one assignment in each row and each column. However, if you
compare this to a transportation problem, you will find that a general
transportation problem does not have the above mentioned limitations.
These limitations are peculiar to assignment problems only.
An assignment problem can be either balanced or unbalanced. Lets first
focus on a balanced assignment problem. A balanced assignment problem
is one where the number of rows = the number of columns (comparable to a
balanced transportation problem where total demand =total supply).
Minimisation case for an assignment problem
Figure 7.1 depicts the steps that must be performed to solve the
minimisation case for an assignment problem (AP).

Operations Research Unit 7
Sikkim Manipal University Page No. 134

Fig. 7.1: Steps to Solve the Minimisation Case for an Assignment Problem

Step 1: Determine the total opportunity cost matrix.
a) Arrive at a column opportunity cost matrix by subtracting the lowest entry
of each column of the given payoff matrix from all the entries in the
column.
b) Subtract the lowest entry of each row of the matrix obtained in
(a) from all the entries in its row.
The result of step 1b) gives the total opportunity cost matrix.
Step 2: Determine whether an optimal assignment can be made.
a) Cover all the zeros of the current total opportunity cost matrix with the
minimum possible number of horizontal and vertical lines.
b) If the number of lines in step 2a) equals the number of rows (or
columns) of the matrix, the problem can be solved. Make a complete
assignment so that the total opportunity cost involved in the assignment
is zero.
c) If the number of lines drawn in step 2a) is less than the number of rows
(or columns) of the matrix, proceed to step 3.
Step 3: Revise the total opportunity cost matrix.
a) Subtract the lowest entry in the uncovered cells of the current total
opportunity cost matrix from all the uncovered cells.
b) Add the same lowest entry to only those cells in which the covering lines
of step 2 cross.
Operations Research Unit 7
Sikkim Manipal University Page No. 135
The result of steps 3a) and 3b) is a revised total opportunity cost matrix.
Step 4: Repeat steps 2 and 3 until an optimal assignment having a total
opportunity cost of zero can be made.
Figure 7.2 depicts the various methods used to solve the assignment
problem by any of the following four methods.
- Enumeration method
- Simplex method
- Transportation problem
- Hungarian method
However, in this unit, we will focus on the most commonly used method, that
is the Hungarian method, to solve the assignment problems.


Fig. 7.2: Methods to Solve Assignment Problem

Objectives:
After studying this unit, you should be able to:
- interpret an assignment problem mathematically
- explain a routing problem
- describe the travelling salesman problem
- state the significance of the assignment problem
- compute the problem using the Hungarian method
- explain practical problems, such as routing problems and travelling
salesman problems



Operations Research Unit 7
Sikkim Manipal University Page No. 136
7.2 Mathematical Formulation of the Problem
Let x
ij
be a variable defined by

=
machine j the to assigned is job i the if
machine j the to assigned not is job
x
th th
th
ij
1
th
i the if 0

Since only one job is assigned to each machine, you have

=
n
1 i
x
ij
= 1 and
=
n
1 j
x
ij
= 1
Hence, the total assignment cost is given by
z =
= =
n
1 i
n
1 j
x
ij
c
ij

Thus the assignment problem takes the following mathematical form:
Determine x
ij
0 (i, j =1 n)
Minimise z =

= =
n
1 j
n
1 i
x
ij
c
ij
Subject to the constraints

=
n
1 i

x
ij =
1 j =1, 2, n

And
=
n
1 j
x
ij
= 1 i = 1, 2 n

With x
ij
= 0 or 1

Note: In an assignment problem, if you add a real number to or subtract a
real number from each element of a row or column of the cost matrix, then
the optimum assignment for the modified matrix is also optimum for the
original one.


Operations Research Unit 7
Sikkim Manipal University Page No. 137
Self Assessment Questions
1. In an AP, the constraints are of equality type. (True/False)
2. The number of facilities should be equal to the number of resources.
(True/False)
3. A balanced assignment problem is one where the number of rows the
number of columns. (True/False)

7.3 Hungarian Method Algorithm
Hungarian method algorithm is based on the concept of opportunity cost
and is more efficient in solving assignment problems. The following steps
are adopted to solve an AP using the Hungarian method algorithm.
Step 1: Prepare row ruled matrix by selecting the minimum values for each
row and subtract it from the other elements of the row.
Step 2: Prepare column-reduced matrix by subtracting minimum value of
the column from the other values of that column.
Step 3: Assign zero row-wise if there is only one zero in the row and cross
(X) or cancel other zeros in that column.
Step 4: Assign column wise if there is only one zero in that column and
cross other zeros in that row.
Step 5: Repeat steps 3 and 4 till all zeros are either assigned or crossed. If
the number of assignments is equal to number of rows present, you have
arrived at an optimal solution, if not, proceed to step 6.
Step 6: Mark () the unassigned rows. Look for crossed zero in that row.
Mark the column containing the crossed zero. Look for assigned zero in that
column. Mark the row containing assigned zero. Repeat this process till all
the makings are done.
Step 7: Draw a straight line through unmarked rows and marked column.
The number of straight line drawn will be equal to the number of
assignments made.
Step 8: Examine the uncovered elements. Select the minimum.
- Subtract it from the uncovered elements.
- Add it at the point of intersection of lines.
Operations Research Unit 7
Sikkim Manipal University Page No. 138
- Leave the rest as is.
- Prepare a new table.
Step 9: Repeat steps 3 to 7 till optimum assignment is obtained.
Step 10: Repeat steps 5 to 7 till number of allocations = number of rows.
The assignment algorithm applies the concept of opportunity costs. The cost
of any kind of action or decision consists of the opportunities that are
sacrificed in taking that action.
Example 1
Consider the problem of assigning five jobs to five persons. The
assignment costs are depicted in table 7.1.
Table 7.1: Assignment Costs Table

Determine the optimum assignment schedule.
Solution: Applying Hungarian method
Table 7.2: Row Reduced Matrix (Optimum Assignment Schedule)

Column reduced matrix will be the same as each columns minimum
value is zero. Then you can start assigning the jobs as depicted in table
7.3.
Operations Research Unit 7
Sikkim Manipal University Page No. 139
Table 7.3: Column Reduced Matrix

Since the number of assignments is 5.

Therefore, the optimum assignment schedule is A to 5, B to 1, C to 4,
D to 3, and E to 2.
Self Assessment Questions
4. In Hungarian method, you prepare row-reduced matrix. (True/False)
5. The number of assignments should be equal to the number of rows for
an optimum solution. (True/False)
6. There can be more than one allocation in a row. (True/False)

7.4 Routing Problem
7.4.1 Unbalanced AP
Unbalanced assignment problem is an assignment where the number of
rows is not equal to the number of columns and vice versa. For example,
the number of machines may be more than the number of jobs or the
number of jobs may be more than the number of machines. In such a
situation, you have to introduce dummy rows or columns in the matrix. The
dummy rows or columns will contain all cost elements as zero. This
balances the problem and then you can use Hungarian method to find the
optimal assignment.
Unbalanced assignment problem: No. of rows No. of columns.
Operations Research Unit 7
Sikkim Manipal University Page No. 140
Solved problem 1
Solve the following AP.
Table 7.4: Assignment Operations Table

Solution: Introducing a dummy row and applying Hungarian method,
you have:
Table 7.5: Reduced Matrix

Table 7.6: Optimum Assignment Solution

Hungarian method leads to multiple solutions. Selecting (0
3
, M
2
)
arbitrarily.

Therefore, the optimum assignment schedule is O
1
to M
1
, O
2
to M
3
, O
3

to M
2
, and O
4
to M
4
.


Operations Research Unit 7
Sikkim Manipal University Page No. 141
7.4.2 Infeasible assignments
It is sometimes possible that a particular person is incapable of doing certain
work or a specific job cannot be performed on a particular machine. The
solution of the assignment problem should take into account these
restrictions so that the infeasible assignment can be avoided. This can be
achieved by assigning a very high cost (say or M) to the cells where
assignments are prohibited, thereby, restricting the entry of this pair of job
machine or resource activity into the final solution. After inserting a high
value o at the cell we need to apply Hungarian method to solve the problem.
Solved problem 2
Solve the following A.P.
Table 7.7: Assignment Table

Solution: Introducing o in places having dashes and applying
Hungarian method, you have:
Table 7.8: Assignment Table

Table 7.9: Row-reduced Matrix

Operations Research Unit 7
Sikkim Manipal University Page No. 142
Table 7.10: Column Reduced Matrix


Therefore, the optimum assignment schedule is T
1
to P
1
, T
2
to P
4
, T
3
to
P
2
, and T
4
to P
3
.
7.4.3 Maximisation in AP
Some assignment problems are phrased in terms of maximising the profit or
effectiveness or payoff of an assignment of people to tasks or of jobs to
machines. You cannot apply the Hungarian method to such maximisation
problems. Therefore, you need to reduce it to a minimisation problem.
It is easy to obtain an equivalent minimisation problem by converting every
number in the table to an opportunity loss. To do so, you need to subtract
every value from the highest value of the matrix and then proceed as usual.
You will notice that minimising the opportunity loss produces the same
assignment solution as the original maximisation problem.

Operations Research Unit 7
Sikkim Manipal University Page No. 143
Solved problem 3
Solve the following maximisation assignment problem.
Table 7.11: Assignment Table

Solution: Since it is a maximisation problem, subtract every value from
the maximum value of 90. Thus you have:
Table 7.12: Opportunity Loss Table

Table 7.13: Row Reduced Matrix

Table 7.14: Column Reduced Matrix

Operations Research Unit 7
Sikkim Manipal University Page No. 144

Therefore, the optimum assignment schedule is C
1
to P
2
, C
2
to P
1
, C
3
to
P
3
, and C
4
to P
4
.

Case-let
A tailoring unit has four sewing machines of different makes. Each
machine is capable of stitching all the required designs and patterns.
However, the profit factor differs for each assignment. The unit is looking
at maximising profit.
To do so, the unit needs to carry out an optimal assignment exercise of
assigning the right jobs to the right machines.

Solved problem 4
Five different machines can do any of the required five jobs with
different profits resulting from each assignment as depicted in table
7.15.
Table 7.15: Five Different Machines and Their Jobs

Find out the maximum profit possible through optimal assignment.
Solution: To start with, convert an assignment problem of profit
maximisation type into an assignment problem of cost minimisation type.
To do so, form a new modified matrix by subtracting each entry of the
matrix from the greatest entry 62 of the matrix. Use the resulting matrix
to solve the problem of cost minimisation type.
Operations Research Unit 7
Sikkim Manipal University Page No. 145
Table 7.16: Opportunity Matrix

Now apply the Hungarian method to this problem and get the row and
column reduced matrices as depicted in table 7.17 and 7.18.

Table 7.17: Row Reduction Table 7.18: Column Reduction

Then draw the minimum number of lines to suppress the zeros as
depicted in table 7.19.
Table 7.19: Lines Suppressing Zeros

Here, number of lines drawn N = 4 < number of rows (= 5).
The smallest uncovered entry is 4. Therefore, subtract 4 from all
uncovered entries and add it to all the entries on the intersection of the
lines as depicted in table 7.20.
Operations Research Unit 7
Sikkim Manipal University Page No. 146

Table 7.20: Lines not Suppressing Zeros

Again draw minimum number of lines to cover all the zeros as depicted
in table 7.21.
Table 7.21: Number of Lines = Number of Rows

Here the number of lines drawn N = 5 = number of rows.
Mark the zero entry with that occurs exactly once in a row and cancel
that row or column as depicted in table 7.22.

Table 7.22: Number of Lines Number of Rows

After the above steps, row 2 has zero as the last entry, mark it with .
Now row 1 will have the third entry zero uncovered. Mark it with . So
row 4 will have only one entry in cell (4, 4) with zero. This gives you the
optimal assignment as depicted in table 7.23.
Operations Research Unit 7
Sikkim Manipal University Page No. 147

Table 7.23: Optimum Assignment

Thus, x
13
= x
25
= x
31
= x
44
= x
52
= 1 and rest all x
ij
= 0. The optimal
assignment is depicted in table 7.24.
Table 7.24: Optimal Assignment

Therefore, maximum profit is 214.

Self Assessment Questions
7. In unbalanced AP, the number of rows ________ to number of
columns.
8. Hungarian method cannot be applied directly to _________ problem.
9. If some jobs cannot be assigned to some machines, then it is called
_________ assignment problem.

7.5 Travelling Salesman Problem
Routing problem
Network scheduling is a technique for planning and scheduling of large
projects. It has successfully been applied in transportation and
Operations Research Unit 7
Sikkim Manipal University Page No. 148
communication problems. A typical network problem involves finding route
from one node (origin) to another (destination) between which alternative
paths are available at various stages of the journey. The problem is to select
the route that yields minimum cost. A number of different constraints may be
placed on acceptable routes for instance, not returning to the node passed
or passing through each node just once. These kinds of problems are called
as routing problems.
A wide variety of problems other than routing may be developed in
connection with the construction and utilisation of networks. Here, you are
going to consider the special type of routing problem that occurs frequently
in OR the travelling salesman problem.
Suppose a salesman has to visit n number of cities. He wishes to start from
a particular city, visit each city once, and then return to his starting point.
The objective is to select the sequence to visit the cities in such a way that
his total travelling time is minimised. Starting from a given city, the salesman
will have total of (n-1) different sequences. Further, since the salesman has
to visit all the n number of cities; the optimal solution remains independent
of selection of the starting point.
The problem can be represented as a network where the nodes and arcs
represent the cities and the distance between them respectively. Assume
that in a five city problem, a round trip of the salesman is given by the
following arcs.
(3,1), (1,2), (2,4), (4,5), (5,3)
These arcs in order are the first, second, third, fourth, and fifth directed arcs
for the trip. Generally the k
th
directed arc represents the k
th
leg of the trip that
is on leg k, the salesman travels from city i to city j.
(i, j = 1, 2 n;
j i =
)
To formulate the problem, whose solution will yield the minimum travelling
time, let the variables x
ijk
be defined as:

=
otherwise 0,
j city to i city from directed
th
k if 1, is
ijk
x

Where, i, j, and k are integers that vary between 1 and n.
Operations Research Unit 7
Sikkim Manipal University Page No. 149
Following are the constraints of the problem.
a) Only one directed arc may be assigned to a specific k, thus


j k
x
ijk
= 1 k =1, 2, 3n

j i =

b) Only one other city may be reached from a specific city i, thus


j k
x
ijk
=1, i = 1, 2, n
c) Only one other city can initiate a direct arc to a specified city j, thus

i k
x
ijk
=1, j =1, 2... n
d) Given the k
th
directed arc ends at some specific city j, the (k+1)
th
directed
arc must start at the same city j; thus

i
x
ijk
=

r
x
jr
( k +1) for all j and k.

j i =

j r =

These constraints ensure that the round trip will consist of connected
arcs. The objective function is to minimise
z =

i

j k
d
ij
x
ijk

j i =

Where d
ij
is the distance from city i to city j.

Self Assessment Questions
10. In travelling salesman problem, the objective is to visit each cities
________ __________.
11. Salesman has ________ different sequences if n is the number of
cities to be visited.

7.6 Summary
Let us recapitulate the important concepts discussed in this unit:
- This unit on assignment problems focuses on a special type of
transportation problem, where the objective is to allocate n number of
different facilities to n number of different tasks.
Operations Research Unit 7
Sikkim Manipal University Page No. 150
- Although an assignment problem can be formulated as a linear
programming problem, it is solved by a special method know as
Hungarian method.
- If the number of persons is the same as the number of jobs, the
assignment problem is said to be balanced. The unit also explains the
travelling salesman problem in brief.

7.7 Glossary
Opportunity cost matrix: A cost matrix that depicts the lost opportunity
when allocating resource to activity.

7.8 Terminal Questions
1. Four jobs are to be done on four different machines. The cost in rupees
for producing i
th
on the j
th
machine is given below:
Machines
M
1
M
2
M
3
M
4

J
1
15 11 13 15
J
2
17 12 12 13
J
3
14 15 10 14
J
4
16 13 11 17
Assign the jobs to different machines to minimise the total cost.
2. A marketing manager has 5 salesmen and 5 sales districts. Considering
the capabilities of the salesman and the nature of districts, the marketing
manager estimates that the sales per month (in hundred rupees) for
each salesman in each district would be as follows.
Sales districts
A B C D E
1 32 38 40 28 40
2 40 24 28 21 36
3 41 27 33 30 37
4 22 38 41 36 36
5 29 33 40 35 39
Find the assignment of salesman to districts that will result in maximum
sales.
Job
s
Salesman
Operations Research Unit 7
Sikkim Manipal University Page No. 151
3. In a plant layout, there are five vacant places. The plant orders four
machines to be installed in the vacant places. The cost of installing is as
follows:
M/G A B C D E
M
1
9 11 15 10 11
M
2
12 9 - 10 9
M
3
- 11 14 11 7
M
4
14 8 12 7 8
Find the optimum assignment.
4. Find the assignment that maximises the total sale.
Zone
Sales men 1 2 3 4
M
1
42 35 28 21
M
2
30 25 20 15
M
3
30 25 20 15
M
4
24 20 16 12

7.9 Answers

Self Assessment Questions
1. True
2. True
3. False
4. True
5. True
6. False
7.
8. Maximisation problem
9. Infeasible
10. Only once
11. (n-1)
Terminal Questions
1. The optimum assignment policy is
Job1 to machine 2, Job 2 to machine 4
Operations Research Unit 7
Sikkim Manipal University Page No. 152
Job 3 to machine1, Job 4 to machine 3
And the minimum assignment cost = Rs. (11+13+14+11) = Rs. 49.
Refer 7.3
2. Optimal assignment policy is salesman 1 to district B, 2 to A, 3 to E,
4 to C, and 5 to D. Hence the maximum sales = Rs.
(38+40+37+41+35)

100 = Rs. 19,100. Refer 7.4.3


3. M
1
A
2
; M
2
B; M
3
E; M
4
D Total 38. Refer 7.4.2
4. M
1
1; M
2
2; M
3
3; M
4
4 Total 99. Refer 7.4.3

7.10 Case Study
Move-It Company
The Move-It company has two plants producing fork-lift trucks that are then
shipped to three distribution centres. The production costs are the same at
the two plants, and the cost of shipping for each truck is shown for each
combination of plant and distribution centre:
Distribution Centre
1 2 3
Plant
A Rs. 800 Rs. 700 Rs. 400
B Rs. 600 Rs. 800 Rs. 500
A total of 60 fork-lift trucks are produced and shipped per week. Each plant
can produce and ship any amount up to a maximum of 50 trucks per week,
so there is considerable flexibility on how to divide the total production
between the two plants so as to reduce shipping costs. However, each
distribution centre must receive exactly 20 trucks per week.
Assume that distribution centres 1, 2, and 3 must receive exactly 10, 20,
and 30 units per week respectively. For administrative convenience,
management has decided that a single plant will supply each distribution
centre totally, so that one plant will supply one distribution centre and the
other plant will supply the other two distribution centres. The choice of
assignments of plants to the distribution centres is to be made solely on the
basis of minimising total shipping cost.


Operations Research Unit 7
Sikkim Manipal University Page No. 153
Discussion Questions:
1. Formulate this case as an assignment problem by constructing the
appropriate cost table, including identifying the corresponding assignee
and tasks.
2. Obtain an optimal solution.

References:
- Kapoor V. K. (2005). Operations Research. Sultan Chand and Sons.
- Sharma J. K. (2006). Operations Research. Macmillan India Limited.
- Taha H. Operations Research. Prentice Hall.
- Kanti Swarup & Gupta P. K., & Hira D. S., & Manmohan (2004).
Operation Research. Sultan Chand and Sons.
- Sharma S.C. Operation Research: Simulation and Replacement Theory.