Or Assign

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Operations Research

Assignment Problems

Mr. Kartick Mohanta


[email protected]

Duality 1 / 31
INTRODUCTION I

In practical field we are somtimes faced with a type of problem which consists in
assigning men to offices, job to machines, classes in a school to rooms, drivers to
truck to different routes or problem to different research teams etc. in which the
assignees possess varying degree of efficiency, called cost or effectiveness. The basic
assumption of this type of problem is that one person can perform one job at a
time. An assignment plan is optimal if it minimizes the total cost or effectiveness
or maximizes the profit of performing all the jobs. For example, the manager
of a firm may be interested in finding the best assignment of m jobs to his m
employees.Thus the assignment problem is a special type of transportation problem
in which the objective is to optimize the effect of allocating a number of jobs to an
equal number facilities; the jobs and facilites in assignment in assignment problem
represent origins and destinations in transportation problem. As only one job is
assigned to one facility, the cost matrix is always a square (in general); but in
transportation, the matrix is of any order. In transportation, the variable may be
any non-negative integer (including zero) but in assignment, the variable must be
either zero or unity.

Duality 2 / 31
INTRODUCTION II
If cij be the cost of assigning the i-th job to the j-th facility, then we can represent
the cost or effectiveness matrix in the tableau given below.
The tableau represents that only one unit of job is available for one facility. The
assignment is to be made in such a way that each job can be associated with one
and only one facility so as to minimize the over all cost.

FACILITIES
1 2 ··· m ai
1 c11 c12 · · · c1m 1
2 c21 c22 · · · c2m 1
.. ..
JOBS . ··· ··· ··· ··· .
m cm 1 cm 2 ··· cmm 1
bj 1 1 ··· 1 m

Duality 3 / 31
COMPUTATIONAL PROCEDURE I

tep 1. Subtract the minimum element of each row in the cost matrix from all elements
of the respective row. The matrix has now at aleast one zero in every row.
Then subtract the minimum element of each column, which does not have
a zero, from all elements of the respective column, to get the starting cost
matrix.
tep 2. Draw the least possible number of horizontal and vertical lines to cover all the
zeros of the starting cost matrix. Now two cases may arise:
i The number of lines so drawn may be equal to the order of the cost matrix, in
this case an optimal assignment has been reached.
ii The number of lines so drawn may be less than the order of the cost matrix.

If the number of lines be equal to the order of the cost matrix, then we pass
on to step 3. to find the assigned zeros.

Duality 4 / 31
COMPUTATIONAL PROCEDURE II

tep 3. Starting with the first row of the starting matrix, examine all the rows of
this matrix
 which contain only one zero in it (row operation). Mark this zero
with 0  as an assignment will be made there. Draw vertical lines along the
columns containing these assigned zeros. This eliminates the possibility of
making further assignments in those columns. Examine all the rows in this
way.
When all the rows have been completely examined, apply similar procedure to
the columns successively. In this case start from the first column and examine

all the uncrossed columns to find columns containing exactly one remaining
zero (zero operation). Mark these zeros by 0  where an assignment will be
made and draw horizontal lines through these marked zeros.
We illustrate in the next slide the case (i), under step 2.

Duality 5 / 31
COMPUTATIONAL PROCEDURE III

Let us consider the assignment problem represented by the adjacent cost matrix
in which the elements represent the times in hours required by a machine to
perform the corresponding job. The problem is to allocate the jobs to the
machine so as to minimize the total time.

MACHINES
I II III IV
A 8 26 17 11
B 13 28 4 26
JOBS C 38 19 18 15
D 19 26 24 10

Duality 6 / 31
COMPUTATIONAL PROCEDURE IV

MACHINES
I II III IV
A 0 18 9 3
B 9 24 0 22
JOBS C 23 4 3 0
D 9 16 14 0

MACHINES
I II III IV
A 0 14 9 3
B 9 20 0 22
JOBS C 23 0 3 0
D 9 12 14 0

