You are on page 1of 35

Quantitative Analysis - Lec 5 7/02/2017

Assignment Problem
Audio 141
Special case of transportation, we are going to assign
people to places, robots to machines ......, project
managers to sites
Why here I am doing QA not economics?
Because it is the maximum profit, or the minimum cost
for the place
We will follow the Hungarian Method instead the
Solver, because it will take thousand of steps to reach the
solution.
The Hungarian Method depends on reduction of
Matrix, using Opportunity costs.
Opportunity Cost: Is the loss that I will incur if I send
you in the wrong place.
Instead of sending you in the wrong place I make the
correct allocation from the first time.
So we do some playing around using the stepping stone,
and then you will find that they are allocated
But , we don't have a supply and demand like the
previous one. all the supply and demand will be one to
one.
So it is a special case,
The following is a primitive case and then we will go to
exceptions.

1 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

It is a called reduction of the Matrix of the


Opportunity cost

2 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Problem :
A Project Management Company wishes to assign three of its good
project managers FPMI, PM2 and FM3 each with different talents and
abilities, to three important projects 1, 2 and 3 such that they can
minimize their total costs.

The cost to the company is calculated from the rate per day of each of
these project managers and depends on the importance of the project they
are assigned to. The costs in $ are presented in the assignment table
below:
Projects
Project
Manage P1 P2 P3
rs
PM1 11 14 6

PM2 8 10 11

PM3 9 12 7

Develop a model for minimizing assignment costs; solve the model to


determine the minimum-Cost solution

3 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

- The following are the rate per day if the project


manager goes to the site
Projects
Project
Manage P1 P2 P3
rs
PM1 11 14 6

PM2 8 10 11

PM3 9 12 7

- The rate / day is a cost, as we want to minimize


the total cost
- Each project manager will go to a site & this
will cost .
PM1 P3 =6
PM2 P1 =8
- PM3 cant go to 7 (because PM1 is already
there), neither to 9 because PM2 is already
there
PM3 P2 = 12
Total Cost 26
- We can make it better
PM1 P3 =6
PM2 P2 = 10
PM3 P1 =9
Total Cost 25
4 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

- If we have another value, several 8 or 6, the


allocation will take thousands of trials.

5 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

The Hungarian Method


Minimization
Step : 1 a :
- Find the lowest value in every row :
11 14 6
8 10 11

9 12 7

- Subtract the smallest value in each row from all


values in the same row ( We are doing the
opportunity cost)
Projects
Project
Manage 1 2 3
rs
11- 6 14 - 6 6-6
PM1
5 8 0
8-8 10 - 8 11 - 8
PM2
0 2 3
9-7 12 - 7 7-7
PM3
2 5 0

- The New Table will be :


5 8 0

0 2 3

6 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

2 5 0

Step 1 b :
In the new table Subtract the Lowest value in each column from all values
in the same column

- Why :
o Trying to get more zeros , when I get more
zeros
o When I will get more zeros, this mean that I
will incur the Zero if I will send the person
there (it is better for me to send the person
the zero value place).
o If I have more than Zero , then I have
different allocations

Projects
Project
Manage 1 2 3
rs
5-0 8-2 0-0
PM1
5 6 0
0-0 2-2 3-0
PM2
0 0 3
2-0 5-2 0-0
PM3
2 3 0

The rule to solve this problem is


M = N = 3
7 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

OR Columns = Rows = 3
The Table should be square

8 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Step 2 :
In the new table try to cover the zeros with the minimum number of lines
either horizontal or vertical

Managerial Logic :
The manager will tell himself, I have some zeros, why not we cross them
in order to decide where the Project managers will be located in the zeros.

Draw the minimum number of straight lines through each row and
column to cover the zeros in the matrix.

How many numbers of Lines could be drawn here ?


(imagine that the zeros are birds , and you want to kill them with the
minimum number of bullets ) : 2 Lines

Why the minimum number?


In order to be sure that these are the only zeros that I can allocate people
to the place

Projects
Project
Manage 1 2 3
rs

PM1 5 6
0

PM2 0 0 3

PM3 2 3 0

9 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Step 3 :
If the minimum number of straight lines is equal to the number of rows or
equivalently columns in the matrix,

Then an optimal assignment with a value of zero can be made. If the


minimum number of lines is less than the number of rows

If the number of line drawn = M or N of the problem, then we can make


an assignment,

Why
Because you have to reach that the zeros around us will make sure that
everyone will go there with the minimum cost that I want to pay.

NOTE :
I have to begin the problem with a target: M = N = 3
My target is 3 lines

Here are only 2 lines, less than 3


We have to do another Step 4

Step 4 :
It consist of 3 parts (very important)
1- Find the lowest value in the uncovered elements
2- Subtract these value from every other value in the uncovered elements
3- & add this value to any cell with intersection of 2 lines.
4- & Leave other values the same

10 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

1) Find the lowest value in the uncovered elements


Projects
Project
Manager 1 2 3
s

PM1 5 6
0

PM2 0 0 3

PM3 2 3 0

2) Subtract these value from every other value in the


