Lecture 15 Transportation Algorithm

advertisement
Lecture 15
Transportation Algorithm
October 14, 2009
Lecture 15
Outline
• Recap the last lecture
• Selection of the initial basic feasible solution
Northwest-corner method
• Computing reduced costs of nonbasic variables
Thorugh the use of shadow prices
• Basis change
Operations Research Methods
1
Lecture 15
Sun-Ray Transportation Model
Grain from Silos to Mills - Balanced problem
Mill 1 Mill 2 Mill 3 Mill 4 Supply
Silo 1
10
2
20
11
15
Silo 2
12
7
9
20
25
Silo 3
4
14
16
18
10
Demand
5
15
15
15
Northwest-corner method
Mill 1
Silo1 10 x11 = 5
Silo 2 12
Silo 3 4
Mill 2
2 x12 = 10
7 x22 = 5
14
Mill 3
20
9 x23 = 15
16
Mill 4
11
20 x24 = 5
18 x34 = 10
Working with the simplex method would require 12 variables, of which 6
are basic variables. We resort to a more compact representation:
- the use of the preceding table.
Operations Research Methods
2
Lecture 15
Simplex Method
Having the initial table (with initial basic feasible solution), we perform the
typical simplex iteration
Step 1 Reduced Cost Computation
Compute the reduced costs of the nonbasic variables
Step 2 Optimality Check
Looking at the reduced cost values, we check the optimality
• In the transportation minimization problem: optimality requires nonnegative reduced cost
Step 3 Basis Change
If not optimal, we perform change of basis and update the table
• In the transportation minimization problem: solution is not optimal
when reduced cost is positive for some nonbasic variable
Operations Research Methods
3
Lecture 15
Reduced Cost Computation
We do not have Basis Inverse, so we have to rely on the dual problem and
the fact that the reduced costs of the basic variables are zero
We use shadow prices - hence, we need to look at the dual of the
transportation problem
minimize
subject to
m X
n
X
cij xij
i=1 j=1
n
X
j=1
m
X
xij = bi
for i = 1, . . . , m
←−(ui)
xij = dj
for j = 1, . . . , n
←−(vj)
i=1
xij ≥ 0
Operations Research Methods
for all i, j
4
Lecture 15
The dual of the general transportation problem
maximize
m
X
i=1
subject to
biui +
n
X
dj vj
j=1
ui + vj ≤ cij
for all (i, j) − pairs
(xij)
• Reduced cost c̄ij of variable xij is given by
c̄ij = ui + vj − cij
where cij is the original cost of the variable xij as given in the objective
of the transportatation problem
Operations Research Methods
5
Lecture 15
Step 1: Computing the reduced costs of nonbasic
variables
1. Determine the shadow prices of the problem corresponding to the current
basic feasible solution, using the fact that the reduced costs of the basic
variables are 0, i.e.
c̄ij = ui + vj − cij = 0
for all basic variables xij
• We have m + n unknowns ui, vj , and m + n − 1 equations
• One degree of freedom: set u1 = 0 (or other than u1 variable)
2: Using the shadow prices determined in item 1, compute the reduced
costs of the nonbasic variables
c̄ij = ui + vj − cij
Operations Research Methods
for all nonbasic variables xij
6
Lecture 15
Back to Sun-Ray Case: Reduced cost
Mill 1
Silo1 10 x11 = 5
Silo 2 12
Silo 3 4
Mill 2
2 x12 = 10
7 x22 = 5
14
Mill 3
20
9 x23 = 15
16
Mill 4
11
20 x24 = 5
18 x34 = 10
1. Determining the shadow prices from c̄ij = 0 for currently basic variables
(with u1 = 0)
x11
x12
x22
x23
x24
x34
u1 + v1 = 10
u1 + v 2 = 2
u2 + v 2 = 7
u2 + v 3 = 9
u2 + v4 = 20
u3 + v4 = 18
Operations Research Methods
&
u1 = 0
u1 = 0
v2 = 2
u2 = 5
u2 = 5
v4 = 15
−→
−→
−→
−→
−→
−→
v1 = 10
v2 = 2
u2 = 5
v3 = 4
v4 = 15
u3 = 3
7
Lecture 15
2. Using the shadow prices, compute the reduced costs c̄ij for nonbasic
variables
c̄ij = ui + vj − cij
Mill 1
Silo1 10 x11 = 5
Silo 2 12
Silo 3 4
x13
x14
x21
x31
x32
x33
Operations Research Methods
c̄13
c̄14
c̄21
c̄31
c̄32
c̄33
Mill 2
2 x12 = 10
7 x22 = 5
14
Mill 3
20
9 x23 = 15
16
= u1 + v3 − c13
= u1 + v4 − c14
= u2 + v1 − c21
= u3 + v1 − c31
= u3 + v2 − c32
= u3 + v3 − c33
Mill 4
11
20 x24 = 5
18 x34 = 10
= 0 + 4 − 20 = −16
= 0 + 15 − 11 = 4
= 5 + 10 − 12 = 3
= 3 + 10 − 4 = 9
= 3 + 2 − 14 = −9
= 3 + 4 − 16 = −9
8
Lecture 15
Step 2: Optimality Check
x13
x14
x21
x31
x32
x33
c̄13
c̄14
c̄21
c̄31
c̄32
c̄33
= −16
=4
=3
=9
= −9
= −9
We can choose any of x14, x21, and x31.
We may choose the one with the largest reduced cost - x31.
Operations Research Methods
9
Lecture 15
Simplex Method
Having the initial table (with initial basic feasible solution), we perform the
typical simplex iteration
Step 1 Reduced Cost Computation (DONE)
Compute the reduced costs of the nonbasic variables
Step 2 Optimality Check (DONE)
Looking at the reduced cost values, we check the optimality
• In the transportation minimization problem: optimality requires nonnegative reduced cost
Step 3 Basis Change (We are HERE, x31 enters the basis)
If not optimal, we perform change of basis and update the table
Operations Research Methods
10
Lecture 15
Step 3: SunRay Basis Change
Mill 1
Silo1 10 x11 = 5
Silo 2 12
Silo 3 4
Operations Research Methods
Mill 2
2 x12 = 10
7 x22 = 5
14
Mill 3
20
9 x23 = 15
16
Mill 4
11
20 x24 = 5
18 x34 = 10
11
Lecture 15
Figure 1: Graph representation of the current basic faesible solution
Operations Research Methods
12
Lecture 15
Figure 2: x31 entering the current basis. Flow push along a cycle
formed by arcs of the old solution and the new arc (3,1) of the
variable entering the basis
Operations Research Methods
13
Lecture 15
Figure 3: Table representation of the cycle and the flow push.
The maximum flow that can be send along the cycle cannot exceed the
amount of the flow on the backward traversed arcs (corresponds to removal
of the existing flow on these arcs):
θ − 5 ≥ 0,
Operations Research Methods
θ − 5 ≥ 0,
θ − 10 ≥ 0
=⇒
θ=5
14
Lecture 15
Figure 4: The resulting table after sending 5 units of flow along the
cycle. There are two variables that can leave the basis: those whose
flow dropped to 0. Thus, either x11 or x22 may leave the basis.
Suppose we choose x11 to leave.
Operations Research Methods
15
Lecture 15
Figure 5: The resulting basic feasible solution after x11 left the basis.
Now we have completed a simplex iteration.
We go to the next iteration:
We repeat steps 1,2,3 for this basic solution.
Operations Research Methods
16
Download