Duality 7 / 31
COMPUTATIONAL PROCEDURE V

We have zeros in the cells (1, 1), (2, 3), (3, 2), (3, 4) and (4, 4). We draw
minimum number of vertical and horizontal lines to cover all the zeros of the
starting matrix.

Duality 8 / 31
COMPUTATIONAL PROCEDURE VI

I II III IV

A 0  14 9 3

B 9 20 0  22
 
C 23 0  3 0 

D 9 12 14 0 

The number of lines so required is four which is equal to the order of the cost
matrix. The optimal assignment will be A → I , B → III , C → II , D → IV .
The minimum cost (time) is, from the original matrix, sum of cost of the
cells (1, 1), (2, 3), (4, 4) and (3, 2) = (8 + 4 + 19 + 10) hours = 41 hours.
Following step 2, if the number of lines so drawn be less than the order of the
matrix, we pass step 4.

Duality 9 / 31
COMPUTATIONAL PROCEDURE VII

tep 4. Find the smallest elements in the starting tableau among the uncovered ele-
ments left after drawing the lines as given in step 2. Subtract this elements
from all the uncovered elements of the current matrix and add the same el-
ement to the elements lying at the intersection of the horizontal and vertical
lines. Do not alter the elements through which only one line passes. This gives
the modified matrix with more zeros.
In fact the two operations of the adding and subtracting do nit alter the opti-
mum solutions as these operations are the resultant of the operations of sub-
tracting the above smallest element from all the uncrossed rows and adding it
to all the crossed columns.
Then go to step 2 with this modified matrix. If a complete assignment be not
still available, then repeat the steps 4 and 2 iteratively and finally apply the
step 3.

Duality 10 / 31
COMPUTATIONAL PROCEDURE VIII

tep 5. Repeat the two operations of step-3 (row and column operations) successively
until one of the two following cases arise:
i There will be no unmarked zero left;
ii There lie more than one unmarked zero in one row or column.

In the first case the algorithm stops and we have exactly one marked zero in
each row and in each column of the given matrix. The assignment correspond-
ing to these zeros is the optimal assignment.
In the second case mark with 0  one of the unmarked zeros arbitrarily and
ignore the remaining zero in that row or column.Repeat the process until no
unmarked zero is left in the matrix.

Duality 11 / 31
VARIATIONS IN ASSIGNMENT PROBLEM I

The structure of the assignment problem may bee broadened in the following cases:

1 Maximization problem
If the problem be a maximization problem, say with a profit matrix, then a
conversion is made first. The largest element of the profit matrix is selected.
A new cost matrix is formed whose elements are each the largest element minus
the profit element of the corresponding cell. Such as

3 9 6 0
6 4 3 5

Here the largest element is 9. The operation is performed as stated and we


get the modified cost matrix. Then we find the solution to find the minimum
cost which will provide the maximum profit of the original problem.

Duality 12 / 31
VARIATIONS IN ASSIGNMENT PROBLEM II

Alternatively since the maximum profit is equivalent to the minimum cost, we


may attempt these problems by multiplying each element of the profit matrix
by (−1) to get the modified matrix.Then we proceed as usual.
2 Unbalanced problem
If the number of jobs and the number of facilities be not equal, then the problem
is unbalanced. In this case we add a fictitious job or facility, whichever has
deficiency, with zero cost as we did in the case of unbalanced transportation
problem. Then we apply the assignment algorithm to this resulting balanced
problem.
3 Impossible assignment
If some assignment be impossible,that is, if some job cannot be performed by
some particular facility,then we avoid this effectively by putting a large cost in
that cell which prevents that particular assignment from being effective in the
optimal solution.

Duality 13 / 31
VARIATIONS IN ASSIGNMENT PROBLEM III

4 Negative cost
If the cost matrix contains some negative cost, then we add to each element
of the row or column a quantity, sufficient to make all the cell-elements non-
negative. Then we proceed with the usual assignment algorithm.

