0% found this document useful (0 votes)
97 views19 pages

LPP Vle

Uploaded by

creative daily
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)
97 views19 pages

LPP Vle

Uploaded by

creative daily
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/ 19

Assignment Problems

Subject: Linear Programming


Semester-V
Lesson: Assignment Problems

Lesson Developer: Dr. Lakshmisree Bandopadhyaya


College/Department: Deshbandhu College,
University of Delhi

Institute of Life Long Learning 1


Assignment Problems

Table of Contents

Introduction............................................................................. 3
HUNGARIAN METHOD FOR SOLVING ASSIGNMENT PROBLEMS ...... 5
Variations of Assignment Problems ........................................... 14
1. Negative cost............................................................... 14
2. Maximisation Problem ................................................... 14
3. Impossible Assignment ................................................. 15
4. Unbalanced Assignment Problem .................................... 15
Exercises ............................................................................... 17
References ............................................................................ 19
Suggested Readings ............................................................... 19

Institute of Life Long Learning 2


Assignment Problems

Introduction

In all practical situations manager has to delegate jobs to men or machine to run
his project. Such problems come under the category of Assignment problems.
These problems are similar to Transportation Problems which help us to find the
minimum cost of assigning n jobs to n facilities. Variety of problems come under
this category. For example assigning n periods to n teachers, n beds to n
patients, n horses to n riders at a minimum cost.

Mathematical formulation of such problems are done as follows:


th
Define xij = 1, if ith job is assigned to jth machine and xij = 0 if i job is not
assigned to jth machine. cij be the total cost of assigning ith job to jth machine,
then the mathematical formulation of an assignment problem is:

n n
Minimize C = ∑ ∑
=i 1=j 1
cij xij

n
Subject to ∑=
x
j =1
ij 1 ∀
= i 1, 2,...., n


i =1
xij 1
= ∀=j 1, 2,...., n

xij = 0, 1

We see that it is a kind of transportation problem with 2n constraints, having


each of the column sum and row sum as unity. Because of this nature it is not
desirable to solve by method of solving Transportation Problems, for the process
ends up with many many iterations.

Before we go over to the efficient method of solving such problems we


note the following properties of Assignment problems.
n n
(a) In an assignment problem the total cost C = ∑ ∑
=i 1=j 1
cij xij ≥ 0. Hence
n n
xij = xij* , such that ∑ ∑
=i 1=j 1
cij xij* = 0 is an optimal solution. So we know

every Assignment Problem has a solution.


(b) The optimal solution to assignment problem remain unaltered if we add or
subtract any constant to the costs incurred in the assignments. This result
has helped in finding efficient method, known as Hungarian method of
solving cost-minimisation Assignment Problems.

The proof of this result is given in following theorem.

Theorem 1: If [cij ] is the cost-matrix for an Assignment Problem and


[cij = cij ± ai ± bj ] is the cost-matrix of another Assignment Problem, the optimal
assignment of the two problems remain the same.

Institute of Life Long Learning 3


Assignment Problems

Proof: The two given assignment problems are

n n
(P1) min C = ∑ ∑
=i 1=j 1
cij xij

n
subject to ∑=
x
j =1
ij 1, ∀ i 1, 2,....n
=

∑=
x
i =1
ij 1, ∀ j 1, 2,....n
=

xij 0,1
= i, j 1,....n
∀=

n n
(P2) min C = ∑ ∑
=i 1=j 1
cij xij

n
subject to ∑=
x
j =1
ij 1, ∀ i 1, 2,....n
=

∑=
x
i =1
ij 1, ∀ j 1, 2,....n
=

xij 0,1
= i, j 1,....n
∀=

where cij = cij ± ai ± bj 1,....n .


∀ i, j =

Firstly we observe that the constraints of the two problems are same and hence
any feasible solution of one is also feasible solution of the other.

Also corresponding to any common feasible solution, the value of the total
cost differ by a constraint, which can be seen as follows:

If {xij }i , j =1,....n is a common feasible solution of (P1) and (P2)

n n
C = ∑ ∑
=i 1=j 1
cij xij

