0% found this document useful (0 votes)
93 views

8 Assignment Problem PDF

This document describes an assignment problem involving assigning four persons (A, B, C, D) to four jobs (P, Q, R, S). The goal is to minimize the total number of man-days required to complete all jobs. The problem is formulated as a linear program to determine the optimal assignment. The solution approach involves transforming the cost table to obtain an equivalent table with at least one zero in each row and column, allowing for a zero-cost feasible assignment that will be optimal. Applying this approach to the given cost table results in an optimal assignment with a total cost of 24 man-days.

Uploaded by

chandel08
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

8 Assignment Problem PDF

This document describes an assignment problem involving assigning four persons (A, B, C, D) to four jobs (P, Q, R, S). The goal is to minimize the total number of man-days required to complete all jobs. The problem is formulated as a linear program to determine the optimal assignment. The solution approach involves transforming the cost table to obtain an equivalent table with at least one zero in each row and column, allowing for a zero-cost feasible assignment that will be optimal. Applying this approach to the given cost table results in an optimal assignment with a total cost of 24 man-days.

Uploaded by

chandel08
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

The Assignment

Problem
Assignment problem
Four persons, A, B, C, and D are available to be assigned to
four jobs, P, Q, R, and S. The estimated number of days to
complete each job by each of the four persons are given in
the table below. How should the persons be assigned jobs
so that each person is assigned one job and the total
number of man-days required is minimised?

Job
P Q R S
Person A 10 8 4 9
B 8 6 12 10
C 14 10 7 9
D 5 14 10 8
Assignment problem
Decision variables:
1 if person i is assigned to job j
Let xij =
0 otherwise
Where : i = 1, 2, 3, 4 stands for persons 1, 2, 3, and 4
respectively
j = 1, 2, 3, 4 stands for jobs 1, 2, 3, and 4
respectively
The LP formulation will be as follows:
Assignment problem
Min z = 10x11 + 8x12 + 4x13 + 9x14 + 8x21 + 6x22 + 12 x23 + 10x14
+ 14x31 + 10x32 + 7x33 + 9x34 + 5x41 + 14x42 + 10x43 + 8x44
s.t.
x11 + x12 + x13 + x14 = 1 (person 1 must be assigned)
x21 + x22 + x23 + x24= 1 (person 2 must be assigned)
x31 + x32 + x33 + x34= 1 (person 3 must be assigned)
x41 + x42 + x43 + x44= 1 (person 4 must be assigned)
x11 + x21 + x31 + x41= 1 (job 1 must be assigned)
x12 + x22 + x32 + x42= 1 (job 2 must be assigned)
x13 + x23 + x33 + x43= 1 (job 3 must be assigned)
x14 + x24 + x34 + x44= 1 (job 4 must be assigned)
xij ≥ 0 , i = 1, 2, 3, 4 and j = 1, 2, 3, 4
Assignment problem

 An assignment problem seeks to minimize the


total cost of assigning m workers to m jobs,
given that the cost of worker i performing job j
is cij.
 It assumes all workers are assigned and each
job is performed.
 An assignment problem is a special case of a
transportation problem in which all supplies
and all demands are equal to 1; hence
assignment problems may be solved as linear
programs or as transportation problems.
Assignment problem
 LP Formulation

Min cijxij
i j

s.t. xij = 1 for each person i


j

xij = 1 for each job j


i
xij ≥ 0 for all i and j
Assignment problem
Special Cases
(1) Number of persons exceeds the number of jobs:

Add enough dummy jobs to equalize the


number of persons and the number of jobs.
The objective function coefficients for these
new variables would be zero.

(2) Number of jobs exceeds the number of persons:

Add enough dummy persons to equalize the


number of jobs and the number of persons.
The objective function coefficients for these
new variables would be zero.
Assignment problem

Special Cases (continued)