Duality 14 / 31
Example 1:
Find the optimal assignment for a problem with the following cost matrix:
M1 M2 M3 M4 M5
J1 8 4 2 6 1
J2 0 9 5 5 4
J3 3 8 9 2 6
J4 4 3 1 0 3
J5 9 5 8 9 5

Duality 15 / 31
Solution: I

To get the starting matrix, we subtract the minimum element of each row from all
elements of the respective row. We get the left hand matrix below. each row and
each column excepting the third has a zero. Then subtract the minimum element
of the third column, from all elements of the respective column to get the starting
matrix.
M1 M2 M3 M4 M5
J1 7 3 1 5 0
J2 0 9 5 5 4
J3 1 6 7 0 4
J4 4 3 1 0 3
J5 4 0 3 4 0

Duality 16 / 31
Solution: II
Then we draw the least number of vertical and horizontal lines to cover all the
zeros.
M1 M2 M3 M4 M5

J1 7 3 0 5 0 

J2 0  9 4 5 4

J3 1 6 6 0  4

J4 4 3 0  0 3

J5 4 0  2 4 0

The least number of lines so required is 5, which is equal to the order of the cost
matrix. The optimal solution is
J1 → M5 , J2 → M1 , J3 → M4 , J4 → M3 , J5 → M2 ; Minimum cost
= 1 + 0 + 2 + 1 + 5 = 9.

Duality 17 / 31
Example 2:
The Head of the department has five jobs A, B, C , D, E and five sub-ordinates
V , W , X , Y , Z . The number of hours each man would take to perform each job
is as follows:
V W X Y Z
A 3 5 10 15 8

B 4 7 15 18 8

C 8 12 20 20 12

D 5 5 8 10 6

E 10 10 15 25 10
How would the jobs be allocated to minimize the total time ?

Duality 18 / 31
Solution: I

Following step 1, we get the two matrices below. The second being the starting
cost matrix, we follow the step 2 by drawing the least possible number of vertical
and horizontal lines to cover all the zeros. But we see that the number of lines so
required is 3 which is less than the order of the matrix, which is 5 in this case.
V W X Y Z V W X Y Z
A 0 2 7 12 5 A 0 2 7 12 5

B 0 3 11 14 4 B 0 3 11 14 4

C 0 4 12 12 4 C 0 4 12 12 4

D 0 0 3 5 1 D 0 0 3 5 1

E 0 0 5 15 0 E 0 0 5 15 0

Duality 19 / 31
Solution: II

Then we pass on to step 4. We see that 2 is the minimum element among the
uncovered elements.
V W X Y Z V W X Y Z
A 0 0 2 5 3 A 1 0 2 5 3

B 0 1 6 7 2 B 0 0 5 6 1

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

D 2 0 0 0 1 D 3 0 0 0 1

E 2 0 2 10 0 E 3 0 2 10 0

We see that the least number of lines to cover all the zeros of this modified matrix
is 4 which is again less than the order of the matrix.

Duality 20 / 31
Solution: III

V W X Y Z V W X Y Z

JA1 1 0 1 4 2 A 1 0 0  3 2

B 0 0 4 5 0 B 0 0  3 4 0

C 0 1 5 3 0 C 0  1 4 2 0

D 4 1 0 0 1 D 5 2 0 0  2

E 4 1 2 10 0 E 4 1 1 9 0 

The optimal assignment will be A → X , B → W , C → V , D → Y , E → Z ;


Minimum time = 10 + 7 + 8 + 10 + 10 = 45 hours.

Duality 21 / 31
Example 3:
Three persons are being considered for three open positions. Each person has been
given a rating for each position as shown in the following table:
POSITION

PERSON I II III
1 7 5 6
2 8 4 7
3 9 6 4
Assign each person to one and only one position in such a way that the sum of
rating for all three persons is maximum.

Duality 22 / 31
Solution: I