n n
= ∑ ∑
=i 1=j 1
(cij ± ai ± bj )xij

n n n n n n
= ∑ ∑
=i 1=j 1
cij xij ± ∑ ∑
=i 1=j 1
ai xij ± ∑ ∑
=i 1=j 1
bj xij

n
 n  n n
C ± ∑ ai  ∑ xij  ± ∑ bj ∑ xij
=
=i 1 = j 1  j 1=i 1
=

n n
C ± ∑ ai .1 ± ∑ bj
=
=i 1=j 1

Institute of Life Long Learning 4


Assignment Problems

n
( In a finite summation, order of summation can be interchanged and ∑
i =1
xij = 1
n
and ∑
j =1
xij = 1 )

=C+K
n n
± ∑ ai ± ∑ bj
where K =
=i 1=j 1

Thus C and C differ by a constant, corresponding to a common solution.

Now to prove the theorem, consider any optimal solution of (P1), say
*
{x }i , j ±1,...n with optimal cost C * say.
ij

Obviously {xij* } is a feasible solution of (P2) with corresponding cost C *


say.

We claim that {xij* } is also an optimal solution of (P2), for if not, then
there exists a feasible solution {xij } of (P2) with corresponding cost C < C * .

Now {xij }i , j =1,....n is also a feasible solution of (P1) with corresponding cost
Ĉ say

Using (1), we have

ˆ+K
C= C

*
Also C= C* + K

ˆ + K < C* + K
C < C* ⇒ C

⇒ Ĉ < C *

Thus we arrive at a contradiction to the fact that C* is the optimal cost for the
problem (P1).

Hence our assumption that {xij* }i , j =1,....n is not optimal for (P2) is wrong.
Thus, any optimal solution of (P1) is also optimal for (P2).

Similarly, it can be shown that any optimal solution of (P2) is also optimal
for (P1).

HUNGARIAN METHOD FOR SOLVING ASSIGNMENT PROBLEMS


Consider an n × n assignment problem.

Step I. Subtract the minimum cost of each row from each entry of the
corresponding row and modify the table. Again subtract the minimum of

Institute of Life Long Learning 5


Assignment Problems

each column from each cost entry of the corresponding column. Modify
the cost-matrix.

Step II. We cover the zeros with minimum number of horizontal and vertical
lines. What should be the minimum number of such lines, is decided as
follows:

(a) Search for a row with a single zero, encircle it and cross out the
zeros in the corresponding column. Repeat the procedure until there
is no row with a single zero. If there are still more zeros then go to
(b).
(b) Search for a column with a single zero, encircle it and cross-out the
zeros in the corresponding row. Repeat this process until there is no
column with a single zero. If there are still more zeros then repeat
(a) and (b). Now if there are still more zeros and no row or no
column with a single zero, then go to (c).
(c) Search for a row with a double zero, encircle the first zero and
cross-out the zeros in the corresponding row and column both. If
there are still more zeros then repeat (a), (b) and if necessary (c)
until all the zeros are either crossed out or encircled.

The number of circled zeros is the minimum number of horizontal and


vertical lines. Now every row or column contains atleast one circle or
cross. We first draw horizontal or vertical lines on rows or columns with
maximum number of both circled and crossed zeros and then the lines
covering all the zeros, keeping in mind that number of lines should be
minimum.

Step III. If the number of lines is n1 = n, the optimal assignment is achieved.


The circled cells give the optimal assignment and then adding the costs
corresponding to the circled cells from the original table, we get the
optimal cost of assignment. Again if n1 < n, we proceed to step IV.

Step IV. See the minimum of uncovered costs and subtract it from all the
uncovered costs and add the same at the intersection of horizontal and
vertical lines. We modify the table and apply step II. if n2 < n, we
repeat step IV and go on repeating steps II and IV until the number of
horizontal and vertical lines nk = n. Then step III gives the optimal
assignment and optimal cost. Following are some examples solved by
Hungarian method.

Institute of Life Long Learning 6


Assignment Problems

Example 2. Find the optimal assignment for a problem with following cost
matrix.