uncovered elements
Projects
Project
Manager 1 2 3
s
5-2 6-2
PM1
3 4 0

PM2 0 0 3

2-2 3-2
PM3 0
0 1

11 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

3) & Add this value to any cell with intersection of 2


lines, and leave other values the same.
Projects
Project
Manager 1 2 3
s
5-2 6-2
PM1
3 4 0
3+2
PM2 0 0
5
2-2 3-2
PM3 0
0 1
The cell of the intersection of 2 lines, is a very bad cell, it
is not allowed to go there, unless to be maximized .
(Audio 141 27:40)
The area around the intersection will be better.

Step 5 :
We will do the step of the lines chances again, same like
Step 2
Draw the minimum number of straight lines through each
row and column to cover the zeros in the matrix.
Projects
Project
Manager 1 2 3
s

PM1
3 4 0

12 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

PM2 0 0 5

PM3 0 1 0


The direction of choosing the lines doesnt matter, as long
as I am covering the zeros, with the minimum number of
lines.
If they are not the minimum, I have to repeat this again.

I have enough zeros that I can cover them in order to


make the allocation but these enough lines should be the
minimum

We will allocate

Find the only Zero in any row and allocate:


When I allocate PM1 in P3, this mean that I closed this
project
The Zero is off; I cannot allocate any place there

PM2 has 2 Zeros; I have to leave him, because he has a


tie,

PM3 should go to P1, because P3 is already allocated,

Then PM2 has to go to P1

The cost will be


from the first
table

13 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

PM1 P3 = 6
PM3 P1 = 9
PM2 P2 = 10
Total Cost 25

14 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Take it vertically :
Projects
Project
Manager 1 2 3
s

PM1
3 4 0

PM2 0 0 5

PM3 0 1 0

The only Zero is in Project

PM2 P2 = 10
PM3 P1 = 9
PM1 P3 = 6
Total Cost 25

15 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Maximization the same problem


- The problem cannot be solved with the
Hungarian method.
- The Hungarian method requires it to be with
the opportunity cost.
- In order to do it, we have to change it from
Maximization into minimization.

Projects
Project
Manage 1 2 3
rs
PM1 11 14 6

PM2 8 10 11

PM3 9 12 7

Step : 1 a :
- Find the highest value in every row :

11 14 6

8 10 11
9 12 7

16 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

17 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

- Subtract the highest value in each row from all


values in the same row ( We are doing the
opportunity cost)
Projects
Project
Manage 1 2 3
rs
14- 11 14 - 14 14 - 6
PM1
3 0 8
11 - 8 11 - 10 11 - 11
PM2
3 1 0
12 - 9 12 - 12 12 - 7
PM3
3 0 5

We transform it from maximization into


minimization
- The New Table will be :
3 0 8

3 1 0

3 0 5

Managerial:

If PM 1 goes to P2, he is going to make me


profitable by $ 14, his cost is Zero

18 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

If I sent him wrongly to P1, his profit will be


only 11, while I was supposed to get from him
14, so I am loosing 3
That's the idea with minimization.
Losing the 3 is the penalty you take from
sending him to the wrong place, it is better to
send him to the Zero cell.
The zero means that I will not incur any cost.
Step 1 b :
In the new table Subtract the Lowest value in each column from all
values in the same column

- Why :
o Trying to get more zeros , when I get more
zeros
o When I will get more zeros, this mean that I
will incur the Zero if I will send the person
there (it is better for me to send the person
the zero value place).
o If I have more than Zero , then I have
different allocations

Projects
Project
Manage 1 2 3
rs

19 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

3-3 0-0 8-0


PM1
0 0 8
3-3 1-0 0-0
PM2
0 1 0
3-3 0-0 5-0
PM3
0 0 5

20 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Step 2 :
In the new table try to cover the zeros with the minimum number of lines
either horizontal or vertical

Projects
Project
Manage 1 2 3
rs

PM1 0 0 8

PM2 1 1 0

PM3 0 0 5

To begin allocation

PM1 0 0 8
To
begin
PM2 1 1 0 allocatio
n
PM3 0 0 5

We choose the Zero "0" of PM 2 to begin


allocation,

21 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Because PM1 &PM3 have 2 zeros each, it is a


tie, will allocate both of them at any project,
the profit is the same.

22 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

The Profit will be


from the first
table

PM2 P3 = 11
PM1 P2 = 14
PM3 P1 = 9
Total Profit 34
OR
PM2 P3 = 11
PM1 P1 = 11
PM3 P2 = 12
Total Profit 34

When we have a tie in the problem is good; in


order to allocate any of them before the other, it
will be the same result.

23 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

If the Market is unbalanced


- I have 4 Project Managers , and 3 Projects
only ,
Projects
Project
Manage 1 2 3
rs
PM1 11 14 6

PM2 8 10 11

PM3 9 12 7

PM4 10 7 9

The problem here is minimization


The rule to solve this problem is
M = N = 4
OR Columns = Rows = 4
The Table should be square

We will add a new column


Projects
Project
Manage 1 2 3 4
rs
PM1 11 14 6 0
PM2 8 10 11 0
24 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

