0% found this document useful (0 votes)
158 views

03 - 2 Assignment Model

The assignment problem involves assigning n jobs to n machines in a way that minimizes the total cost. It can be solved using the Hungarian algorithm or formulated as a linear program. The Hungarian algorithm uses row and column subtraction to arrive at a solution matrix with all zeros. A linear programming formulation defines decision variables Xij equal to 1 if job j is assigned to machine i and 0 otherwise, with the objective of minimizing the total assignment costs. Examples demonstrate solving assignment problems using both the Hungarian algorithm and linear programming approaches.

Uploaded by

Yoseph Ashenafi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views

03 - 2 Assignment Model

The assignment problem involves assigning n jobs to n machines in a way that minimizes the total cost. It can be solved using the Hungarian algorithm or formulated as a linear program. The Hungarian algorithm uses row and column subtraction to arrive at a solution matrix with all zeros. A linear programming formulation defines decision variables Xij equal to 1 if job j is assigned to machine i and 0 otherwise, with the objective of minimizing the total assignment costs. Examples demonstrate solving assignment problems using both the Hungarian algorithm and linear programming approaches.

Uploaded by

Yoseph Ashenafi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

CHAPTER 3_2

The 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

How to solve assignment model?


 Assignment model is similar to the transportation model and the solution
algorithm used to solve transportation model can be used.
 Yet, a special simple algorithm, called The Hungarian Algorithm, is used
to solve assignment model because it is proven to be a quick and efficient
way to solve such problems.
 The Hungarian algorithm tries to get a zero in each row (column) by
subtracting the minimum value in that row (column) to get at least one zero.
The Hungarian Method Algorithm

• Step 0: Consider a given cost matrix

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

• The procedure to draw the minimum number of lines is:

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.

3.2 Column scanning.


1. Starting from the first column, if there’s only one zero in a column
mark the zero entry and draw a horizontal line passing through that
zero. Otherwise skip the column.

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.

Step 7: Optimal solution is obtained as marked by the squares.

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

The solution is:


W1  J2, W2  J4, W3  J1, W4  J3
The Assignment Model –Hungarian Method
Example 2:

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

Step 3: Assignments are made at zero values


.
– Therefore, we assign job 1 to machine 1; job 2 to machine 3, and job 3
to machine 2.

– Total cost is 5+12+13 = 30.

– But it is not always possible to obtain a feasible assignment very


quickly as in the above problem..
The Assignment Model –Hungarian Method
Example 3:

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

Answer: W1 is assigned to J2;


W2 is assigned to J4;
W3 is assigned to J3;
W4 is assigned to J1;
And, the optimal cost =6 + 4 + 4 +6 = 20
The Assignment Model –Hungarian Method
Example 5. Solve the following unbalanced assignment
problem:

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.

 The assignment problem is a special case of the Transportation Model


 Here, jobs represent “sources” and machines represent “destinations.”
 The supply available at each source is 1 unit and demand at each
destination is 1 unit.
 Xij =1 if machine i is assigned to job j and = 0 otherwise.
 There is a cost Cij associated with machine i performing task j.

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

• If the assignment problem is a maximization problem, convert the


problem into a minimization problem by multiplying the cost entries
by -1.

• Then apply the usual procedure of solving an assignment problem.

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

To which project should each manager be assigned in order to


obtain the highest total points score for the firm? Find using LPP.
Home Take Assignment 5
Exercise 3. A 400m swimming relay involves four different swimmers,
who successively swim 100 meters of the backstroke, breaststroke,
butterfly, and freestyle. A coach has six very fast swimmers whose expected
times(in seconds) in the individual events are given in table below.

Event 1 Event 2 Event 3 Event 4


(backstroke) (breaststroke) (butterfly) (freestyle)
Swimmer 1 65 73 63 57
Swimmer 2 67 70 65 58
Swimmer 3 68 72 69 55
Swimmer 4 67 75 70 59
Swimmer 5 71 69 75 57
Swimmer 6 69 71 66 59

How the coach assign swimmers to the competition so as to minimize the


sum of their times?

You might also like