I II III IV V
A 8 4 2 6 1
B 0 9 5 5 4
C 3 8 9 2 6
D 4 3 1 0 3
E 9 5 8 9 5

Subtract the row minima from each row and modify the table

I II III IV V
A 7 3 1 5 0
B 0 9 5 5 4
C 1 6 7 0 4
D 4 3 1 0 3
E 4 0 3 4 0

Subtract the column minima from each column and modify the table

I II III IV V
7 3 0 5 0
0 9 4 5 4
1 6 6 0 4
4 3 0 0 3
4 0 2 4 0

Now to cover the zeros with minimum number of horizontal and vertical lines.

To know the minimum number of such lines, we identify the first row
with single zero, i.e. the second row, encircle the zero and cross-out the zeros in
the corresponding column, if there are any. Then the 3rd row is with a single zero,
encircle it and cross-out the zeros in the corresponding column. Again fourth row
is with a single zero, encircle it and cross out the zeros in the corresponding
column. Then the first row is with a single zero, encircle it and cross out the zeros
in the corresponding column and then the fifth row is with a single zero encircle it
and now there are no more zeros. Minimum number of lines to cover the zeros

= Number of encircled zeros = five = Number of rows and columns of the given
problem. Hence optimal solution is achieved. For the optimal assignment follow
the circled cells in the above tale.

Institute of Life Long Learning 7


Assignment Problems

So optimal assignment is

A→V

B→I

C → IV

D → III

E → II

Now go over to the original table to see the cost of the above assignment.

1+0+2+1+5=9

EXAMPLE 3 Five men are available to do five different jobs. From past records
the time that each man takes to do each job is known and is given in the
following table:

J1 J2 J3 J4 J5
I 2 9 2 7 1
II 6 8 7 6 1
III 4 6 5 3 1
IV 4 2 7 3 1
IV 5 3 9 5 1

Find how the men should be assigned to finish all the jobs in minimum
time.

Solution: We apply Hungarian method to solve.

Step I. Subtract the row-minima from each row and modify the table.

1 8 1 6 0
5 7 6 5 0
3 5 4 2 0
3 1 6 2 0
4 2 8 4 0

Now subtract the column minima from each column and modify the
table.

0 7 0 4 0
4 6 5 3 0
2 4 3 0 0

Institute of Life Long Learning 8


Assignment Problems

2 0 5 0 0
3 1 2 2 0

Step II We cover the zeros with minimum number of horizontal and vertical
lines and this minimum number is determined as follows:

Search for a row with a single zero, encircle it and cross-out the zeros
in the corresponding column. Continue this until there is no row with a single
zero. But there are still more zeros, so search for a column with a single zero,
encircle it and cross-out the zeros in the corresponding row.

Now there are no more zeros left. We see that number of encircled
zeros is four. So minimum number of lines covering all the zeros is n1 = 4 < 5 =
Total number of rows and columns of the problem.

So we proceed to next step.

See the minimum of the uncovered elements which is 2. Subtract '2'


from the uncovered elements and add the same at the intersection of rows and
columns and again apply step II.

0 9 0 6 2
2 6 3 3 0
0 4 1 0 0
0 0 3 0 0
1 1 5 2 0

We see that n2 = 4 < 5. Again proceed to the next step. Subtract the
minimum of the uncovered elements i.e. '1' from the uncovered elements and
add the same at the intersection of horizontal and vertical lines and again apply
step II.

0 9 0 6 3
1 5 2 2 0
0 4 1 0 1
0 0 3 0 1
0 0 4 1 0

While applying step II, at a certain stage there is no row with a single zero and no
column with a single zero, so we see that the 3rd row is the first row with double
zero, we encircle the first zero and cross out the zeros in corresponding row and
column both. And then again apply step II until all the zeros are encircled or
crossed off
Now the number of lines n3 = 5 ∴ optimal assignment is reached.

Institute of Life Long Learning 9


Assignment Problems

Following the circled cells in the above table the optimal assignment is
I → J3
II → J5
III → J1
IV → J4
V → J2
and minimum cost = 2 + 1 + 4 + 3 + 3 = 13.
Example 4
Solve the following cost minimizing assignment problem:

