Professional Documents
Culture Documents
Lec05 06 PDF
Lec05 06 PDF
Lec05 06 PDF
2
A special class of linear programming
Find minimum-cost distribution of a
given commodity from a group of
supply centers (sources) to a group of
receiving centers (destinations)
Need to know
1. The origin points and the capacity
or supply per period at each
2. The destination points and the
demand per period at each
3. The cost of shipping one unit from
each origin to each destination
3
Nodes??? Arcs???
4
Three plants (L.A.=1000, Detroit=1500, N.O.=1200)
supplied cars to Denver & Miami. Charge 8 cents
per mile per car.
5
To
From Albuquerque Boston Cleveland
Des Moines $5 $4 $3
Evansville $8 $4 $3
Fort Lauderdale $9 $7 $5
Boston
Cleveland (200 units
Des Moines (200 units required)
(100 units required)
capacity)
Albuquerque
(300 units Evansville
required) (300 units
capacity)
Fort Lauderdale
(300 units
capacity) 6
Cell representing a possible source-
to-destination shipping assignment
(Evansville to Cleveland)
Supply
To Factory
From Albuquerque Boston Cleveland capacity
Des
$5 $4 $3 Moines
Des Moines 100 capacity
constraint
$8 $4 $3
Evansville 300
$9 $7 $5
Fort Lauderdale 300
Warehouse
requirement 300 200 200 700
Demand
Cost of shipping 1 unit from Fort Cleveland Total demand
Lauderdale factory to Boston warehouse warehouse demand and total supply
7
Demand not equal to supply
Called an unbalanced problem
Common situation in the real world
Resolved by introducing dummy sources or
dummy destinations as necessary with cost
coefficients of zero Supply
To (A) (B) (C) Factory
Dummy capacity
From Albuquerque Boston Cleveland
$5 $4 $3 0
(D) Des Moines 250 250
$8 $4 $3 0
(E) Evansville 50 200 50 300
$9 $7 $5 0
(F) Fort Lauderdale 150 150 300
Warehouse
Demand
requirement 300 200 200 150 850
Three plants (L.A.=1000, Detroit=1300, N.O.=1200) supplied cars to
Denver & Miami.
1300
9
1900
10
Since any transportation problem can be
formulated as an LP, simplex method
can be used to find an optimal solution
Because of the special structure of a
transportation LP, the iterations of the
simplex method have a very special form
The transportation simplex method is
nothing but the original simplex method,
but it streamlines the iterations given
this special form
11
1) Determine a starting basic feasible solution(BFS).
Northwest-corner method (NW)
Vogel approximation method (VAM)
13
1. Assign 100 tubs from Des Moines to
Albuquerque (exhausting Des Moines’s supply)
14
Supply
To (A) (B) (C) Factory
From Albuquerque Boston Cleveland capacity
$5 $4 $3
(D) Des Moines 100 100
$8 $4 $3
(E) Evansville 200 100 300
$9 $7 $5
(F) Fort Lauderdale 100 200 300
Warehouse
requirement 300 200 200 700
14 13 19 15
B 350 1
9 20 23 10
C 150 1
0 0 0 0
Dummy 90 0
diff 9 13 19 10
18
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 3
14 13 19 15
B 350 1
9 20 23 10
C 150 1
0 0 0 0
Dummy 90 0
90
diff 9 13 19 10
19
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 3
14 13 19 15
B 350 1
9 20 23 10
C 150 1
0 0 0 0
Dummy --- ---
90
diff 5 0 3 5
20
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 3
14 13 19 15
B 350 1
9 20 23 10
C 100 150 1
0 0 0 0
Dummy --- ---
90
diff 5 0 3 5
21
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 4
14 13 19 15
B 350 2
9 20 23 10
C 100 50 10
0 0 0 0
Dummy --- ---
90
diff --- 0 3 5
22
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 4
14 13 19 15
B 350 2
9 20 23 10
C 100 50 10
50
0 0 0 0
Dummy --- ---
90
diff --- 0 3 5
23
Destination
Supply diff
Source N S E W
16 13 22 17
A 200 4
14 13 19 15
B 350 2
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
diff --- 0 3 2
24
Destination
Supply diff
Source N S E W
16 13 22 17
A 140 200 4
14 13 19 15
B 350 2
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
diff --- 0 3 2
25
Destination
Supply diff
Source N S E W
16 13 22 17
A 140 60 5
14 13 19 15
B 350 4
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
26
Destination
Supply diff
Source N S E W
16 13 22 17
A 140 60 60 5
14 13 19 15
B 350 4
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
27
Destination
Supply diff
Source N S E W
16 13 22 17
A 140 60 --- ---
14 13 19 15
B 350 4
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
28
Destination
Supply diff
Source N S E W
16 13 22 17
A 140 60 --- ---
14 13 19 15
B 210 140 ---
9 20 23 10
C 100 --- ---
50
0 0 0 0
Dummy --- ---
90
29
In simplex method, check the Z-row coefficients of
each nonbasic variable to check optimality
have an optimal solution if all are 0 (maximization)
Thus, minimization problem: all nonbasic ≤ 0
14 13 19 15
B 210 140 350
9 20 23 10
C 100 50 150
0 0 0 0
Dummy 90 90
vj
31
Calculate ui, vj using cij – ui – vj = 0 for xij basic
(let ui = 0 for row i with the largest number of basic variables)
Destination
Supply ui
Source N S E W
16 13 22 17
A 140 60 200 0
14 13 19 15
B 210 140 350 -2
9 20 23 10
C 100 50 150 -7
0 0 0 0
Dummy 90 90 -21
N Demand = 100
Supply = 200 A 140
60
S Demand = 140
Supply = 350 B 210
140 E Demand = 300
100 (shortage of 90)
Supply = 150 C
50 Demand = 250
W
Cost Z = 10330
34
Find the entering nonbasic variable
Select the variable with the largest positive c’ij
35
Destination
Supply ui
Source N S E W
16 13 22 17
A 200 0
100 100 (-3) (-2)
14 13 19 15
B 40 350 0
(2) 300 10
9 20 23 10
C 150 150 -5
(2) (-12) (-9)
0 0 0 0
Dummy 90 -15
(1) (-2) (4) 90
vj 16 13 19 15
0 0 0 + 0 -
Dummy 90 -15
? 90
vj 16 13 19 15
0 0 0 0
Dummy 90 90
vj
Destination
Supply ui
Source N S E W
16 13 22 17
A 200 0
100 100 (-3) (-2)
14 13 19 15
B 40 350 0
(2) 210 100
9 20 23 10
C 150 150 -5
(2) (-12) (-9)
0 0 0 0
Dummy 90 90 -19
(-3) (-6) (-4)
Demand 100 140 300 250
vj 16 13 19 15
0 0 0 0
Dummy 90 90 -19
vj 16 13 19 15
0 0 0 0
Dummy 90 90
vj
Destination
Supply ui
Source N S E W
16 13 22 17
A 200 2
60 140 (-1) (0)
14 13 19 15
B 40 350 0
(-2) 210 100
9 20 23 10
C 150 150 -5
(0) (-14) (-9)
0 0 0 0
Dummy 90 90 -19
(-5) (-8) (-4)
Demand 100 140 300 250
vj 14 11 19 15
43
44
Assignstudents to mentors
Each assignment has a ‘mismatch’ index
Minimize mismatches
Mentor
Supply
Student Snape McGonagall Lupin Chris
1 4 6 3
Harry 1
9 7 10 9
Draco 1
4 5 11 7
Goyle
1
8 7 8 5
Albert
Demand 1 1 1 1 45
It is a linear programming problem use
regular simplex method
It is a transportation problem could use
transportation simplex method
However, it has a very special structure, such
that it can be solved in polynomial time
Many such algorithms exist, but the best
known (and one of the oldest) is the
Hungarian Method
46
1. Subtract row minimums from each element in the row
2. Subtract column minimums from each element in the
column
3. Cover the zeroes with as few lines as possible
4. If the number of lines = number of rows/columns,
then optimal solution is hidden in zeroes
5. Otherwise, find the minimum cost that is not covered
by any lines
Subtract it from all uncovered elements
Add it to all elements at intersections (covered by
two lines)
6. Back to step 3
47
How to identify the optimal solution:
Make the assignments one at a time in positions
that have zero elements.
Beginwith rows or columns that have only one
zero. Cross out both the row and the column
involved after each assignment is made.
Move on to the rows and columns that are not yet
crossed out to select the next assignment, with
preference given to any such row or column that
has only one zero that is not crossed out.
Continueuntil every row and every column has
exactly one assignment and so has been crossed
out.
48
Mentor
Row Min
Student Snape McG Lupin Chris
Harry 1 4 6 3 1
Step 1
Draco 9 7 10 9 7
Goyle 4 5 11 7 4
Albert 8 7 8 5 5
Mentor
Student Snape McG Lupin Chris
Harry 0 3 5 2
Draco 2 0 3 2
Step 2
Goyle 0 1 7 3
Albert 3 2 3 0
Column Min: 0 0 3 0 49
Mentor Step 3: Cover the zeroes
Student Snape McG Lupin Chris with as few lines as
possible.
Harry 0 3 2 2
Draco 2 0 0 2 Step 4: number of lines ≠
4, not optimal
Goyle 0 1 4 3
Albert 3 2 0 0 Step 5: Find min cost
Mentor
Student Snape McG Lupin Chris
Harry 0 2 1 1
Step 3 Draco 3 0 0 2
Step 4: optimal Goyle 0 0 3 2
Albert 4 2 0 0
Cost = 1+10+5+5 = 21 = (1+7+4+5)+(0+0+3+0)+1 50