PM3 9 12 7 0
PM4 10 7 9 0
Step : 1 a :
Will not be done here

11 14 6 0
8 10 11 0
9 12 7 0
10 7 9 0

Step 1 b :
In the new table Subtract the Lowest value in each column from all values
in the same column

Projects
Project
Manage 1 2 3 4
rs
11 - 8 14 - 7 6-6 0-0
PM1
3 7 0 0
8-8 10 - 7 11 - 6 0-0
PM2
0 3 5 0
9-8 12 - 7 7 -6 0-0
PM3
1 5 1 0
10 - 8 7-7 9-6 0-0
PM4
2 0 3 0
25 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

26 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Step 2 :
In the new table try to cover the zeros with the minimum number of lines
either horizontal or vertical

Projects
Project
Manage 1 2 3 4
rs
PM1 3 7 0 0

PM2 0 3 5 0

PM3 1 5 1 0

PM4 2 0 3 0


I am sure that this is the minimum number of lines,
This is the trick of the Hungarian method
If you are sure that these are the minimum, you
can reach an assignment
If you are not sure, then the problem is not
developed yet.
We have to develop it more

27 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Step 2 :

Find the only Zero in any row and allocate:


Projects
Project
Manage 1 2 3 4
rs
PM1 3 7 0 0

PM2 0 3 5 0

PM3 1 5 1 0
PM4 2 0 3 0

PM3 will go to P4, PM2 will go to P1


PM1 & PM4 have 2 options each.

This a recession industry, this mean


that one of the project managers will stay at
home
The Cost will be
from the first
table

PM1 P3 = 6
PM2 P1 = 8
PM3 P4 = 0
PM4 P2 = 7

28 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Total Profit 21
This means that PM3 will go home, because he has no project.

29 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

Same Problem Maximization


- In the maximization we have to turn it
minimization.

- we have 4 Projects, This a Booming


industry
- This mean one of the projects is not going to be
done, because I don't have a manager for it.
Managerial Logic :

I will tell the client, I do not want you


It is serious here, which client I have to choose,
the less profitable one
Projects
Project
Manage 1 2 3 4
rs
PM1 11 14 6 9
PM2 8 10 11 7
PM3 9 12 7 11

- In the maximization we have to turn it


minimization.
Projects
Project
Manage 1 2 3 4
rs
14 - 11 14 - 14 14 - 6 14 - 9
PM1
3 0 8 5
30 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

14 - 8 14 - 10 14 - 11 14 - 7
PM2
6 4 3 7
14 - 9 14 - 12 14 - 7 14 -10
PM3
5 2 7 4
PM4 0 0 0 0
Step 1 a :
- Find the minimum value in every row :
3 0 8 5

6 4 3 7

5 2 7 4

0 0 0 0

- Subtract the Lowest value in each row from all


values in the same row ( We are doing the
opportunity cost)
Projects
Project
Manage 1 2 3 4
rs
3-0 0-0 8-0 5-0
PM1
3 0 8 5
6-3 4 -3 3-3 7-3
PM2
3 1 0 4
5-2 2-2 7-2 4- 2
PM3
3 0 5 2
PM4 0 0 0 0

The New Table


31 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

Projects
Project
Manage 1 2 3 4
rs
PM1 3 0 8 5

PM2 3 1 0 4

PM3 3 0 5 2
PM4 0 0 0 0

Step 1 b :

Is not going to be done

Step 2 :
In the new table try to cover the zeros with the minimum number of lines
either horizontal or vertical

Projects
Project
Manage 1 2 3 4
rs
PM1 3 0 8 5

PM2 3 1 0 4

PM3 3 0 5 2

PM4 0 0 0 0

32 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017


- These are 3 only
- That means I will take the uncovered
NOTE :
I have to begin the problem with a target: M = N = 4
My target is 4 lines

Here are only 3 lines, less than 4


We have to do another Step 4

Step 4 :
It consist of 3 parts (very important)
1- Find the lowest value in the uncovered elements

Projects
Project
Manage 1 2 3 4
rs
PM1 3 0 8 5
PM2 3 1 0 4
PM3 3 0 5 2
PM4 0 0 0 0

2- Subtract these value from every other value in the uncovered elements
3- & add this value to any cell with intersection of 2 lines.
4- & Leave other values the same
33 Prof. Maged Morcos
Quantitative Analysis - Lec 5 7/02/2017

Projects
Project
Manage 1 2 3 4
rs
3-2 5-2
PM1 0 8
1 3
3-2 3-1
PM2 1 0
1 2
3-2 3-2
PM3 0 5
1 1
2+0 2+0
PM4 0 0
2 2

Projects
Project
Manage 1 2 3 4
rs
PM1 1 0 8 3

PM2 1 1 0 2

PM3 1 0 5 1

PM4 0 2 2 0

From the first


table

PM1 P2 = 14
PM2 P3 = 11

34 Prof. Maged Morcos


Quantitative Analysis - Lec 5 7/02/2017

PM3 P4 = 10
PM4 P1 = 0
Total Profit 35
Managerial Decision :

Project 1 will be eliminated

35 Prof. Maged Morcos

You might also like