Machine
I II III IV V VI
A 5 4 7 9 1 2
B 3 8 5 4 9 6
Job

C 2 8 1 9 7 5
D 8 6 5 7 9 3
E 7 4 9 8 3 5
F 5 6 8 7 4 9

Solution We apply Hungarian method to solve.

Step I: Subtract the row minima from each row and modify the table

I II III IV V VI
A 4 3 6 8 0 1
B 0 5 2 1 6 3
C 1 7 0 8 6 4
D 5 3 2 4 6 0
E 4 1 6 5 0 2
F 1 2 4 3 0 5

Subtract the column minima from each column and modify the table. Only the 2nd
and 4th columns get changed and all others remain unchanged as their
corresponding minima are zero. . So the modified table is as follows:

I II III IV V VI
A 4 2 6 7 0 1
B 0 4 2 0 6 3
C 1 6 0 7 6 4
D 5 2 2 3 6 0

Institute of Life Long Learning 10


Assignment Problems

E 4 0 6 4 0 2
F 1 1 4 2 0 5

Now we cover the zeros with minimum number of horizontal and vertical lines.
This minimum number is determined as follows: Search for a row with a single
zero, Ist row is with single zero encircle it and cross out the zeros in the
corresponding column V. Now 3rd row is will single zero, encircle it and there is no
zero in the corresponding column III. Now 4th row is with single zero, encircle it
and there is no zero in the corresponding column VI. Again tth row is with single
zero, encircle it and there is no zero in the corresponding column II. Now as there
is no row with a single zero, we identify the 1st column with a single zero and
cross out the zeros ion the corresponding row (2rnd row). Now all the zeros are
either encircled or crossed and number of circled cells is 5
∴ n1 =5 < 6 (the number of rows and columns of given problem).

∴ We proceed to step IV of the Hungarian method.


Subtract the minimum of the uncovered elements, which is '1'
from all the uncovered elements and add the same at the intersection of
horizontal and vertical lines
I II III IV V VI
A 3 2 6 6 0 1
B 0 5 3 0 7 4
C 0 6 0 6 6 4
D 4 2 2 2 6 0
E 3 0 6 3 0 2
F 0 1 4 1 0 5

Following the same method as above we see that the minimum number of lines
covering the zeros in n2 = 6 = number of rows and columns of the given problem.

∴ Optimal Assignment is reached and optimal assignment is obtained at the


circled cells of the above tale, i.e.

A → V

B → IV

C → III

D → VI

E → II

F → I

We go over to the original table to see the corresponding cost of assignment and
optimal cost is 1 + 4 + 1 + 3 + 4 + 5 = 18.

Institute of Life Long Learning 11


Assignment Problems

EXAMPLE 5 A team of 5 horses and 5 riders has enter3ed a show contest. The
number of penalty points to be expected when each rider rides any horse is
shown as follows:

R1 R2 R3 R4 R5
H1 5 3 4 7 1
H2 2 3 7 6 5
H3 4 1 5 2 4
H4 6 8 1 2 3
H5 4 2 5 7 1

How should the horses be allotted to the riders so as to minimise expected loss of
the team?

Solution: We apply Hungarian method to solve.

Step I Subtract the row minima from each row and modify the table.

R1 R2 R3 R4 R5
H1 4 2 3 6 0
H2 0 1 5 4 3
H3 3 0 4 1 3
H4 5 7 0 1 2
H5 3 1 4 6 0

Now subtract the column minima from each column and modify the table.

R1 R2 R3 R4 R5
H1 4 2 3 5 0
H2 0 1 5 3 3
H3 3 0 4 0 3
H4 5 7 0 0 2
H5 3 1 4 5 0

Following the method for finding the minimum number of lines, we have four
encircled zeros, therefore n1 =4 < 5 (the total number of rows and columns).

∴ We go over to step IV.

Subtract the minima of the uncovered elements from the uncovered elements and
add the same at the intersection of horizontal and vertical lines. So the modified
table is as follows:

Institute of Life Long Learning 12


Assignment Problems

R1 R2 R3 R4 R5
H1 4 1 2 4 0
H2 0 0 4 2 3
H3 4 0 4 0 4
H4 6 7 0 0 3
H5 3 0 3 4 0

Again following the method of covering the zeros with minimum number of
horizontal and vertical lines, we see that

n2= 5= the number of rows and columns.

∴ Optimal Assignment is reached and optimal Assignment is

H1 → R5

H2 → R1

H3 → R4

H4 → R3

H5 → R2

and the total loss to the team is obtained by adding the penalty points in the
original table corresponding to the circled cells of last table.

Total loss = 1 + 2 + 2 + 1 + 2 = 8 penalty points.

Example 6 Solve the following profit maximisation assignment problem

I II III
A 3 4 6
B 7 5 8
C 2 6 9

Solution: Highest cost is '9'. Convert the problem to a minimisation problem by


subtracting all the entries from '9'.

I II III
A 6 5 3
B 2 4 1
C 7 3 0

Institute of Life Long Learning 13


Assignment Problems

Apply Hungairan method. Subtract 3 for 1st row, '1' from 2nd row and '0' from 3rd
row.

3 2 0
1 3 0
7 3 0

Now subtract '1' from 1st column, '2' from 2nd column and '0' from 3rd column.

2 0 0
0 1 0
6 1 0

Minimum number of lines covering all the zeros is three, which is the number of
rows and columns of the given problem.

∴ Optimal assignment is

A → II

B → I

C → III

Optimal profit = 4 + 7 + 9 = 20

Variations of Assignment Problems


1. Negative cost

Solve the cost-minimisation assignment problem

2 6 7
3 −5 8
10 −2 4

Solution: Here we add '5' to each cell, so that there is no cell left with −ve cost.
Without loss of generally we can do so for the optimal assignment remains
unaltered when we add constant to any row or column. Then we solve by
Hungarian method and optimal cost is obtained by adding the costs in the original
table corresponding to the circled cells of optimal table.

2. Maximisation Problem

Institute of Life Long Learning 14


Assignment Problems

In this case we subtract all the cost entries from the maximum cost of the table
and the convert it into minimisation problem and then solve by Hungarian
method. Finally the optimal objective function value is found by adding all the
costs of the original table corresponding to the circled cells of the optimal table.

3. Impossible Assignment

Solve the following cost minimisation problem.

J1 J2 J3
M1 2 4 5
M2 9 − 6
M3 8 7 −

Here it is impossible to assign M2 to J2 and M3 to J3.

In such a case we assign a very high cost compared to the given costs
of the table. So here we assign cost '10' to the impossible cells and then solve by
Hungarian method. As it is a minimisation problem, the method takes care that
the optimal assignment does not occur in the impossible cells.

4. Unbalanced Assignment Problem

If the problem is m×n type (m < n), then we make it balanced problem by adding
n − m dummy rows with zero cost in all the cells of the rows and then solve by
Hungarian method.

Again if n < m, we introduce m − n dummy columns with zero cost in all


the dummy cells and then solve by Hungarian method

EXAMPLE 7 Find the minimum cost solution for the assignment problem, where
cost co-efficients are as given below:

I II III IV
1 4 5 3 2
2 1 4 −2 3
3 4 2 1 −5
Solution: We see that the above problem is with −ve cost as well as an
unbalanced one.

We first add '5' to each entry, so that the cost co-efficient are all non-
negative, so that the table becomes

9 10 8 7
6 9 3 8

Institute of Life Long Learning 15


Assignment Problems

9 7 6 0

Now we make it a balanced one by introducing a dummy row with zero cost in all
the dummy cells

9 10 8 7
6 9 3 8
9 7 6 0
0 0 0 0

Now subtract row minima from each row and modify the table.

2 3 1 0
3 6 0 5
9 7 6 0
0 0 0 0

Subtracting column minima from each column, the table remains the same. Now
to cover the zeros with minimum number of horizontal and vertical lines.Now
apply steps II and IV.

