Assignment PDF
Assignment PDF
Assignment Model
2
Assignment Model
Many situations where the assignment of people,
machines, and so on may be called for: for example
4
Assignment Model
The general assignment model with n workers and n
jobs can be written in n n matrix form as
Jobs
W 1 2 j n
O 1 c11 c12 c1j c1n
R 2
K .
E i ci1 cij cin
R .
S n cn1 cn2 cnj cnn
Cost or effectiveness matrix 5
Assignment Model
where
The element cij is the cost of assigning the worker
i to the job j (i, j = 1, 2, , n).
7
Assignment Model
The assignment model is actually a special case of
the transportation model in which
x
i 1
ij 1 for j 1,..., n
10
The Hungarian algorithm
Consists of two phases.
11
Example 1
Consider the assignment problem:
Job
I II III IV
W
A 8 6 5 7
O
R
B 6 5 3 4
K C 7 8 4 6
E
R D 6 7 5 6
12
The Hungarian algorithmPhase-1
1. If the no. of rows are not equal to the no. of
columns and vice versa, then a dummy row or
column must be added with zero cost elements.
2. Subtract the minimum value of each row from
the entries of that row. Therefore, there will be at
least one zero in each row of this new matrix
which is called the first reduced cost matrix.
3. In the reduced cost matrix, subtract the minimum
value of each column from the entries of that
column. As a result, there would be at least one
zero in each row and in each column of the
second reduced cost matrix.
Treat the resulting matrix as the input for phase 2.
13
The Hungarian algorithmPhase-2
Now we test whether an assignment can be made
as follows. If such an assignment is possible, it is
the optimal assignment.
(a) Examine the first row. If there is only one zero
in that row, surround it by a square ( 0 ) and cross
( ) all the other zeros in the column passing
through the surrounded zero.
Next examine the other rows and repeat the above
procedure for each row having only one zero.
If a row has more than one zero, do nothing to that row
and pass on to the next row.
14
The Hungarian algorithmPhase-2
4. (b) Now repeat the above procedure for columns
of the reduced cost matrix.
Repeat step (a) and (b) until all zeros are either
assigned or crossed out.
15
The Hungarian algorithm
16
The Hungarian algorithm
17
The Hungarian algorithm
Solve the following unbalanced assignment problem
(Only one job to one man and only one man to
one job):
7 5 8 4
5 6 7 4
8 7 9 8
1 2 3 0
1 0 2 1
0 0 0 0
21
Example-3
Solve the following assignment problem
I II III IV V
A 3 8 2 10 3
B 8 7 2 9 7
C 6 4 2 7 5
D 8 4 2 3 5
E 9 10 6 9 10
22
Example 3
Solve the following assignment problem
I II III IV V VI
A 9 22 58 11 19 27
B 43 78 72 50 63 48
C 41 28 91 37 45 33
D 74 42 27 49 39 32
E 36 11 57 22 25 18
F 3 56 53 31 17 28
23
Determine the maximum number of
assignments possible:
1. Tick all unassigned rows.
2. If a row is ticked and has a zero, then tick the
corresponding column (if the column is not yet
ticked).
3. If a column is ticked and has an assignment, then
tick the corresponding row (if the row is not yet
ticked).
4. Repeat steps 2 and 3 till no more ticking is possible.
5. Draw lines through unticked rows and ticked
columns. The number of lines represent the
maximum number of assignments possible.
24
Creating a new assignment matrix:
25
Example:
Solve the following assignment problem
11 7 10 17 10
13 21 7 11 13
13 13 15 13 14
18 10 13 16 14
12 8 16 19 10
26
Theorem 1
Suppose that C = (cij) be the cost matrix for an n n
assignment problem and X = (xij) be an optimal
solution to this problem.
27
Constrained assignment problem
28
Constrained assignment problem
29
Example 1
You are given about the cost of performing different
jobs by different persons. The job-person
combination marking indicates that the individual
cannot perform the particular job. Using this
information, state (i) the optimal assignment of jobs
and (ii) the cost of such assignment.
J1 J2 J3 J4 J5
M1 27 18 20 21
M2 31 24 21 12 17
M3 20 17 20 16
M4 22 28 20 16 27
30
Example 2
Find the minimum number of hours required to
complete the jobs J1, J2, J3 and J4 by the persons
M1, M2, M3 and M4 under the restriction that job J3
cannot be assigned to person M2. The assignment
table is given by
J1 J2 J3 J4
M1 4 4 10 5
M2 6 6 13 8
M3 5 8 2 2
M4 9 13 7 7
31