assnmt1
Post on 10-Apr-2018
222 Views
Preview:
TRANSCRIPT
-
8/8/2019 Assnmt1
1/42
August 26, 2009
-
8/8/2019 Assnmt1
2/42
ASSIGNMENT PROBLEM
It is a matching problem Can be used for allocation
Warehouses to MarketsFactories to MarketsFactories to Warehouses
Operator to machinesMachines to JobsSalesmen to market territoriesEtc.,
-
8/8/2019 Assnmt1
3/42
Example Time matrix is given below. Each market should be supplied by one
warehouse only.
MKT1 MKT2 MKT3 MKT4
Warehouse 1 14 5 8 10
Warehouse 2 2 12 6 5Warehouse 3 7 8 3 9
Warehouse 4 2 4 6 7
We must determine which warehouse to supplywhich market tominimize the total time.
-
8/8/2019 Assnmt1
4/42
We may try all possible combinations
There are 4 ! Number of solutions. Find the total time for each solution
and choose the best ???MKT1 MKT2 MKT3 MKT4
Warehouse 1 14 5 8 10
Warehouse 2 2 12 6 5
Warehouse 3 7 8 3 9
Warehouse 4 2 4 6 7
We may apply common sense but may not be consistent and may not guaranteeoptimality
We need smarter ways of solving this problem optimizing algorithm
-
8/8/2019 Assnmt1
5/42
Algorithm
Step 1:
(a) Find the minimum element in each rowof the time matrix. Form a new matrix bysubtracting this time element from the
respective row. (b) Find the minimum time in each column
of the new matrix, and subtract this fromeach column.
This is the reduced time matrix.
-
8/8/2019 Assnmt1
6/42
Example: Step 1(a)
MKT1 MKT2 MKT3 MKT4
Warehouse 1 14 5 8 10
Warehouse 2 2 12 6 5
Warehouse 3 7 8 3 9
Warehouse 4 2 4 6 7
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 5
Warehouse 2 0 10 4 3
Warehouse 3 4 5 0 6
Warehouse 4 0 2 4 5
Row Reduction
-
8/8/2019 Assnmt1
7/42
Example: Step 1(b)
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 2
Warehouse 2 0 10 4 0
Warehouse 3 4 5 0 3
Warehouse 4 0 2 4 2
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 5
Warehouse 2 0 10 4 3
Warehouse 3 4 5 0 6
Warehouse 4 0 2 4 5
Column Reduction
-
8/8/2019 Assnmt1
8/42
Example: Final Solution
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 2
Warehouse 2 0 10 4 0
Warehouse 3 4 5 0 3
Warehouse 4 0 2 4 2
Optimal assignment,1,1,1,1
41332412==== xxxx
How did weknow which 0sto choose?!
-
8/8/2019 Assnmt1
9/42
FINAL ALLOCATION AND THE
EFFECTMKT1 MKT2 MKT3 MKT4
Warehouse 1 5
Warehouse 2 5
Warehouse 3 3
Warehouse 4 2
What is the effect ?
Find the value of the solution in terms of total time
-
8/8/2019 Assnmt1
10/42
WHAT IS THE VALUE OF THE
SOLUTION X 12 = 5
X 24 = 5 X 33 = 3
X41 = 2
TOTAL TIME = 15 Can you find a solution better than this ?
-
8/8/2019 Assnmt1
11/42
PRACTICE PROBLEM
A DEPARTMENT HAS 4 JOBS AND 4
MEN. ROWS REPRESENT JOBS 1 To 4
COLUMNS REPRESENT MEN A TO D THE TIME MATRIX IS GIVEN.
CHOOSE THE BEST JOB-MANCOBINATIONS.
-
8/8/2019 Assnmt1
12/42
8 26 17 11
13 28 4 26
38 19 18 15
19 26 24 10
Job 1
Job 2
Job 3
Job4
M/C1 M/C2 M/C3 M/C 4
-
8/8/2019 Assnmt1
13/42
THE PROBLEM
AIM : TO MINIMIZE THE TOTAL TIME
TAKEN TO COMPLETE ALL JOBS. THERE ARE 4! NUMBER OF POSSIBLE
ALLOCATIONS. REQUIREMENT :
A SYSTEMATIC METHOD.
-
8/8/2019 Assnmt1
14/42
HUNGARIAN METHODPHASE 1STEPS
Row operation
Find the smallest number in each row and Subtractit from the remaining elements in that row.
Column operationFind the minimum element in each column andsubtract it from the other elements in therespective column
Check if allocation is possibleSee if we have the number of independent zeros
equal to number of rows or columns.
-
8/8/2019 Assnmt1
15/42
8 26 17 11
13 27 4 26
38 19 18 15
19 26 24 10
0 18 9 3
9 23 0 22
23 4 3 0
9 16 14 0
0 14 9 3
9 19 0 22
23 0 3 09 12 14 0
-
8/8/2019 Assnmt1
16/42
COMMENTS
HERETHE INDEPENDENT ASSINGNMENTS ARE:
A-1 (8)B-3 (19)C-2 (4)D-4 (10)
CHECK THE ORIGINAL MATRIX AND CHECK THEEFFECTIVENESS (41)
IF THE INDEPENDENT ASSINGNMENTS ARE < n, WHERE n ISEQUAL TO THE NUMBER OF ALLOCATIONS REQUIRED
GO TO PHASE 2
-
8/8/2019 Assnmt1
17/42
WILL IT BE THIS SIMPLE ALWAYS ?
Consider an example
Same situation, but the numbers areslightly different
-
8/8/2019 Assnmt1
18/42
Example We must determine which warehouse to supply
which market minimize the total time. Timematrix is given below.
Each market should be supplied by onewarehouse only.
MKT1 MKT2 MKT3 MKT4
Warehouse 1 14 5 8 7
Warehouse 2 2 12 6 5
Warehouse 3 7 8 3 9
Warehouse 4 2 4 6 10
-
8/8/2019 Assnmt1
19/42
Hungarian Algorithm Phase1
Step 1:
(a) Find the minimum element in each rowof the time matrix. Form a new matrix by
subtracting this time from each row. (b) Find the minimum time in each column
of the new matrix, and subtract this from
each column.
This is the reduced time matrix.
-
8/8/2019 Assnmt1
20/42
Example: Step 1(a)
MKT1 MKT2 MKT3 MKT4
Warehouse 1 14 5 8 7
Warehouse 2 2 12 6 5
Warehouse 3 7 8 3 9
Warehouse 4 2 4 6 10
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 2
Warehouse 2 0 10 4 3
Warehouse 3 4 5 0 6
Warehouse 4 0 2 4 8
Row Reduction
-
8/8/2019 Assnmt1
21/42
Example: Step 1(b)
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 0
Warehouse 2 0 10 4 1
Warehouse 3 4 5 0 4
Warehouse 4 0 2 4 6
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 2
Warehouse 2 0 10 4 3
Warehouse 3 4 5 0 6
Warehouse 4 0 2 4 8
Column Reduction
-
8/8/2019 Assnmt1
22/42
THE PROBLEM ?
Only 3 allocations are possible
We need 4 allocations
Go to Phase 2
Hungarian Algorithm Phase 2
-
8/8/2019 Assnmt1
23/42
Hungarian Algorithm Phase 2
Step 2: Draw the minimum number oflines that are needed to cover all the zerosin the reduced cost matrix.
If m (number of assignments required)lines are available, then an optimal
solution is available among the coveredzeros in the matrix.
Otherwise, continue to Step 3.How do we
find theminimumnumber of
lines?
-
8/8/2019 Assnmt1
24/42
Example: Step 2
MKT1 MKT2 MKT3 MKT4
Warehouse 1 9 0 3 0
Warehouse 2 0 10 4 1
Warehouse 3 4 5 0 4
Warehouse 4 0 2 4 6
We have 3 lines, but
we need 4 lines.Now continue with Step 3
-
8/8/2019 Assnmt1
25/42
Hungarian Algorithm
Step 3: Find the smallest nonzero element
(say, k) in the reduced time matrix that isuncovered by the lines.
Subtractk
from each uncovered element,and add k to each element that is covered
by two lines.
Return to Step 2.
-
8/8/2019 Assnmt1
26/42
Example: Step 3
MKT1 MKT2 MKT3 MKT4
Warehouse 9 0 3 0
Warehouse 0 10 4 1
Warehouse 4 5 0 4
Warehouse 0 2 4 6
MKT1 MKT2 MKT3 MKT4
Warehouse 10 0 3 0
Warehouse 0 9 3 0
Warehouse 5 5 0 4
Warehouse 0 1 3 5
-
8/8/2019 Assnmt1
27/42
Example: Step 2 (again)
MKT1 MKT2 MKT3 MKT4
Warehouse 1 10 0 3 0Warehouse 2 0 9 3 0
Warehouse 3 5 5 0 4
Warehouse 4 0 1 3 5
There are 4 lines.We can get the optimal assignment.
We stop
Zero Assignment
-
8/8/2019 Assnmt1
28/42
Example: Final Solution
MKT1 MKT2 MKT3 MKT4
Warehouse 1 10 0 3 0
Warehouse 2 0 9 3 0
Warehouse 3 5 5 0 4
Warehouse 4 0 1 3 5
Optimal assignment1,1,1,1
24413312==== xxxx
How did we
know which 0sto choose?!
HOW TO DRAW THE LINES
-
8/8/2019 Assnmt1
29/42
HOW TO DRAW THE LINES
SYSTEMATICALLY ? CONSIDER ONE MORE EXAMPLE
CONSIDER THE FOLLOWING
-
8/8/2019 Assnmt1
30/42
CONSIDER THE FOLLOWING
EXAMPLE There are 5 operators and 5 jobs
Time required by each operator to
complete each job is given
-
8/8/2019 Assnmt1
31/42
11 17 8 16 20
9 7 12 6 15
13 16 15 12 16
21 24 17 28 26
14 10 12 11 15
Job1 Job2 Job3 Job 4 JOb5
M5
M3
M4
M2
M1
3 9 0 8 12
-
8/8/2019 Assnmt1
32/42
3 9 0 8 12
3 1 6 0 91 4 3 0 4
4 7 0 11 9
4 0 2 1 5
2 9 0 8 8
2 1 6 0 5
0 4 3 0 0
3 7 0 11 5
3 0 2 1 1
PHASE 2 0F ASSIGNMENTS
-
8/8/2019 Assnmt1
33/42
PHASE 2 0F ASSIGNMENTS
STEPS MARK ALL ROWS HAVING NO
ASSINGNMENT MARK COLUMNS WITH ZEROS IN MARKED
ROWS.
MARK ROWS THAT HAVE ASSIGNMENTS INMARKED COLUMN.
REPEAT STEPS 1 TO 3 TILL THE CHAIN OF
MARKING ENDS. DRAW LINES THROUGH UNMARKED ROWS
AND MARKED COLUMNS.
-
8/8/2019 Assnmt1
34/42
2 9 0 8 8
2 1 6 0 5
0 4 3 0 0
3 7 0 11 5
3 0 2 1 1
CHECK
-
8/8/2019 Assnmt1
35/42
CHECK
IF THE PROCEDURE HAS BEEN CARRIED OUT CORRECTLY:
THERE SHOULD BE AS MANY LINES AS THEREARE ASSIGNMENTS IN THE MAXIMAL ASSIGNMENT
EVERY ZERO WILL HAVE AT LEAST ONE LINETHROUGH IT.
THIS METHOD YIELDS THE MINIMUM NUMBER OF LINES THATWILL PASS THROUGH ALL ZEROS.
HAVING DRAWN THE SET OF LINES IN STEPS 1 TO 4, DO THE
FOLLOWING.
-
8/8/2019 Assnmt1
36/42
0 7 0 6 6
2 1 8 0 5
0 4 5 0 0
1 5 0 9 3
3 0 4 1 1
IMPORTANT STEP TO FIND
-
8/8/2019 Assnmt1
37/42
ADDITIONAL ALLOCATION EXAMINE ELEMENTS THAT DO NOT
HAVE A LINE THROUGH THEM.
SELECT THE SMALLEST OF THESEAND SUBTRACT IT FROM ALL THEELEMNTS THAT DO NOT HAVE A LINE
THROUGH THEM. ADD THIS SMALLEST ELEMENT TO
EVERY ELEMENT THAT LIES AT THEINTERSECTION OF TWO LINES.
LEAVE THE REMAINING ELEMENTS OF
THE MATRIX UNCHANGED.
-
8/8/2019 Assnmt1
38/42
0 7 0 6 6
2 1 8 0 5
0 4 5 0 0
1 5 0 9 3
3 0 4 1 1
-
8/8/2019 Assnmt1
39/42
FINAL SOLUTION
X11 = 1 ( 11)
X24 = 1 (6) X35 = 1 (16)
X43 = 1 (17 ) X52 = 1 (10)
Total Value = 60
PRACTICE PROBLEMS
-
8/8/2019 Assnmt1
40/42
PRACTICE PROBLEMS
-
8/8/2019 Assnmt1
41/42
MANJOBS
1 2 3 4 5
A 10 5 13 15 16
B 3 9 18 13 6
C 10 7 2 2 2
D 7 11 9 7 12
E 7 9 10 4 12
ANSWER : A-2, B-1, C-5, D-3, E-4 ( CHECK)
> A, B, C, D, E ARE THE TOWNS REACHING WHICH CARS ARE TOBE HIRED.> a b c d e ARE CAR DEPOTS FROM WHERE CARS CAN BE HIRED
-
8/8/2019 Assnmt1
42/42
> a, b, c, d, e ARE CAR DEPOTS FROM WHERE CARS CAN BE HIRED.EACH DEPOT CAN ONLY GIVE CAR TO REACH ONE TOWN.
MATRIX- DISTANCE BETWEEN DEPOT AND TOWNLINK THE DEPOT AND THE TOWN TO MINIMISE TOTAL DISTENCE
DEPOTS
a b c d e
A 160 130 175 190 200
B 135 120 130 160 175
C 140 110 155 170 185
D 50 50 90 80 110
E 55 35 70 80 105
ANS : A-e, B-c, C-b, D-a, E-d( CHECK)
TOWNS
top related