Unit - 4, Assignment Problem
Unit - 4, Assignment Problem
Problems
Introduction
Assignment problem is one of the special cases of LPP; hence
assignment problems may be solved by simplex method as well, but
because of its special structure, it is solved by Assignment Method.
Assignment problem seeks to minimize the cost or time (default)
or to maximize profit or supply (when specifically asked) by
assigning different jobs to different persons.
An important characteristic of the assignment problem is that
each person is assigned with exactly one job and each job is
assigned to exactly one person.
Balanced assignment problem: This is an assignment
problem where the number of persons is equal to the
number of jobs, i.e. cost/profit matrix should be a square
matrix, otherwise, unbalanced.
Hungarian Method
(Hungarian Method)
1. Solve the following minimal assignment problem:
Man
1 2 3 4
Job
1 12 30 21 15
2 18 33 9 31
3 44 25 24 21
4 23 30 28 14
9
Step 1: Subtract the minimum number of each row from all numbers in that row.
0 18 9 3
9 24 0 22
23 4 3 0
9 16 14 0
10
Step 2: Subtract the minimum number of each column from all numbers in that column.
0 14 9 3
9 20 0 22
23 0 3 0
9 12 14 0
11
11
Step 3: Mark one zero in each row and in each column, if possible. These marked zeros will
correspond to the assignment of jobs to persons. If all persons are assigned jobs, i.e number
of marked zeros is same as order of the matrix, STOP; this will be the minimum cost
assignment. Otherwise proceed to step 4.
0 14 9 3
9 20
0 22
23
0 3
×0
9 12 14
0
12
Since every row and every column has one assignment, so we have reached optimal solution.
13
2. A department head has 4 subordinates, and 4 tasks to be
performed. The subordinates differ in efficiency and the tasks differ in
their intrinsic difficulty. His estimate of the times each man would take to
perform each task is given in the effectiveness matrix below. How should
the tasks to be allocated, one to a man, so as to minimize the total man
hour?
Man
1 2 3 4
Job
1 11 17 8 16
2 9 7 12 6
3 13 16 15 12
4 14 10 12 11
14
Step 1: Subtract the minimum number of each row from all numbers in that row.
3 9 0 8
3 1 6 0
1 4 3 0
4 0 2 1
15
Step 2: Subtract the minimum number of each column from all numbers in that column.
2 9 0 8
2 1 6 0
0 4 3 0
3 0 2 1
16
16
Step 3: Mark one zero in each row and in each column, if possible. These marked zeros will
correspond to the assignment of jobs to persons. If all persons are assigned jobs, i.e number
of marked zeros is same as order of the matrix, STOP; this will be the minimum cost
assignment. Otherwise proceed to step 4.
2 9
0 8
2 1 6
0
0 4 3
×0
3
0 2 1
17
Since every row and every column has one assignment, so we have reached optimal solution.
18
3. Solve the following Assignment Problem
Man
1 2 3 4
Job
1 7 9 8 13
2 16 16 15 11
3 16 19 10 15
4 16 17 14 16
19
Step 1: Subtract the minimum number of each row from all numbers in that row.
0 2 1 6
5 5 4 0
6 9 0 5
2 3 0 2
20
Step 2: Subtract the minimum number of each column from all numbers in that column.
0 0 1 6
5 3 4 0
6 7 0 5
2 1 0 2
21
21
Step 3: Mark one zero in each row and in each column, if possible. These marked zeros will
correspond to the assignment of jobs to persons. If all persons are assigned jobs, i.e number
of marked zeros is same as order of the matrix, STOP; this will be the minimum cost
assignment. Otherwise proceed to step 4.
0
×0 1 6
5 3 4
0
6 7
0 5
2 1
×0 2
Here number of marked zeros is not same as order of the matrix, proceed to step 4.
22
Step 4: Draw minimum number ( = number of marked zeros after step 3) of vertical and horizontal lines to cover all
zeros (both marked and cancelled).
0
×0 1 6
5 3 4
0
6 7
0 5 3
2 1
×0 2 1
2
Step 5: Subtract the least uncovered element from all the uncovered elements, add the least uncovered element to
the elements at the intersection of horizontal and vertical lines, leaving other elements which are covered by either
only horizontal or only vertical lines as it is.
Step 6: Repeat steps 3 to 5 until number of marked zeros is same as order of the matrix.
0
×0 2 6
5 3 5
0
5 6
0 4
1 0
×0 1
Since every row and every column has one assignment, so we have reached optimal solution.
25
Unbalanced Assignment Problem :
As assignment problems is called unbalanced assignment problem
whenever the number of tasks (jobs) are not equal to the number
of facilities (persons). Thus, the cost of matrix of an assignment
problem is not the square matrix. For the solution of such
problems we assign the dummy rows and dummy columns to the
given matrix to make it a square matrix. The costs in these
dummy rows or columns are taken to be 0. Now the problem
reduce to the balanced assignment problem and can be solved by
Hungarian Method.
26
4. Solve the following Assignment Problem.
Man
1 2 3
Job
1 15 18 10
2 14 17 8
3 16 19 17
4 20 14 17
Man
4(Dummy
1 2 3
Job )
1 15 18 10 0
2 14 17 8 0
3 16 19 17 0
4 20 14 17 0
After applying Step-1, we get same matrix, as each row has one 0.
1 4 2
0 3
0 3
×0 ×0
2 5 9
×0 1
6
0 9
×0
Now apply Step-3 onwards.
2
Step 5: Subtract the least uncovered element from all the uncovered elements, add the least uncovered
element to the elements at the intersection of horizontal and vertical lines, leaving other elements which
are covered by either only horizontal or only vertical lines as it is.
Step 6: Repeat steps 3 to 5 until number of marked zeros is same as order of the matrix.
0 3 1
×0
×0 3 0 1
1 4 8
0
6
0 9 1
Since every row and every column has one assignment, so we have reached optimal solution.
31
Multiple Optimal Solution
Jobs
J1 J2 J3
Persons
P1 8 7 6
P2 5 7 8
P3 6 8 7
2 1 0
Step 1: Min of each row subtract from 0 2 3
that row
0 2 1
2
0 ×0
Step 2: Min of each column subtract
from that column
0 1 3
×0 1 1
Step 3: Mark one zero in each row and in each column, if possible.
As number of marked zeros is less than order of the matrix, apply Step 4 of covering all
zeros with minimum number of lines. Then apply Step 5 onwards.
Step 5: Subtract the least uncovered element from all the uncovered elements, add the least
uncovered element to the elements at the intersection of horizontal and vertical lines, leaving other
elements which are covered by either only horizontal or only vertical lines as it is.
Step 6: Repeat steps 3 to 5 until number of marked zeros is same as order of the matrix.
3
0 ×0 3 ×0
0 3 ×0 0
0 ×0 2
0 ×0 2 ×0
0 2
×0 ×0 0 ×0 0
Improved Sol 2
×0
0 ×0 ×0
Improved Sol 1 Improved Sol 3
As each row or column has more In 1st row with two zeros mark 1st From improved solution 1, we got
than one zero, so we are unable optimal solution 1, but in improved
zero of solution 1 and 2nd zero of
to mark or cancel any zero and solution 2, we again have 2-2 zeros in
solution 2 and cancel all other
this shows, it is a case of multiple each of the remaining rows and
zeros in its row or column. Now
columns, so again we make one exact
optimal solution. Now we make apply step 3 onwards in both copy of improved solution 2 and
an exact copy of this matrix above solutions. proceed similarly.
So we get 3 optimal solutions of the given assignment problem.
Optimal Assignment Schedules are:
Sometimes in an assignment problem there could be a scenario that some persons may not
be competent enough to do some particular job. In that case some particular places are left
blank in cost matrix to denote restricted assignment at those places.
In order to solve problems with restricted assignments, we consider that infinite cost is
associated at such places in the cost matrix and as assignment is to be made only at zeros,
so these infinite cost places will always remain un-assigned and problem can be solved as
usual using Hungarian method.
6. Solve the following Assignment Problem
J1 J2 J3 J4
P1 14 29 -- 20
P2 21 -- 33 17
P3 17 25 37 15
P4 14 31 39 21
Solution: Here P1→ J3 and P2 → J2 are restricted assignments, we consider infinity cost
at these places so we get the following matrix:
Solution: Here P1→ J3 and P2 → J2 are restricted assignments, we consider infinity cost
at these places so we get the following:
J1 J2 J3 J4
P1 14 29 ∞ 20
P2 21 ∞ 33 17
P3 17 25 37 15
P4 14 31 39 21
Step 1: Subtract the minimum number of each row from all numbers in that row.
0 15 ∞ 6
4 ∞ 16 0
2 10 22 0
0 17 25 7
40
Step 2: Subtract the minimum number of each column from all numbers in that column.
0 5 ∞ 6
4 ∞ 0 0
2 0 6 0
0 7 9 7
41
41
Step 3: Mark one zero in each row and in each column, if possible. These marked zeros will
correspond to the assignment of jobs to persons. If all persons are assigned jobs, i.e number
of marked zeros is same as order of the matrix, STOP; this will be the minimum cost
assignment. Otherwise proceed to step 4.
0 5 ∞ 6
4 ∞
0
×0
2
0 6
×0
×0 7 9 7
Here number of marked zeros is not same as order of the matrix, proceed to step 4.
42
Step 4: Draw minimum number ( = number of marked zeros after step 3) of vertical and horizontal lines to cover all
zeros (both marked and cancelled).
0 5 ∞ 6
4 ∞
0
×0
2
0 6
×0
×0 7 9 7
Step 5: Subtract the least uncovered element from all the uncovered elements, add the least uncovered element to
the elements at the intersection of horizontal and vertical lines, leaving other elements which are covered by either
only horizontal or only vertical lines as it is.
Step 6: Repeat steps 3 to 5 until number of marked zeros is same as order of the matrix.
×0 0 ∞ 1
9 ∞
0 ×0
7 ×0 6
0
0 2 4 2
Since every row and every column has one assignment, so we have reached optimal solution.
45
Maximization Problem :
Subtract each element of the given matrix (profit matrix) from the greatest
element of the matrix to get the equivalent cost (i.e. loss) matrix.
J1 J2 J3 J4 J5
P1 30 37 40 28 40
P2 40 24 27 21 36
P3 40 32 33 30 35
P4 25 38 40 36 36
P5 29 62 41 34 39
Step 0: Subtract all the elements of the matrix from the maximum element (62 here) of the matrix of
maximization problem to convert the problem to minimization problem.
32 25 22 34 22
22 38 35 41 26
22 30 29 32 27
37 24 22 26 26
33 0 21 28 23
10 3 0 12 0
0 16 13 19 4
0 8 7 10 5
15 2 0 4 4
33 0 21 28 23
Step 2: Subtract the minimum number of each column from all numbers in that column.
10 3
×0 8
0
×0
0
16
8
13
7
15
6
4
5
15 2
×0 0 4
33
0 21 24 23
Step 3: Mark one zero in each row and in each column, if possible. These marked zeros will
correspond to the assignment of jobs to persons. If all persons are assigned jobs, i.e number
of marked zeros is same as order of the matrix, STOP; this will be the minimum cost
assignment. Otherwise proceed to step 4.
Step 4: Draw minimum number ( = number of marked zeros after step 3) of vertical and
horizontal lines to cover all zeros (both marked and cancelled).
Step 5: Subtract the least uncovered element from all the uncovered elements, add the least uncovered element to
the elements at the intersection of horizontal and vertical lines, leaving other elements which are covered by either
only horizontal or only vertical lines as it is.
Step 6: Repeat steps 3 to 5 until number of marked zeros is same as order of the matrix.
14 3
0 8
×0
×0 12 9 11
0
0 4 3 2 1
19 2
×0 0 4
37
0 21 24 23
Since every row and every column has one assignment, so we have reached optimal solution.
52
8. An air – line that operates seven days a week has time table shown below. Cruse
must have a minimum layover of 5 hours between flights. Obtain the pairing of flights that
minimizes layover time away from home. For any given pairing the crew will be based at
the city that results in the smaller layover.
For each pair also mention the town where the crew should be based.
53
Solution: To avoid the fractions we consider the layover times in terms of quarter hour as
one unit of time. The layover time matrices are as follows:
54
Now we combine the two tables, choosing that base which gives a lesser layover time for
each pairing. The layover times marked with ( * ) denote the crew based at Jaipur,
otherwise the crew is based at Delhi. Thus we get the following table.
70 72 86 75*
55
Subtracting the smallest element of each row from every element of the corresponding row
and then subtracting the smallest element of each column from every element of the
corresponding column, we get the following matrix.
L3
1
57* 53* 41*
×0
0 ×0 16 5* L1
16* 12* 0* 67 L2
2 56
Applying the modification operations and making assignments again we get the following
table.
L3 L2
16* 12* ×
0* ×
0 1
24* 20* 8* 0 4
0 ×
0 16 38* L1
3 2 57
Applying the modification operations and making assignments again we get the following:
4* 0* ×
0* ×
0
12* 8* 8* 0
0 ×
0 28 50*
4* ×
0* 0* 100
58
The optimal solution to the problem is given by following flights Pairing:
Flight Flight Layover time
1 102 (crew based at Jaipur) 85
2 104 (crew based at Delhi) 34
3 101 (crew based at Delhi) 70
4 103 (crew based at Jaipur) 21
The minimum layover time is 210 quarter hours i.e. 52 hours and 30 minutes.
59
Practice Example 1
Solve the following assignment problem for minimizing the cost.
PERSONS
A B C D E
1 10 4 6 10 12
2 11 7 7 9 14
JOBS
3 13 8 12 14 15
4 14 16 13 17 17
5 17 11 17 20 19
Practice Example 2
Solve the following assignment problem for minimizing the time.
PERSONS
A B C D E
1 32 38 40 28 40
2 40 24 28 21 36
JOBS
3 41 27 33 30 37
4 22 38 41 33 36
5 29 33 40 35 39
Thank You