Lecture 15 Transportation Algorithm - Image Formation and...

17
Lecture 15 Transportation Algorithm October 14, 2009

Transcript of Lecture 15 Transportation Algorithm - Image Formation and...

Page 1: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Transportation Algorithm

October 14, 2009

Page 2: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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

Page 3: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Sun-Ray Transportation ModelGrain 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 Mill 2 Mill 3 Mill 4

Silo1 10 x11 = 5 2 x12 = 10 20 11

Silo 2 12 7 x22 = 5 9 x23 = 15 20 x24 = 5

Silo 3 4 14 16 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

Page 4: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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 non-

negative 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

Page 5: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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

minimizem∑

i=1

n∑j=1

cijxij

subject ton∑

j=1

xij = bi for i = 1, . . . , m ←−(ui)

m∑i=1

xij = dj for j = 1, . . . , n ←−(vj)

xij ≥ 0 for all i, j

Operations Research Methods 4

Page 6: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

The dual of the general transportation problem

maximizem∑

i=1

biui +n∑

j=1

djvj

subject to 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

Page 7: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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 for all nonbasic variables xij

Operations Research Methods 6

Page 8: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Back to Sun-Ray Case: Reduced cost

Mill 1 Mill 2 Mill 3 Mill 4

Silo1 10 x11 = 5 2 x12 = 10 20 11

Silo 2 12 7 x22 = 5 9 x23 = 15 20 x24 = 5

Silo 3 4 14 16 18 x34 = 10

1. Determining the shadow prices from c̄ij = 0 for currently basic variables

(with u1 = 0)

x11 u1 + v1 = 10 & u1 = 0 −→ v1 = 10

x12 u1 + v2 = 2 u1 = 0 −→ v2 = 2

x22 u2 + v2 = 7 v2 = 2 −→ u2 = 5

x23 u2 + v3 = 9 u2 = 5 −→ v3 = 4

x24 u2 + v4 = 20 u2 = 5 −→ v4 = 15

x34 u3 + v4 = 18 v4 = 15 −→ u3 = 3

Operations Research Methods 7

Page 9: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

2. Using the shadow prices, compute the reduced costs c̄ij for nonbasic

variables

c̄ij = ui + vj − cij

Mill 1 Mill 2 Mill 3 Mill 4

Silo1 10 x11 = 5 2 x12 = 10 20 11

Silo 2 12 7 x22 = 5 9 x23 = 15 20 x24 = 5

Silo 3 4 14 16 18 x34 = 10

x13 c̄13 = u1 + v3 − c13 = 0 + 4− 20 = −16

x14 c̄14 = u1 + v4 − c14 = 0 + 15− 11 = 4x21 c̄21 = u2 + v1 − c21 = 5 + 10− 12 = 3x31 c̄31 = u3 + v1 − c31 = 3 + 10− 4 = 9x32 c̄32 = u3 + v2 − c32 = 3 + 2− 14 = −9

x33 c̄33 = u3 + v3 − c33 = 3 + 4− 16 = −9

Operations Research Methods 8

Page 10: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Step 2: Optimality Check

x13 c̄13 = −16

x14 c̄14 = 4x21 c̄21 = 3x31 c̄31 = 9x32 c̄32 = −9

x33 c̄33 = −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

Page 11: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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 non-

negative 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

Page 12: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Step 3: SunRay Basis Change

Mill 1 Mill 2 Mill 3 Mill 4

Silo1 10 x11 = 5 2 x12 = 10 20 11

Silo 2 12 7 x22 = 5 9 x23 = 15 20 x24 = 5

Silo 3 4 14 16 18 x34 = 10

Operations Research Methods 11

Page 13: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Figure 1: Graph representation of the current basic faesible solution

Operations Research Methods 12

Page 14: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Figure 2: x31 entering the current basis. Flow push along a cycleformed by arcs of the old solution and the new arc (3,1) of thevariable entering the basis

Operations Research Methods 13

Page 15: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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, θ − 5 ≥ 0, θ − 10 ≥ 0 =⇒ θ = 5

Operations Research Methods 14

Page 16: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

Lecture 15

Figure 4: The resulting table after sending 5 units of flow along thecycle. There are two variables that can leave the basis: those whoseflow dropped to 0. Thus, either x11 or x22 may leave the basis.Suppose we choose x11 to leave.

Operations Research Methods 15

Page 17: Lecture 15 Transportation Algorithm - Image Formation and ...angelia/ge330fall09_transpalg_l15.pdf · Lecture 15 Sun-Ray Transportation Model Grain from Silos to Mills - Balanced

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