2 3 1 0
3 6 0 5
9 7 6 0
0 0 0 0

n2 = 3 < 4, so we go over the step IV

0 1 1 0
1 4 0 5
7 5 6 0
0 0 2 2

n2 = 4 = No. of rows and columns

∴ Optimal assignment is

1 → I

2 → III

Institute of Life Long Learning 16


Assignment Problems

3 → IV

4 → II

and optimal cost is

4 + (−2) + (−5) = −3.

Exercises

1. Six men are available for six different jobs. From past records, the time in
hours taken by different persons for different jobs are given below

Jobs 1 2 3 4 5 6
Men
A 2 9 2 7 9 1
B 6 8 7 6 14 1
C 4 6 5 3 8 1
D 4 2 7 3 10 1
E 5 3 9 5 12 1
F 9 8 12 13 9 1

Find out an allocation of men to different jobs, which will lead to minimum
operation time.

Ans. : A→3 B→6 C → 11 D→4 E → 12

E→2 F→5

Min. time = 22 hours

2. A car rental company has one car available at each of its five locations. There
are five customers located in five different cities who requires a each. The
rental payment to the company will begin after customer has received the car.
All the cars of same make and model so that the customer has no preference.
The distance in miles from each car location to each customer are given in
table below. The company would like to assign the cars to the customers in
such a way as to minimise the total distance concerned by the cars before the
cars are delivered to the customers.

Jobs 1 2 3 4 5

Institute of Life Long Learning 17


Assignment Problems

Men
A 160 130 175 190 200
B 135 120 130 100 175
C 140 110 155 170 185
D 50 50 80 80 110
E 55 35 70 80 105
Ans. A → 5, B → 3, C → 2 D → 1, E → 4,. Total Miles : 570.

3. Three persons are being considered for 3 open positions. Each person has
been given a rating fo each position as shown in the following table.

I II III
1 7 5 6
2 8 4 7
3 9 6 4

Assign each person to one any only one position in such a way that the sum of
ratings for all 3 persons is maximum.

Ans. 1 → II, 2 → III, 3 → I. Maximum sum of ratings : 21

4. Consider the problem of assigning 5 operators to 5 machines. The assignment


costs ion rupees are given in the table. Operator B can't be assigned to
machine 2 and operator E cannot be assigned to machine 4. Find the optimal
cost of assignment.

1 2 3 4 5
A 8 4 2 6 1
B 0 − 5 5 4
C 3 8 9 2 6
D 4 3 1 0 3
E 9 5 8 − 5
Ans. : A → 5, B → 1, C → 4, D → 3, E → 2, Min. cost = 9

5. A department head has 4 tasks to be performed and three sub-ordinates. The


sub-ordinates differ in efficiency. The estimate of the time, each sub-ordinate
would take to perform, is given below in the matrix. How should be allocate
the task, one to each man, so as to minimise the total man-hour.

1 2 3

Institute of Life Long Learning 18


Assignment Problems

I 9 26 15
II 13 27 6
III 35 20 15
IV 18 30 20
Ans. Tak I → M1, Task II → M3; Task III → M2. Total time : 35 hours.

6. Find the minimum cost solution of the following assignment problem, whose
cost coefficients are as given below:

I II III IV
1 4 5 3 2
2 1 4 −2 3
3 4 2 1 −5
Ans. : 1 → I, 2 → III, 3 → IV, Minimum cost = 4 − 2 − 5 = −3.

References
1. Hamdy A. Taha, Operations Research: An Introduction, Eighth edition,
Prentice-Hall India, 2006.
2. G. Hadley, Linear Programming, Narosa Publishing House, 2002.
3. Mokhtar S. Bazaraa, John J. Jarns and Hanif D. Sherali, Linear
Programming and Network flows, Second edition, John Wiley and sons,
India, 2004.

Suggested Readings
1. Louis Brickman, Mathematical Introduction to Linear Programming and
Game Theory, Springer series.
2. Paul R., An Introduction to Linear Programming and Game Theory, Wiley,
1988.

Institute of Life Long Learning 19

You might also like