03 - 2 Assignment Model
03 - 2 Assignment Model
04 - 1
Learning Objectives
When you complete this module you should be able
to:
• Understand the concept of assignment problem
• Know application areas of assignment problem
• Construct assignment model table
• Solve assignment model using the Hungarian algorithm
• Formulate and solve the assignment model using linear
programming approach
• Solve a TP problem using Excel Solver and GAMS softwares
04 - 2
The Assignment Model -Definition
In many business situations, management needs to assign jobs. For
example,
people to project assignments
Contracts to bidders
jobs to machines or machines to job locations,
salespersons to strategic market places, etc.
04 - 3
The Assignment Model -Definition
Consider the situation of assigning n jobs to n machines.
In assignment problem, when a job i (=1,2,....,n) is assigned to machine j (=1,2,
.....n) that incurs a cost Cij, the objective is to assign the jobs to machines at the
least possible total cost.
The important assumption is each job is done by one and only one machine.
The objective is to determine how all n tasks should be assigned to n
machines to minimize the total cost.
04 - 4
The Assignment Model -Definition
• Step 1:Subtract the minimum value of each row from the entries of
that row to obtain the next matrix.
• Step 2:Subtract the minimum value of each column from the entries
of that column to obtain the next matrix.
• Step 3: Draw a minimum number of lines to cover all the zeros of the
matrix.
6
The Hungarian Method Algorithm
3.1 Row scanning
1. Starting from the first row, if there’s only one zero in a row, mark the
zero entry and draw a vertical line passing through that zero.
Otherwise skip the row.
2. After scanning the last row, check whether all the zeros are covered
with lines. If yes go to step 4. Otherwise do column scanning.
2. After scanning the last column, check whether all the zeros are
covered with lines. Then Go to step 4.
7
The Hungarian Method Algorithm
• Step 4: Check whether the number of marked zeros is equal to the
number of rows/columns of the matrix. If yes go to step 7. Otherwise
go to step 5.
• Step 5: Identify the minimum value of the undeleted cell values, say
‘x’. Obtain the next matrix by the following steps.
5.1 copy the entries covered by the lines but not on the intersection
points.
5.2 add x to the intersection points
5.3 subtract x from the undeleted cell values.
Step 6: Go to step 3.
8
Hungarian Algorithm - Example
Example 1. Consider the following problem with four jobs to be
assigned to four workers:
J1 J2 J3 J4
W1 4 0 1 2
W2 3 5 2 0
W3 0 4 1 5
W4 1 2 0 3
Step 1: Select the smallest value in each row. Subtract this value from each
value in that row.
The Assignment Model –Hungarian Method
Step 2: Do the same for the columns that do not have any zero value.
The Assignment Model –Hungarian Method
Subtraction
Row
Subtraction
Column
The Assignment Model –Hungarian Method
• A feasible assignment is not possible at this moment.
• In such a case, the procedure is to draw a minimum number of lines
through some of the rows and columns such that all zero values are
crossed out.
The Assignment Model –Hungarian Method
• The next step is to select the smallest uncrossed out element. This
element is subtracted from every uncrossed out element and added to
every element at the intersection of two lines.
The Assignment Model –Hungarian Method
• We can now easily assign to the zero values.
• The solution is to assign (1 to 1), (2 to 3), (3 to 2) and (4 to 4).
• If drawing lines do not provide an easy solution, then we should perform
the task of drawing lines one more time.
• Actually, we should continue drawing lines until a feasible assignment is
possible.
The Assignment Model –Hungarian Method
Example 4. Solve the following assignment problem:
J1 J2 J3 J4
W1 8 6 5 7
W2 6 5 3 4
W3 7 8 4 6
W4 6 7 5 6
J1 J2 J3 J4
W1 7 5 8 4
W2 5 6 7 4
W3 8 7 9 8
The Assignment Model –Hungarian Method
Hint: Since the problem is unbalanced, we add a dummy worker
4 with cost 0 and solve the problem.
J1 J2 J3 J4
W1 7 5 8 4
W2 5 6 7 4
W3 8 7 9 8
W4 0 0 0 0
Answer:
W1 J4 W2 J1 W3 J2 W4 J3
Since W4 is dummy, J3 is left undone.
Therefore, Z = 16
The Assignment Model -Definition
The assignment problem can also be solved using a
linear programming approach.
04 - 20
The Assignment Model -Definition
The general assignment model with n workers and n jobs is presented
below:
The element Cij is the “cost or time taken” of assigning machine i to the job j.
If there are more machines, we may introduce dummy jobs and if there are
less machines, we may introduce dummy machines.
The Assignment Model – LP Approach
The assignment model can be expressed mathematically as follows:
Xij= 0, if the job j is not assigned to machine i
1, if the job j is assigned to machine i
The Assignment Problem - Maximization
23
The Assignment Model – LP Approach
Example 1. Solve the following unbalanced assignment
problem by LP approach
J1 J2 J3 J4
W1 7 5 8 4
W2 5 6 7 4
W3 8 7 9 8
Answer:
W1 J4 W2 J1 W3 J2 W4 J3
Since W4 is dummy, J3 is left undone.
Therefore, Z = 16
The Assignment Model – LP Approach
Example 4. Consider the following assignment problem:
J1 J2 J3 J4
W1
8 6 5 7
W2
6 5 3 4
W3
7 8 4 6
W4
6 7 5 6
Answer:
W1 J2 W2 J4 W3 J3 W4 J1
Therefore, Z = 20
THANK YOU
04 - 26
Home Take Assignment 5
Exercise 1. Solve the Assignment Problem by Hungarian Method
J1 J2 J3 J4 J5
W1
3 8 2 10 3
W2
8 7 2 9 7
W3 6 4 2 7 5
W4 8 4 2 3 5
9 10 6 9 10
W5
Answer: W1 J5, W2 J3, W3 J2, W4 J4, W5 J1
Home Take Assignment 5
Exercise 2. Five managers who differ in ability and experience are to
be placed in charge of five projects which are different in type and
value. The suitability of each manager for each project is assessed on
a numerical scale with a maximum of twenty points. The results are
shown below:
Project
Manager 1 2 3 4 5
A 18 16 11 19 5
B 14 10 15 8 6
C 9 13 8 8 6
D 15 14 10 12 10
E 11 11 14 10 8