Here the problem is a maximization problem with a profit matrix. The modified
matrix will be obtained by subtracting the profit elements of the respective cells
from the largest element 9 in the cell (3,1). Then we are to proceed as usual. The
modified matrix is shown on the extreme left below.
Then following step 1, we get successively the following two matrices:

2 4 3 0 2 1 0 0 0
1 5 2 0 4 1 0 2 0
0 3 5 0 3 5 0 1 4

We draw horizontal and vertical lines to cover all the zeros of the matrix.

Duality 23 / 31
Solution: II

The minimum number of lines to cover all the zeros is 3, which is equal to the
order of the matrix. Then, by row operation, assignments are made successively in
the cells (3, 1), (2, 3) and (1, 2) by column operation. Hence the optimal solution
is 1 → II , 2 → III , 3 → I and the maximum profit, that is sum of the rating as
computed from the given table is 9 + 5 + 7 = 21.
I II III

1 0 0  0

2 0 2 0 

3 0  1 4

Duality 24 / 31
Example 4:
Find the minimum cost solution for the 4 × 4 assignment problem whose cost
coefficient are as given below:
I II III IV
1 4 5 3 2
2 1 4 −2 3
3 4 2 1 −5

Duality 25 / 31
Solution: I

The given cost matrix contains some negative cost at the same time it is an un-
balanced problem having three jobs and four machines. First of all we make all
the cell elements non-negative by adding 5 to each element of the matrix and then
make the problem a balanced one by adding a fictitious job 4 with zero cost. The
transformed cost matrix is given here.
I II III IV
1 9 10 8 7
2 6 10 3 8
3 9 7 6 0
4 0 0 0 0

Duality 26 / 31
Solution: II
Now we subtract the minimum element of each row from all elements of the respec-
tive row and then we draw the minimum number of horizontal and vertical lines to
cover all the zeros. This minimum number is 3 which is less than the order of the
matrix. Hence we follow next the steps 4 and 2 iteratively which yields successively
the following matrices:
I II III IV I II III IV I II III IV

1 2 3 1 0 1 1 2 0 0 1 0  1 0 0

2 3 6 0 5 2 3 6 0 6 2 2 5 0  6

3 9 7 6 0 3 8 6 5 0 3 7 5 5 0 

4 0 0 0 0 4 0 0 0 1 4 0 0  1 2

The optimal solution is 1 → I , 2 → III , 3 → IV and the minimum cost is


4 − 2 − 5 = −3.

Duality 27 / 31
Example 5:
Consider the problem of assigning four operators to four machines. The assignment
costs in rupees are given here. Operator 1 cannot be assigned to machine III and
operator IV cannot be assigned to machine IV . Find the optimal cost of assignment.
I II III IV
1 5 5 − 2
2 7 4 2 3
3 9 3 5 −
4 7 2 6 7

Duality 28 / 31
Solution: I

Here two assignments are impossible, that 1 cannot be assignment to III and 3
cannot be assigned to IV . Hence we put a very large cost 10 in the cells (1, 3) and
(3, 4) and then proceed as usual. The new cost matrix is
I II III IV I II III IV
1 5 5 10 2 1 0 3 8 0
2 7 4 2 3 2 2 2 0 1
3 9 3 5 10 3 3 0 2 7
4 7 2 6 7 4 2 0 4 5

Duality 29 / 31
Solution: II

I II III IV I II III IV I II III IV



1 0 4 9 0 1 0 5 9 0 1 0 5 9 0 

2 1 2 0 0 2 1 3 0 0 2 1 3 0  0

3 2 0 2 6 3 1 0 1 5 3 1 0  1 5

4 1 0 4 4 4 0 0 3 3 4 0  0 3 3

The optimal assignment is 1 → IV , 2 → III , 3 → II and 4 → I . The cost is


2 + 2 + 3 + 7 = 14.

Duality 30 / 31
THANK YOU

Duality 31 / 31

You might also like