0% found this document useful (0 votes)
206 views62 pages

Unit - 4, Assignment Problem

.

Uploaded by

saxenark15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
206 views62 pages

Unit - 4, Assignment Problem

.

Uploaded by

saxenark15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

Assignment

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

As assignment problem has a special structure so it is solved by the


special method developed by a Hungarian mathematician D. Konig
and is therefore known as Hungarian method of assignment problem.
The Hungarian Method
Solving a balanced minimization assignment problem by Hungarian method
consists following steps:
Step 1: Subtract the minimum number of each row from all numbers in that
row.
Step 2: Subtract the minimum number of each column from all numbers in that
column.
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.
Hungarian Method Contd…
Procedure to mark zeros in step 3:
3a. For each row, if there is only one zero, mark that zero and cancel zeros in the
column of this marked zero, if any. Repeat the step for all rows. If all zeros are
neither marked nor cancelled, proceed to step 3b.
3b. For each column, if there is only one zero, mark that zero and cancel zeros in
the row of this marked zero, if any.
3c. Repeat steps 1 and 2 until all the zeros are either marked or cancelled. (If
zeros remain, this means that there are at least two zeros in each remaining row
and column. This is a case of alternate solution. Make an arbitrary assignment
to one of these 0’s and repeat steps 1 and 2.)
Hungarian Method Contd…
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).
For small problems, the minimum number of lines required to cover all the zeros can usually be
determined by observation. The following procedure can be used for larger problems:
4a. Tick all rows with no marked zeros.
4b. For each row just ticked, tick each column that has a cancelled zero.
4c. For each column just ticked, tick each row that has a marked zero.
4d. Repeat steps 2 and 3 until no more ticks can be made.
4e. Draw lines through un-ticked rows and ticked columns.
Hungarian Method Contd…
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.
Solution of an Assignment Problem:

(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.

the optimal assignment Schedule is:

Job Man Cost


1 1 12
2 3 9
3 2 25
4 4 14
Total Minimum Cost: 60

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.

the optimal assignment Schedule is:

Job Man Time


1 3 8
2 4 6
3 1 13
4 2 10
Total Minimum Time: 37

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.

the optimal assignment Schedule is:

Job Man Cost


1 1 7
2 4 11
3 3 10
4 2 17
Total Minimum Cost: 45

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

As in this assignment problem, there are 4 rows but only 3 columns,


this is a case of unbalanced assignment problem. We shall now
introduce dummy 4th column with zero costs to balance the problem.
We get the following balanced problem:

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.

Now applying Step-2, we get the following matrix:

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.

the optimal assignment Schedule is:

Job Man Cost


1 1 15
2 3 8
3 4(Dummy) 0
4 2 14
Total Minimum Cost: 37

As Job 3 is assigned to dummy person, so job 3 is not assigned at all.

31
Multiple Optimal Solution

While applying Step-3, where we either mark a zero or cancel a zero


so as to have exactly one zero marked in each row and in each
column, if we are left with at least two zeros in each row and in
each column and can not complete the marking process further, it
shows that it is a case of multiple optimal solution. In this case we
can have more than one possibility of Assignments with same
minimum cost.
5. Solve the following Assignment Problem.

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:

Optimal Solution 1 Optimal Solution 2 Optimal Solution 3


Persons Jobs Cost Persons Jobs Cost Persons Jobs Cost
P1 J2 7 P1 J3 6 P1 J3 6
P2 J1 5 P2 J1 5 P2 J2 7
P3 J3 7 P3 J2 8 P3 J1 6
Total Minimum Cost: 19 Total Minimum Cost: 19 Total Minimum Cost: 19
Restricted or Prohibited Assignment Problem

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.

the optimal assignment Schedule is:

Person Job Cost


1 2 29
2 3 33
3 4 15
4 1 14
Total Minimum Cost: 91

45
Maximization Problem :

Sometimes the assignment problem deals with the maximization of the


objective function i.e., the problem may be to assign persons to the jobs in such
a way that the expected profit is maximized. Such maximization problem may
be solved by converting it to minimization problem. This is done converting the
profit matrix to the cost (i.e. loss) matrix in the following way:

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.

Then solve as usual by Hungarian Method for minimum loss.


In final optimal assignment schedule, instead of minimum cost, find maximum
profit using initial given matrix elements.
7. Solve the following Assignment Problem for Profit Maximization.

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.

We get the following opportunity loss matrix:

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

Now proceed as usual with Step 1 onwards of Hungarian Method.


Step 1: Subtract the minimum number of each row from all numbers in that row.

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.

the optimal assignment Schedule is:

Person Job Profit


1 3 40
2 5 36
3 1 40
4 4 36
5 2 62
Total Maximum Profit: 214

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.

Delhi - Jaipur Jaipur - Delhi


Fligth No Departure Arrival Flight No Departure Arrival
1 7.00 am 8.00 am 101 8.00 am 9.15 am
2 8.00 am 9.00 am 102 8.30 am 9.45 am
3 1.30 pm 2.30 pm 103 12.00 noon 1.15 pm
4 6.30 pm 7.30 pm 104 5.30 pm 6.45 pm

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:

Layover time in quarter hours when crew based at delhi.


Flight 101 102 103 104
1 96 98 112 38
2 92 94 108 34
3 70 72 86 108
4 50 52 66 88

And layover time in quarter hours when crew based at Jaipur.

Flight 101 102 103 104


1 87 85 71 49
2 91 89 75 53
3 113 111 97 75
4 37 35 21 95

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.

Minimum Layover times matrix

87* 85* 71* 38

91* 89* 75* 34

70 72 86 75*

37* 35* 21* 88

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

49* 45* 33* 0  3

 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

16* 12* 0* 100  5

 
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

You might also like