Upload
gopalakrishnan-kuppuswamy
View
224
Download
0
Embed Size (px)
Citation preview
8/22/2019 Easy Learning - Assignment Problems
1/48
Operations Research Unit 7
Sikkim Manipal University 1
ASSIGNMENT PROBLEM
Consider a small manufacturing unit and imagine you are the manager of this unit.
If there is only one machine and one worker to operate the machine, how would you employ the worker?
Your immediate answer might be, the available worker will operate the machine.
Suppose two machines and two workers are engaged at different rates to operate the machines, which worker must operate
which machine to ensure maximum profit?
Similarly, if there are n machines available and n workers are engaged at different rates to operate them, which worker
should be assigned to which machine to ensure maximum efficiency?
In such situations, while answering the above questions, you will have to find such an assignment which offers maximum
profit on minimum cost. Such problems are known as " Assignment Problems" .
The Assignment Problem is a special case of Transportation Problem. It deals with assigning equal number of resources to
equal number of activities on one to one basis so as to minimize the total cost/time or maximize total profit of allocation.
The Assignment Model is useful in solving problems such as assignment of machines to jobs, assignment of salesman to
sales territories, travelling salesman problem and many more similar situations.
8/22/2019 Easy Learning - Assignment Problems
2/48
Operations Research Unit 7
Sikkim Manipal University 2
STRUCTURE OF ASSIGNMENT PROBLEM
The structure of assignment problem of assigning operators to jobs is shown below:
Operators
Jobs
1 2 j n
1 C11 C12 . C1j C1n
2 C21 C22 . C2j C2n
. . . . . . .
i Ci1 Ci2 ..... Cij Cin
. . . . . .
n Cn1 Cn2 . Cnj . Cnn
Let there be n number of jobs and n number of operators.
The Operators are to be assigned to jobs on one to one basis.
Let Cijbe the cost of assigning ith
operator to jth
job (C11be the cost of assigning 1st
operator to the 1st
job, C12be the cost of
assigning 1st operator to the 2nd job and so on).
Xij denotes the assignment of ith
operator to jth
job.
Now the problem is which job is to be assigned to which operator so that the cost of completion of work will be minimum.
8/22/2019 Easy Learning - Assignment Problems
3/48
Operations Research Unit 7
Sikkim Manipal University 3
Mathematically, we can express the problem as follows:
To minimize Z (cost) = ]n...2,1j;n...2,1iijxn
1j
n
1iijC
1; if ith
operator is assigned to the jth
job
Where xij =
0; if ith
operator is not assigned to the jth
job
With the restrictions,
1. n....3,2,1j;1n
1i ijx
, ie the i
thoperator will work on only one job
2. n....3,2,1i;1n
1j ijx
, ie thej
thjob will be done only by one operator
NETWORK REPRESENTATION OF ASSIGNMENT PROBLEM
For an operator job assignment problem, the time taken (in mins) by operators to perform the jobs is given below:
Operators
Jobs
1 2 3
A 10 16 7
B 9 17 6
C 6 13 5
8/22/2019 Easy Learning - Assignment Problems
4/48
Operations Research Unit 7
Sikkim Manipal University 4
An assignment problem can be viewed as a transportation problem in which the capacity from each source is 1 and the
demand at each destination is 1
Source Destination
1 1
Capacity
1
Demand
1
1
Time taken (in mins)
1
JOB1
JOB
2
JOB3
OPERATOR
B
OPERATORC
OPERATOR
A
10
16
7
9
17
6
6
13
5
8/22/2019 Easy Learning - Assignment Problems
5/48
Operations Research Unit 7
Sikkim Manipal University 5
TYPES OF ASSIGNMENT PROBLEM
Balanced Assignment Problem: If in an assignment problem, number of rows is equal to number of columns or if a given
problem is a square matrix, then the problem is termed as a Balanced Assignment Problem.
Unbalanced Assignment Problem: If in an assignment problem, number of rows is not equal to number of columns or if a
given problem is not a square matrix, then the problem is termed as an Unbalanced Assignment Problem.
The fol lowing example will help you in understanding the Assignment Problem.
Example 1:
Three Operators A, Band C are to be assigned to three Jobs J1, J2 and J3. The cost of assigning each Operator to each
Job (in Rs.) is given in the following matrix. Find which Operator is to be assigned to which Job so as to minimize the
total cost.
Operators
Jobs
J1 J2 J3
A 4 2 7
B 8 5 3
C 4 5 6
8/22/2019 Easy Learning - Assignment Problems
6/48
Operations Research Unit 7
Sikkim Manipal University 6
Solution:
Here the objective of this assignment problem is to assign Operators (3) to the Jobs (3) in a way that will result in total
minimum cost.
In order to find the assignment, we apply the Hungarian algorithmas follows:
Step 1: Prepare the square matrix
The given matrix is a square matrix [Number of rows (Operators) = Number of columns (Jobs)].
Step 2: Reduce the Matrix Row Wise
Prepare a row reduced matrix by selecting the smallest element in each row of the matrix and subtracting this smallest
element from all the other elements in the row. This gives an opportunity cost matrix with at least one zero in each row.
8/22/2019 Easy Learning - Assignment Problems
7/48
Operations Research Unit 7
Sikkim Manipal University 7
Identify the smallest element of each row.
Operators Jobs Row Minimum
J1 J2 J3
A 4 2 7 2
B 8 5 3 3
C 4 5 6 4
The smallest element of each row is subtracted from the elements of the respective row to get a reduced matrix.
Operators
Jobs
J1 J2 J3
A 42= 2 2 - 2=0 7 - 2= 5
B 8 - 3= 5 53= 2 33= 0
C 44 = 0 5 - 4 = 1 64 =2
The reduced matrix is:
Operators
Jobs
J1 J2 J3A 2 0 5
B 5 2 0
C 0 1 2
8/22/2019 Easy Learning - Assignment Problems
8/48
Operations Research Unit 7
Sikkim Manipal University 8
Step 3: Reduce the Matrix Column Wise
In the reduced matrix given in step 2, determine the smallest element in each column and subtract this smallest element
from all the other elements in the column. This gives an opportunity cost matrix with at least one zero in each column.
In the reduced matrix given in step 2, identify the smallest element of each Column.
OperatorsJobs
J1 J2 J3
A 2 0 5
B 5 2 0
C 0 1 2
Column M inimum 0 0 0
The smallest element of each column is subtracted from the elements of the respective column to get a reduced matrix.
Operators
Jobs
J1 J2 J3
A 20 = 2 00 = 0 50 = 5
B 5 - 0= 5 20 = 2 00 = 0
C 0 - 0 = 0 10 = 1 20 = 2
8/22/2019 Easy Learning - Assignment Problems
9/48
Operations Research Unit 7
Sikkim Manipal University 9
The reduced matrix is:
Operators
Jobs
J1 J2 J3
A 2 0 5
B 5 2 0
C 0 1 2
Step 4: In the reduced matrix given in step 3, search for optimum solution as follows:
Make Assignment as follows:
If there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) and crossing (X) or
cancelling other zeros in its column. Continue the process till all the rows in the matrix is examined.
In the reduced matrix given in step 3, first row has only one zero (cell 1,2) and hence make assignment by enclosing
this zero by a square ( ). Similarly, second and third row has only one zero and hence make assignment by
enclosing this zero by a square ( ).
Operators
Jobs
J1 J2 J3
A 2 5
B 5 2
C 1 2
8/22/2019 Easy Learning - Assignment Problems
10/48
Operations Research Unit 7
Sikkim Manipal University 10
Note:
After examining the rows, examine the columns successfully until a column with exactly one zero is found. Make
assignment by enclosing this zero by a square ( ) and cross (X) or cancel other zeros in its row.
In case of atleast two zeros in a particular row and column is found, choose arbitrarily any one of these and cross out all
other zeros of that row and column.
Repeat step 4 till all zeros are either assigned or crossed.
If the number of assignments is equal to number of rows/columns, you have arrived at an optimal solution.
In this problem, all zeros are either crossed out or assigned. Also number of assignments (3) is equal to number of
rows/columns (3). As the number of assignments is equal to the number of rows/columns, solution is optimal.
The optimal allocation is to assign Operator Ato Job J2, Operator Bto Job J3 and Operator C to Job J1. The total cost (in Rs.)
of this assignment is computed from the original table.
Operators
Jobs
J1 J2 J3
A 2 5
B 5 2
C 1 2
Original Table:
Operators
Jobs
J1 J2 J3
A 4 2 7B 8 5 3
C 4 5 6
8/22/2019 Easy Learning - Assignment Problems
11/48
Operations Research Unit 7
Sikkim Manipal University 11
The optimal assignment is:
Operators Jobs Cost of assignment
(Rs.)
A J2 2
B J3 3
C J1 4
Total 9
The total number of steps in the above problem: 4 Steps
Step1: Check for Number of rows (Operators) = Number of columns
(Jobs)Result of 1st step: A square matrix
Step 2: Select the smallest element in each row of the matrix andsubtract this smallest element from all the other elements in the row.
Result of 2nd step: Row Reduced matrix
Step 3: In the reduced matrix given in step 2, select the smallest element
in each column and subtract this smallest element from all the other
elements in the column.
Result of 3rd
step: Column Reduced matrix
Step 4: In the reduced matrix given in step 3, search for optimum
solution by making assignments as follows:If there is only one zero in a row, an assignment is made by enclosing
this zero by a square ( ) and crossing (X) or cancelling other zeros in
its column. Continue the process till all the rows in the matrix isexamined.
Result of 4th step: All zeros are either crossed outor assigned and the number ofassignments is equal to the
number of rows/columns,
therefore the solution is optimal
8/22/2019 Easy Learning - Assignment Problems
12/48
Operations Research Unit 7
Sikkim Manipal University 12
Example 2:
Five machines M1, M2, M3, M4 and M5 are to be assigned to five jobs J1, J2, J3, J4, J5. The cost of assigning each
machine to each job in Rs. is given in the following matrix. Find which machine is to be assigned to which job so as to
minimize the total cost of assigning machines to jobs.
MachinesJobs
J1 J2 J3 J4 J5
M1 11 17 8 16 20
M2 9 7 12 6 15
M3 13 16 15 12 16
M4 21 24 17 28 26
M5 14 10 12 11 15
Solution:
Here the objective of this assignment problem is to assign Machines (5) to the Jobs (5) in a way that will result in total
minimum cost.
In order to find the assignment we apply the Hungarian algorithmas follows:
8/22/2019 Easy Learning - Assignment Problems
13/48
Operations Research Unit 7
Sikkim Manipal University 13
Step 1: Prepare the square matrix
The given matrix is a square matrix [Number of rows (Machines) = Number of columns (Jobs)].
Step 2: Reduce the Matrix Row Wise
Prepare row reduced matrix by selecting the smallest element in each row of the matrix and subtracting this smallest
element from all the other elements in the row. This gives an opportunity cost matrix with at least one zero in each row.
Identify the smallest element of each row.
Machines
Jobs Row Minimum
J1 J2 J3 J4 J5
M1 11 17 8 16 20 8
M2 9 7 12 6 15 6
M3 13 16 15 12 16 12
M4 21 24 17 28 26 17M5 14 10 12 11 15 10
8/22/2019 Easy Learning - Assignment Problems
14/48
Operations Research Unit 7
Sikkim Manipal University 14
The smallest element of each row is subtracted from the elements of the respective row to get a reduced matrix.
Machines
Jobs
J1 J2 J3 J4 J5
M1 11-8 = 3 17-8=9 8-8=0 16-8=8 20-8=12
M2 9-6=3 7-6=1 12-6=6 6-6=0 15-6=9
M3 13-12=1 16-12=4 15-12=3 12-12=0 16-12=4M4 21-17=4 24-17=7 17-17=0 28-17=11 26-17=9
M5 14-10=4 10-10=0 12-10=2 11-10=1 15-10=5
The reduced matrix is:
Machines
Jobs
J1 J2 J3 J4 J5
M1 3 9 0 8 12
M2 3 1 6 0 9
M3 1 4 3 0 4
M4 4 7 0 11 9
M5 4 0 2 1 5
8/22/2019 Easy Learning - Assignment Problems
15/48
Operations Research Unit 7
Sikkim Manipal University 15
Step 3: Reduce the Matrix Column Wise
In the reduced matrix given in step 2, determine the smallest element in each column and subtract this smallest element
from all the other elements in the column. This gives an opportunity cost matrix with at least one zero in each column.
In the reduced matrix given in step 2, identify the smallest element of each Column.
MachinesJobs
J1 J2 J3 J4 J5
M1 3 9 0 8 12
M2 3 1 6 0 9
M3 1 4 3 0 4
M4 4 7 0 11 9
M5 4 0 2 1 5
Column minimum 1 0 0 0 4
8/22/2019 Easy Learning - Assignment Problems
16/48
Operations Research Unit 7
Sikkim Manipal University 16
The smallest element of each column is subtracted from the elements of the respective column to get a reduced matrix.
Machines
Jobs
J1 J2 J3 J4 J5
M1 3-1=2 9-0=9 0-0=0 8-0=8 12-4=8
M2 3-1=2 1-0=1 6-0=6 0-0=0 9-4=5
M3 1-1=0 4-0=4 3-0=3 0-0=0 4-4=0M4 4-1=3 7-0=7 0-0=0 11-0=11 9-4=5
M5 4-1=3 0-0=0 2-0=2 1-0=1 5-4=1
The reduced matrix is:
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 0 8 8
M2 2 1 6 0 5
M3 0 4 3 0 0
M4 3 7 0 11 5
M5 3 0 2 1 1
8/22/2019 Easy Learning - Assignment Problems
17/48
Operations Research Unit 7
Sikkim Manipal University 17
Step 4: In the reduced matrix given in step 3, search for optimum solution as follows:
Make Assignment as follows:
If there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) and crossing (X) or
cancelling other zeros in its column. Continue the process till all the rows in the matrix is examined.
In the reduced matrix given in Step 3,a. First row has only one unmarked zero (cell 1, 3) and hence make assignment by enclosing this zero by a square ( ) and
mark (X) to the zeros in the same column (cell 4,3).
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 0 5
M3 0 4 3 0 0
M4 3 7 11 5
M5 3 0 2 1 1
8/22/2019 Easy Learning - Assignment Problems
18/48
Operations Research Unit 7
Sikkim Manipal University 18
b. In the second row the cell (2,4) contains one unmarked zero and hence make assignment by enclosing this zero by a
square ( ) and mark (X) to the zeros in the same column (cell 3,4).
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 0 4 3 0
M4 3 7 11 5
M5 3 0 2 1 1
c. In the fifth row there is only one unmarked zero in cell (5,2) and hence make assignment by enclosing this zero by a
square ( ) .
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 0 4 3 0M4 3 7 11 5
M5 3 2 1 1
8/22/2019 Easy Learning - Assignment Problems
19/48
Operations Research Unit 7
Sikkim Manipal University 19
d. After examining the rows, examine the columns successfully until a column with exactly one zero is found. Make
assignment by enclosing this zero by a square ( ) and cross (X) or cancel other zeros in its row.
The first column contains one unmarked zero in cell (3,1) and hence make assignment by enclosing this zero by a square (
) and mark (X) to the zero in the same row in (cell 3,5).
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
In this problem, all zeros are either crossed out or assigned. Also number of assignments (4) is not equal to number of
rows/columns(5). As the number of assignments is not equal to the number of rows/columns, solution is not optimal.
Since one row and one column are not assigned, optimal assignment is not possible in the current matrix and hence find
minimum number of lines crossing all zeros.
Step 5: Find minimum number of lines required to cross all zeros.
Draw minimum number of horizontal/vertical lines to cover all the zeroes in the resulting matrix:
8/22/2019 Easy Learning - Assignment Problems
20/48
Operations Research Unit 7
Sikkim Manipal University 20
This consists of the following sub steps:
a. Mark () the row that do not have assignment. In this case it is the 4th row.
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
b. Mark () the column which contains zeros in marked row. In this case it is the 3rd
column.
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
8/22/2019 Easy Learning - Assignment Problems
21/48
Operations Research Unit 7
Sikkim Manipal University 21
c. Mark () the row which contains assignment in the marked column. In this case it is the 1st
row.
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
d. Draw the lines through unmarked rows and marked columns.
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
8/22/2019 Easy Learning - Assignment Problems
22/48
Operations Research Unit 7
Sikkim Manipal University 22
e. Revise the matrix as follows:
Examine the uncovered elements (on which there are no lines). Find the smallest element among the uncovered elements of
the table. Here the smallest element is 2.
Subtract this element (2) from the uncovered elements.
Add this element (2) to all the values at the point of intersection of any two of the lines.
Other elements crossed by the lines remain unchanged.Given matrix:
Machines
Jobs
J1 J2 J3 J4 J5
M1 2 9 8 8
M2 2 1 6 5
M3 4 3
M4 3 7 11 5
M5 3 2 1 1
The smallest element is 2.
8/22/2019 Easy Learning - Assignment Problems
23/48
Operations Research Unit 7
Sikkim Manipal University 23
Revised matrix:
Machines
Jobs
J1 J2 J3 J4 J5
M1 0 7 0 6 6
M2 2 1 8 0 5
M3 0 4 5 0 0
M4 1 5 0 9 3
M5 3 0 4 1 1
Repeat Step 4 to make assignments.
Machines
Jobs
J1 J2 J3 J4 J5
M1 7 6 6
M2 2 1 8 5
M3 4 5
M4 1 5 9 3
M5 3 4 1 1
Since all the rows and columns are assigned or number of rows/columns is equal to number of assignments, this is an
optimal assignment.
8/22/2019 Easy Learning - Assignment Problems
24/48
Operations Research Unit 7
Sikkim Manipal University 24
The optimal allocation is to assign Machine M1 to J 1, M2 to J4, M3 to J5, M4 to J3, M5 to J2 . The total cost (in Rs.) of this
assignment is computed from the original table.
Machines
Jobs
J1 J2 J3 J4 J5
M1 7 6 6
M2 2 1 8 5
M3 4 5
M4 1 5 9 3
M5 3 4 1 1
Original Table:
Machines
Jobs
J1 J2 J3 J4 J5
M1 11 17 8 16 20
M2 9 7 12 6 15
M3 13 16 15 12 16M4 21 24 17 28 26
M5 14 10 12 11 15
The optimal assignment is:
Machine Jobs Cost of assignment
(Rs.)
M1 J1 11
M2 J4 06
M3 J5 16
M4 J3 17
M5 J2 10
Total 60
8/22/2019 Easy Learning - Assignment Problems
25/48
Operations Research Unit 7
Sikkim Manipal University 25
SPECIAL CASES IN ASSIGNMENT PROBLEM
1. Unbalanced Assignment Problem
Unbalanced assignment problem is a problem where the number of rows is not equal to the number of columns and vice
versa. For example, the number of machines may be more than the number of jobs or the number of jobs may be more than
the number of machines. In such a situation, you will have to introduce dummy rows or columns in the matrix. The dummy
rows or columns will contain all cost elements as zero. This balances the problem and then you can use Hungarian methodto find the optimal assignment.
Example 3:
Suppose six operators are to be assigned to five jobs and the cost of assignment in Rs. is given in the matrix below.
Operators Jobs
J1 J2 J3 J4 J5
1 6 2 5 2 6
2 2 5 8 7 7
3 8 9 5 4 7
4 2 5 6 8 9
5 3 7 6 5 96 5 4 7 9 5
The given problem is an Unbalanced Assignment Problem since the number of Operators is not equal to the number of
Jobs. The given matrix is not a square matrix and hence introduce a dummy column (fictitious Job 6) to make it a square
matrix with zero cost for the dummy column.
8/22/2019 Easy Learning - Assignment Problems
26/48
Operations Research Unit 7
Sikkim Manipal University 26
Therefore the Balanced Assignment Problem is:
Operators Jobs
J1 J2 J3 J4 J5 J6
1 6 2 5 2 6 0
2 2 5 8 7 7 0
3 8 9 5 4 7 0
4 2 5 6 8 9 0
5 3 7 6 5 9 0
6 5 4 7 9 5 0
Example 4:
Suppose five operators are to be assigned to six jobs and the cost of assignment in Rs. is given in the matrix below.
Operators Jobs
J1 J2 J3 J4 J5 J6
1 6 2 5 2 6 5
2 2 5 8 7 7 2
3 8 9 5 4 7 9
4 2 5 6 8 9 6
5 3 7 6 5 9 7
8/22/2019 Easy Learning - Assignment Problems
27/48
Operations Research Unit 7
Sikkim Manipal University 27
The given problem is an Unbalanced Assignment Problem since the number of Operators is not equal to the number of
Jobs. The given matrix is not a square matrix and hence introduce a dummy row (fictitious Operator 6) to make it a square
matrix with zero cost for the dummy row.
Therefore the Balanced Assignment Problem is:
Operators Jobs
J1 J2 J3 J4 J5 J6
1 6 2 5 2 6 5
2 2 5 8 7 7 2
3 8 9 5 4 7 9
4 2 5 6 8 9 6
5 3 7 6 5 9 7
6 0 0 0 0 0 0
2. Restrictions on Assignment or Impossible Assignments
It is sometimes possible that a particular person is incapable of doing certain job or a specific job cannot be performed on a
particular machine. The solution of the assignment problem should take into account these restrictions so that the infeasible
assignment can be avoided. This can be achieved by assigning a very high cost (say or M) to the cells where assignments
are prohibited, thereby, restricting the entry of this pair of job machine or resourceactivity into the final solution. After
inserting a high value at the cell we need to apply Hungarian method to solve the problem.
8/22/2019 Easy Learning - Assignment Problems
28/48
Operations Research Unit 7
Sikkim Manipal University 28
Example 5:
The cost of performing different tasks by different persons is given below. The task-person marking (x) indicates that the
individual involved cannot perform the particular task. Using this information, determine the optimal assignment.
Tasks
Persons
P1 P2 P3 P4
T1 20 x 32 27
T2 15 20 17 18
T3 16 18 x 20
T4 x 20 18 24
Solution: Assign a cost of to the cells wherever there is a restriction on assignment.
The resulting matrix is:
Tasks
Persons
P1 P2 P3 P4
T1 20 32 27
T2 15 20 17 18
T3 16 18 20
T4 20 18 24
8/22/2019 Easy Learning - Assignment Problems
29/48
Operations Research Unit 7
Sikkim Manipal University 29
Here the objective of this assignment problem is to assign Tasks (4) to the Persons (3) in a way that will result in total
minimum cost.
In order to find the assignment, we apply the Hungarian algorithmas follows:
Step 1: Prepare the square matrix
The given matrix is a square matrix [Number of rows (Tasks) = Number of columns (Persons)].
Step 2: Reduce the Matrix Row Wise
Prepare row reduced matrix by selecting the smallest element in each row of the matrix and subtracting this smallest
element from all the other elements in the row.
The reduced matrix is:
Tasks
Persons
P1 P2 P3 P4
T1 0 12 7
T2 0 5 2 3
T3 0 2 4
T4 2 0 6
8/22/2019 Easy Learning - Assignment Problems
30/48
Operations Research Unit 7
Sikkim Manipal University 30
Step 3: Reduce the Matrix Column Wise
In the reduced matrix given in step 2, determine the smallest element in each column and subtract this smallest element
from all the other elements in the column.
The reduced matrix is:
Tasks
Persons
P1 P2 P3 P4
T1 0 12 4
T2 0 3 2 0T3 0 0 1
T4 0 0 3
Step 4: In the reduced matrix given in step 3, search for optimum solution as follows:
Make Assignment as follows:
If there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) and crossing (X) or
cancelling other zeros in its column. Continue the process till all the rows in the matrix is examined.
Tasks
Persons
P1 P2 P3 P4
T1 12 4
T2 3 2
T3 1
T4 3
8/22/2019 Easy Learning - Assignment Problems
31/48
Operations Research Unit 7
Sikkim Manipal University 31
In this problem, all zeros are either crossed out or assigned. Also number of assignments (4) is equal to number of
rows/columns (4). As the number of assignments is equal to the number of rows/columns, solution is optimal.
The optimal allocation is to assign Tasks T1 to Person P1, T2 to P4, T3 to P2, and T4 to P3 . The total cost (in Rs.) of this
assignment is computed from the original table.
The optimal assignment is:
Tasks Persons Cost of assignmentT1 P1 20
T2 P4 18
T3 P2 18
T4 P3 18
Total 74
3. Multiple Optimal Solutions
While making assignment in the reduced assignment matrix, it is possible to have two or more ways to strike off certain
number of zeroes. In such cases, assignments are to be made arbitrarily and hence assignments can be made in many ways.Such a situation indicates multiple optimum solutions with the same total cost (or profit). If the problem has only one
solution then the solution is said to be Unique solution.
8/22/2019 Easy Learning - Assignment Problems
32/48
Operations Research Unit 7
Sikkim Manipal University 32
4. Maximization Problems
In Maximization Problems, the objective is to maximize the profit, revenue etc. In such problems, the given maximization
problems may be converted into minimization problem by subtracting all profits from the highest element of the profit
matrix. This transformed matrix or the opportunity cost matrix can be solved by using the Hungarian method.
Example 6:A marketing manager has 5 salesmen and 5 sales districts. Considering the capabilities of the salesman and the nature of
districts, the marketing manager estimates that the sales per month (in hundred rupees) for each salesman in each district
would be as follows. Find the assignment of salesmen to districts that will result in maximum sales.
Salesman
Sales Districts
A B C D E
1 32 38 40 28 40
2 40 24 28 21 36
3 41 27 33 30 37
4 22 38 41 36 36
5 29 33 40 35 39
8/22/2019 Easy Learning - Assignment Problems
33/48
Operations Research Unit 7
Sikkim Manipal University 33
Solution:
The given maximization problem is converted into minimization problem by subtracting from the highest sales value (i.e.,
41) with all the elements of the given table. The cost data obtained is given in the table below:
Salesmen
Sales Districts
A B C D E
1 9 3 1 13 1
2 1 17 13 20 5
3 0 14 8 11 4
4 19 3 0 5 5
5 12 8 1 6 2
In order to find the assignment, we apply the Hungarian algorithmas follows:
Step 1: Prepare the square matrix
The given matrix is a square matrix [Number of rows (Salesmen) = Number of columns (Sales Districts)].
Step 2: Reduce the Matrix Row WisePrepare row reduced matrix by selecting the smallest element in each row of the matrix and subtracting this smallest
element from all the other elements in the row.
8/22/2019 Easy Learning - Assignment Problems
34/48
Operations Research Unit 7
Sikkim Manipal University 34
The reduced matrix is:
Salesmen
Sales District
A B C D E
1 8 2 0 12 0
2 0 16 12 19 4
3 0 14 8 11 4
4 19 3 0 5 5
5 11 7 0 5 1
Step 3: Reduce the Matrix Column Wise
In the reduced matrix given in step 2, determine the smallest element in each column and subtract this smallest element
from all the other elements in the column.
The reduced matrix is:
Salesmen
Sales District
A B C D E
1 8 0 0 7 0
2 0 14 12 14 4
3 0 12 8 6 44 19 1 0 0 5
5 11 5 0 0 1
8/22/2019 Easy Learning - Assignment Problems
35/48
Operations Research Unit 7
Sikkim Manipal University 35
Step 4: In the reduced matrix given in step 3, search for optimum solution as follows:
Make Assignment as follows:
If there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) and crossing (X) or
cancelling other zeros in its column. Continue the process till all the rows in the matrix is examined.
After examining the rows, examine the columns successfully until a column with exactly one zero is found. Make
assignment by enclosing this zero by a square ( ) and cross (X) or cancel other zeros in its row.
In case of atleast two zeros in a particular row and column is found, choose arbitrarily any one of these and cross out allother zeros of that row and column.
Repeat step 4 till all zeros are either assigned or crossed.
If the number of assignments is equal to number of rows/columns, you have arrived at an optimal solution.
Salesmen
Sales District
A B C D E
1 8 7
2 14 12 14 4
3 12 8 6 4
4 19 1 5
5 11 5 1
8/22/2019 Easy Learning - Assignment Problems
36/48
Operations Research Unit 7
Sikkim Manipal University 36
From the last table we see that the total number of assignment i.e., 4 < 5 (Number of rows or columns). If the number of
assignment is not equal to number of rows/columns then the solution is not optimal.
Since one row and one column are not assigned, optimal assignment is not possible in the current matrix and hence find
minimum number of lines crossing all zeros.
Step 5: Find minimum number of lines required to cross all zeros.
Draw minimum number of horizontal/vertical lines to cover all the zeroes in the resulting matrix:This consists of the following sub steps:
a. Mark () the row that do not have assignment. In this case it is the 3rd
row.
Salesmen
Sales District
A B C D E
1 8 7
2 14 12 14 4
3 12 8 6 4
4 19 1 5
5 11 5 1
8/22/2019 Easy Learning - Assignment Problems
37/48
Operations Research Unit 7
Sikkim Manipal University 37
b. Mark () the column which contains zeros in marked row. In this case it is the 1st
column.
Salesmen
Sales District
A B C D E
1 8 7
2 14 12 14 4
3 12 8 6 4
4 19 1 5
5 11 5 1
c. Mark () the row which contains assignment in the marked column. In this case it is the 2nd
row.
Salesmen
Sales District
A B C D E
1 8 7
2 14 12 14 4
3 12 8 6 4
4 19 1 5
5 11 5 1
8/22/2019 Easy Learning - Assignment Problems
38/48
Operations Research Unit 7
Sikkim Manipal University 38
d. Draw the lines through unmarked rows and marked columns.
Salesmen
Sales District
A B C D E
1 8 7
2 14 12 14 4
3 12 8 6 4
4 19 1 5
5 11 5 1
e. Revise the matrix as follows:
Examine the uncovered elements (on which there are no lines). Find the smallest element among the uncovered elements of
the table. Here the smallest element is 4.
Subtract this element (4) from the uncovered elements.
Add this element (4) to all the values at the point of intersection of any two of the lines.
Other elements crossed by the lines remain unchanged.
8/22/2019 Easy Learning - Assignment Problems
39/48
Operations Research Unit 7
Sikkim Manipal University 39
The revised matrix is :
Salesmen
Sales District
A B C D E
1 12 0 0 7 0
2 0 10 8 10 0
3 0 8 4 2 0
4 23 1 0 0 55 15 5 0 0 1
Repeat Step 4 to make assignment.
There are two alternative assignments due to presence of zero elements in cells (4, C), (4, D), (5, C) and (5, D).
8/22/2019 Easy Learning - Assignment Problems
40/48
Operations Research Unit 7
Sikkim Manipal University 40
Two Alternative Assignments
Salesmen
Sales District
A B C D E
1 12 7
2 10 8 10
3 8 4 2
4 23 1 55 15 5 1
Salesmen
Sales District
A B C D E
1 12 7
2 10 8 10
3 8 4 2
4 23 1 55 15 5 1
Since all the rows and columns are assigned or number of rows/columns (5) is equal to number of assignments (5), this is an
optimal assignment. The maximum sales (in Rs.) of this assignment is computed from the original table.
The two optimal assignments are as follows:
Assignment Set 1
Salesmen District Sales (00) Rs
1 B 38
2 A 40
3 E 374 C 41
5 D 35
Total Rs.= 191.00
Assignment Set II
Salesmen District Sales (00) Rs
1 B 38
2 E 36
3 A 414 C 41
5 D 35
Total Rs.= 191.00
Therefore the Maximum sales is Rs. 19,100.
8/22/2019 Easy Learning - Assignment Problems
41/48
Operations Research Unit 7
Sikkim Manipal University 41
TRAVELLING SALESMAN PROBLEM
The Travelling Salesman Problem is very similar to an Assignment problem.
Suppose a salesman wants to visit n cities. He wishes to start from a particularcity and wants to visit each city only once
and return to his starting point. The objective is to select the sequence to visit the cities in such a way that his total distance
(cost or time) is minimized. Such a problem is known as travelling salesman problem.
Example 7:
A salesman has to visit five cities A, B, C, D and E. He wishes to start from a particular city, visit each city once and thenreturn to his starting point. The travelling cost (in thousands of Rs.) of each city from a particular city is given below.
To City
From City
A B C D E
A 2 5 7 1
B 6 3 8 2
C 8 7 4 7
D 12 4 6 5
E 1 3 2 8
What should be the sequence of the salesman's visit, so that the cost is minimum?
Solution:In order to find an optimum assignment to the given travelling salesman problem, first you should follow the
same procedure as followed in the assignment problem.
8/22/2019 Easy Learning - Assignment Problems
42/48
Operations Research Unit 7
Sikkim Manipal University 42
Step 1: Prepare the square matrix
The given matrix is a square matrix [Number of rows = Number of columns].
Step 2: Reduce the Matrix Row Wise
Prepare row reduced matrix by selecting the smallest element in each row of the matrix and subtracting this smallest
element from all the other elements in the row. The resultant matrix is;To City
From City
A B C D E
A 1 4 6 0
B 4 1 6 0
C 4 3 0 3
D 8 0 2 1
E 0 2 1 7
Step 3: Reduce the Matrix Column Wise
In the reduced matrix given in step 2, determine the smallest element in each column and subtract this smallest element
from all the other elements in the column.
8/22/2019 Easy Learning - Assignment Problems
43/48
Operations Research Unit 7
Sikkim Manipal University 43
The resultant matrix is
To City
From City
A B C D E
A 1 3 6 0
B 4 0 6 0
C 4 3 0 3
D 8 0 1 1E 0 2 0 7
Step 4: In the reduced matrix given in step 3, search for optimum solution as follows:
Make Assignment as follows:
If there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) and crossing (X) or
cancelling other zeros in its column. Continue the process till all the rows in the matrix is examined.
8/22/2019 Easy Learning - Assignment Problems
44/48
Operations Research Unit 7
Sikkim Manipal University 44
To City
From City
A B C D E
A 1 3 6
B 4 6
C 4 3 3
D 8 1 1
E 2 7
Optimum Assignment Table
A E 1
B C 3
C D 4
D B 4
E A 1
Total Cost 13
8/22/2019 Easy Learning - Assignment Problems
45/48
Operations Research Unit 7
Sikkim Manipal University 45
The optimum assignment table shows the solution to the assignment problem but not to the travelling salesman problem.
The following sequence can be identified from the above optimum solution table.
Sequence of the salesman:
A E A, B C D B
This represents that the travelling salesman will start from city A, then go to city E and return to city A without visiting the
other cities. This violates the additional restriction that the salesman can visit each city only once. The cycle is not
complete. Hence the problem can be improved.Case I: Now we examine the optimum assignment table to find the next best solution that satisfies the additional
restrictions. First identify the next minimum element in the assignment table. Here the next minimum element is 1. So we
make the unit assignment in the cell (A,B) instead of zero assignment in the cell (A,E) and delete the row A and column B
to avoid further assignment. Henceforth we proceed in the unit assignment as a routine assignment problem.
To City
From City
A B C D E
A 3 6
B 4 6
C 4 3 3
D 8 1
E 2 7
8/22/2019 Easy Learning - Assignment Problems
46/48
Operations Research Unit 7
Sikkim Manipal University 46
The sequence of the salesman is:
A BC D E A
Case 2: If the assignment is made for cell (D, C) instead of (D, E), the feasible solution cannot be obtained. The route for
the assignment will be A B E, C D C, E A.
To City
From City
A B C D EA 3 6
B 4 0 6
C 4 3 3
D 8 1
E 2 7
This violates the additional restriction and produces no feasible solution.
8/22/2019 Easy Learning - Assignment Problems
47/48
Operations Research Unit 7
Sikkim Manipal University 47
OptimumSequence
To City
From City
A B C D E
A 3 6
B 4 6
C 4 3 3
D 8 1
E 2 7
The sequence feasible for this assignment is
A B C D E A with the travelling cost of (2000 + 3000 + 4000 + 5000 + 1000) = Rs.15,000.00
8/22/2019 Easy Learning - Assignment Problems
48/48
Operations Research Unit 7
FLOW CHART FOR ASSIGNMENT PROBLEM
Yes
No
Yes
No
Yes
Arrange the data in a matrix form
Is it a
maximization
problem ?
Convert it into a minimization problem by
subtracting all the elements in the matrix from
the largest element in the matrix
Is it a
balancedproblem?
Add dummy row(s) and column(s)
nd opportunity costIdentify the smallest element in each row and subtract it from every element in that row
b. In the reduced matrix, identify the smallest element in each column and subtract it from every element
in that column
Make Assignment as follows:
there is only one zero in a row, an assignment is made by enclosing this zero by a square ( ) andossing (X) or cancelling other zeros in its column. Continue the process till all the rows in the matrix is
xamined. Repeat same process column-wise.
Is the number of
assignments equalto the number of
rows and columns ?
OPTIMAL SOLUTION
Revise opportunity cost tablea. Draw minimum possible lines on
columns and/or rows such that all zeros
are covered.b. Choose the smallest number not
covered by lines. Subtract it from itself
and every other uncovered numberc. Add this number at the intersection of
any two lines. Other elements crossed by
the lines remain unchanged.
No