(3) The assignment alternatives are evaluated in
terms of revenue or profit – i.e. the objective
function is to be maximised
Multiply each cij with -1 and then minimise.
(4) An assignment is unacceptable:
Use a very large value (M or ∞ for the
corresponding cij.
Assignment problem: Solution
Let us consider the job assignment problem introduced
earlier. As long as each cost element cij ≥ 0, if we can have a
feasible assignment with total cost = 0, that is guaranteed
to be optimal. We shall now try to get such a solution by
invoking some results.

Job
P Q R S
Person A 10 8 4 9
B 8 6 12 10
C 14 10 7 9
D 5 14 10 8
Assignment problem: Some
Results
Result 1:
If we subtract a constant pi from each cost element of the ith
row, we get a new “equivalent” cost table. However, the
optimal assignment for the new cost table is the same as
the original cost table.

Result 2:
If we subtract a constant qj from each cost element of the jth
column, again we get a new “equivalent” cost table.
However, the optimal assignment for the new cost table is
the same as the original cost table.
Assignment problem: Some
Results
 The new LP:
Min (cij – pi – qj)xij
i j
s.t. xij = 1 for each person i
j
xij = 1 for each job j
i
xij = 0 or 1 for all i and j
But (cij – pi – qj)xij = cij xij – pixij – qjxij
i j i j i j j i
= cij xij – pi – qj = cij xij – constant
i j i j i j

Hence, whether we solve the original LP, or the new


LP, the optimal values of the decision variables xij will
be the same.
Assignment problem: Solution
Thus, using Results 1 and 2, we can create an
“equivalent” cost table with at least one zero in every
row and every column.
We can create a zero in every row by subtracting the
row minimum from every element of the row.
We can create a zero in every column by subtracting
the column minimum from every element of the
column.
Finally, if we can now have an assignment with zero
total cost, it is guaranteed to be optimal.
Assignment problem: Solution
Subtracting the minimum of the row from each element of
a row, we create a zero in every row and get the following
“equivalent” cost table:

Job
P Q R S
Person A 6 4 0 5
B 2 0 6 4
C 7 3 0 2
D 0 9 5 3
Assignment problem: Solution
Now, subtracting the minimum of the column from each
element of a column, we ensure at least one zero in every
column and get the following “equivalent” cost table:

Job
P Q R S
Person A 6 4 0 3
B 2 0 6 2
C 7 3 0 0
D 0 9 5 1
Assignment problem: Solution
We now explore the possibility of making a zero cost
feasible assignment – if it is possible it would be an optimal
assignment.
We try to “cover” all the zeroes with the minimum number
of lines – either horizontal or vertical. If the minimum
number of lines required to “cover” all the zeroes is equal
to the number of rows or columns, then it is possible to
make a zero cost assignment.
We can use the method of “Lone Rangers” to determine
this minimum number of lines.
Assignment problem: Solution
We try to identify a “Lone Ranger” as the only zero in a
row or the only zero in a column. If a zero cost feasible
assignment exists, such “Lone Rangers” must be in the
assignment.
For example, in the first row, there is a “Lone Ranger” – so
that zero must be in the assignment. We choose that zero
and draw a vertical line to show that no other zero can be
assigned on that column. Similarly for the second, third
and the fourth rows. By now, we made four assignments
and drew four vertical lines to “cover” all zeroes.
The minimum number of lines required to “cover” all
zeroes is four and so we can make a complete assignment
as shown next.
Assignment problem: Solution
As the minimum number of lines required to “cover” all
zeroes is four, a complete assignment with zeroes can be
made and that would give us the optimal assignment.

Job
P Q R S
Person A 6 4 0 3
B 2 0 6 2
C 7 3 0 0
D 0 9 5 1
4 2 1 3
Assignment problem: Solution
We can now go back to the original cost table and identify
the assignment as well as determine the total cost.
The total cost = 4 + 6 + 9 + 5 = 24 man-days

Job
P Q R S
Person A 10 8 4 9
B 8 6 12 10
C 14 10 7 9
D 5 14 10 8
Assignment problem: Solution
Another Assignment Problem
Suppose our original cost table was different and was as
shown below. Let us use the same procedure as specified
earlier.

Job
P Q R S
Person A 10 8 4 9
B 10 6 12 8
C 14 10 7 11
D 5 14 10 8
Assignment problem: Solution
Subtracting the minimum of the row from each element of
a row, we create a zero in every row and get the following
“equivalent” cost table:

Job
P Q R S
Person A 6 4 0 5
B 4 0 6 2
C 7 3 0 4
D 0 9 5 3
Assignment problem: Solution
Now, subtracting the minimum of the column from each
element of a column, we ensure at least one zero in every
column and get the following “equivalent” cost table:

Job
P Q R S
Person A 6 4 0 3
B 4 0 6 0
C 7 3 0 2
D 0 9 5 1
Assignment problem: Solution
We now have an “equivalent” cost table with at least one
zero in every row and every column. The minimum
number of lines required to “cover” all zeroes is three and
so a complete assignment with zero total cost cannot be
made as shown below:

Job
P Q R S
Person A 6 4 0 3
B 4 0 6 0 3

C 7 3 0 2
D 0 9 5 1
2 1
Assignment problem: Solution
Therefore, we need to create additional zeroes without
losing any of the current assigned zeroes.
We do this by subtracting the minimum of the uncovered
numbers (1 in this example) from each row and add back
the same to each covered row or covered column (having a
line through it).
Job
P Q R S
Person A 6 4 0 3
B 4 0 6 0 3

C 7 3 0 2
D 0 9 5 1
2 1
Assignment problem: Solution
This will cause the following changes:
1. An uncovered number will have its value decreased by the
subtracted number.
2. A number covered by a single line will have no change.
3. A number covered by two lines will have its value
increased by the subtracted number.
We again find only 3 lines are needed to cover all zeroes.
Job
P Q R S
Person A 6 3 0 2
B 5 0 7 0 3

C 7 2 0 1
D 0 8 5 0 2
1
Assignment problem: Solution
Although we created one more zero, we find that even
now we can cover all zeroes by only three lines.
So we repeat the process to create some more zeroes in the
same way.
Now, we find that minimum four lines are needed to cover
all zeroes. This gives us an optimal assignment.
Job
P Q R S
Person A 5 2 0 1
B 5 0 8 0 4

C 6 1 0 0
D 0 8 6 0 3
1 2
Assignment problem: Solution
As before, we can now go back to the original cost table
and identify the assignment as well as determine the total
cost.
The total cost = 4 + 6 + 11 + 5 = 26 man-days

Job
P Q R S
Person A 10 8 4 9
B 10 6 12 8
C 14 10 7 11
D 5 14 10 8
Assignment problem: The
Hungarian Method
The method that we used to solve the
Assignment Problem is called the Hungarian
Method or the Hungarian Algorithm and can be
summarised in four steps below.
The first two steps are executed once, while
Steps 3 and 4 are repeated until an optimal
assignment is found.
The input of the algorithm is an n by n square
matrix with only nonnegative elements.
Assignment problem: The
Hungarian Method
1) Subtract row minima
For each row, find the lowest element and subtract
it from each element in that row (Row Reduction).
2) Subtract column minima
For each column, find the lowest element and
subtract it from each element in that column
(Column Reduction).
3) Cover all zeros with a minimum number of
lines.
4) Create additional zeros
Assignment problem: The
Hungarian Method
3) Cover all zeroes with a minimum number of
lines
Cover all zeros in the resulting matrix using a
minimum number of horizontal and vertical lines. If n
lines are required, an optimal assignment exists
among the zeros. The algorithm stops.
If less than n lines are required, continue with Step 4.
4) Create additional zeroes
Find the smallest element (call it k) that is not covered
by a line in Step 3. Subtract k from all uncovered
elements, and add k to all elements that are covered
twice. Go back to Step 3.
Transportation and
Assignment Problems
 Each of these two models can be formulated as linear
programs or as transportation problems and solved
by general purpose linear programming codes or by
any transportation model codes.
 For each of the two models, if the right-hand side of
the linear programming formulations are all integers,
the optimal solution will be in terms of integer values
for the decision variables.
 However, there are many computer packages
(including TORA) that contain separate computer
codes for these models which take advantage of their
special structure.

You might also like