25
Revised Simplex or How to Use the Simplex without the Tableau

Revised Simplex - Brown University

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Revised Simplex!

or!

How to Use the Simplex without the Tableau!

Motivation!Large Sparse Problems!•  Large number of columns with few !!coefficients different from 0!

Exploiting Sparsity!

•  Simplex has a tendency to produce!!a dense tableau after a couple!!iterations!

Main Goal!•  Speeding computation!•  Making memory independent from the!!number of variables!

Linear Programming!

min cx s.t. Ax = b x ≥ 0

m rows

n columns

Aj: column j of A!cj: element j of c!bi: element i of b!

Basic Solution!Select a basis B (i.e., m linearly independent!columns)!

•  ABxB + ANxN = b!

•  ABxB = b – ANxN!

•  xB = AB-1(b-ANxN) = AB

-1b – AB-1ANxN!

•  c0 + cBxB + cNxN!

•  c0 + cB(AB-1b – AB

-1ANxN) + cNxN!

•  (c0 + CBAB-1b) + (CN – CBAB

-1AN)xN!

Fundamental observation:!

•  given the original statement!•  a basis AB!→ I can compute the new tableau easily!→ no need to store & update the whole tableau!

Simplex without Tableau!

Which operations are involved?!

•  Choosing an entering variable!•  Choosing a leaving variable!

Choosing an entering variable!coefficients: (CN – CBAB

-1AN)!solve: yAB = cB (or y = cBAB

-1)!compute: cN - yAN!

Choosing a leaving variable (generating a !Column e)!

coefficients: AB-1AN!

solve: ABd = Ae (or d = AB-1Ae)!

compute: d!

Simplex without Tableau!

Basic Operations!

Solving the systems!! ! !yAB = CB ABd = Ae

Change the Basis!B Bʼ!Bʼ differs from B by one entering and one!Leaving variables

Next step!Solving the systems!! ! !yAB’ = CB’ AB’d = Ae’

Simplex without Tableau!

Basic Idea!Maintain incrementally a representation!of AB or AB

-1 which makes it possible!to solve!! ! !yAB = CB ABd = Ae

Main Tools!•  Explicit representation of AB

-1!

•  LU factorization of AB!

Explicit Inverse!

Assume that we have AB-1 and we would!

like ABʼ-1, where

Bʹ′ B\{L} e{ }∪=

Where is ABʼ-1 in the tableau?

Explicit Inverse!b A Bユ

B 0

1 1 0

1 1

1 1 0

B0 = I

B1!

Bn-1!

Bn!

A = A0

A1!

An-1!

An!

pivot

pivot!Apply the same operations on Bi and Ai!

Bn-1An = A

BnBn-1An = BnA

An = BnA

Explicit Inverse!•  Given Bn and A (the original tableau)!

!we obtain An.!•  B0, B1, … , Bn are obtained by!

!traditional pivoting operations.!•  B0 can be the initial basis.!•  Revised simplex with the explicit !!inverse is a lazy form of the traditional!!simplex!

m

n

m

m pricing &

lea v ing

Example!min -60x1 - 30x2 - 20x3 8x1 + 6x2 + x3 + s1 = 48 4x1 + 2x2 + 1.5x3 + s2 = 20 2x1 + 0.5x2 + 0.5x3 + s3 = 8

B = {s1, s2, s3}

B0-1 =

1 0 00 1 00 0 1

Pricing!Cj* = CN – cBB0Aj

(-60, -30, -20) – (0, 0, 0) 1 0 00 1 00 0 1

8 6 14 2 1.52 1.50.5

=

(-60, -30, -20)

Select x1

Leaving:!

Example!compute the column of x1:Aj*=B0Aj!

1 0 00 1 00 0 1

842

842

=

compute the constant column!

compute the ratios!48/8, 20/4, 8/2!

s3 leaves the basis!

B1-1 = !

1 0 4–0 1 2–0 0 0.5

1 0 0 0 1 0 0 0 1

48 20 8

48 20 8

=

Example!Pricing again!

0 0 -60 1 0 -4 0 1 -2 0 0 0.5

0 0 -30 =

cBB1 (multipliers)!

Cj* = CN – cBB0Aj

c2 30– 0 0 30–620.5

– 15–= =

c3 20– 0 0 30–11.50.5

– 5–= =

s3 0 0 0 30–001

– 30= =

Select c3 from instance!

Example!Leaving:! B* = B1b =!

1 0 4–0 1 2–0 0 0.5

48208

1644

=

A3* = B1A3!

1 0 4–0 1 2–0 0 0.5

11.50.5

1–0.50.25

=

Leaving variable s2!

B2 =!1 2 8–0 2 4–0 0.5– 1.5

Explicit Inverse!•  less memory space!•  in general, faster!

However!nothing guarantees that the Bi will remain!sparse (and it will not in general)!

Can we do better?!

Product Form!Solving the systems!

yAB = cB ABd = Ae

Initially, AB = I so that this is easy to solve.!Subsequently, this is going to be more!complicated.!

Pivoting!replacing the column of the leaving!variable by the column of the entering!variable.!

ABʹ′ AB

1 d1d2d3

dm 1

×=

Product Form!First Step (entering x1, leaving s3)!

1 0 00 1 00 0 1

1 0 80 1 40 0 2

1 0 80 1 40 0 2

=

Second Step (entering x3, leaving s2)!1 0 80 1 40 0 2

d1d2d3

11.50.5

=

d1d2d3

1–0.50.25

=

1 0 80 1 40 0 2

1 1– 00 0.5 00 0.251

1 1 80 1.540 0.52

=

Product Form!The computation produces the matrices!

A1 = ABε1 A2 = A1ε2 ... An = An-1 εn

i.e.!An = AB ε1.. εn .

At step n, we need to solve the system!

yAn = CB And = Ae

How do we solve these?!

Product Form!ABε1 … εnd = Ae

  ABd0 = Ae (easy) ε1d1 = d0 . . εndn = dn-1 d = dn

The first system is easy since AB = I!The other systems are easy!

1 ° e1 ° °

° ° ° ° °

° ° ei ° °

° ° ° ° °

° ° em ° 1

d1°

di°

dm

f1°

f i°

fm

=

Product Form!After n iterations, we have!

AB’ = ABε1 … εn

When n is large, it is more efficient to compute!AB’d = Ae

than!AB ε1 … εnd = Ae

When this happens (determine this!experimentally), restart the whole process!with!

AB’ AB’ ε1’ AB’ ε1 ’ε2’ AB’ ε1’ ε2’ ε3’

This should preserve sparsity in some fashion,!since ABʼ is sparse (initial problem) and!ε1, … εn are sparse!

Product Form!Note however that!

AB’ ε1 … εnd = Ae

requires the solving of!AB’ d0 = Ae

This is going to take place at each iteration!

LU decomposition!obtain a LU decomposition ABʼ to speed!up this step.!

In general, we have!LU ε1…εnd Ae=

where each subsystem is reasonably easy!to solve!

LU Factorization!Find two matrices!

L U!

such that!A = L U!

and!L is unit lower diagonal!U is upper diagonal!

L

1 0 0 0 0° 1 0 0 0° ° 1 0 0° ° ° 1 0° ° ° ° 1

= U

1 ° ° ° °

0 1 ° ° °

0 0 1 ° °

0 0 0 1 °

0 0 0 0 1

=

Solving !L U d = e!•  solve Ld0 = e !(forward substitution)!•  solve Ud = d0 !(backward substitution)!

LU Factorization!How to compute the LU factorization!

A

a11a12… a1na21a22… a2n

° ° ° °

° ° ° °

an1 an2… anm

=

=!

A1 0v

a11--------- I n 1–

a11 w

0 Aʹ′ vwa11---------–

=

v is a (n-1)-column!w is a (n-1)-row!Aʼ is an (n-1) by (n-1) matrix!

a 11 w

v A ʹ′

LU Factorization!2 3 1 5 6 13 5 19 2 19 10 23 4 10 11 31

1 0 0 03 1 0 01 0 1 02 0 0 1

2 3 1 50 4 2 40 169 180 4 9 21

vwa11---------

9 3 153 1 56 2 10

=

LU Factorization!

A1 0v

a11--------- I n 1–

a11 w

0 Aʹ′ vwa11---------–

=

factorize Aʼ –vw/a11 into LʼUʼ!

A1 0v

a11--------- I n 1–

a11 w0 Lʹ′U ʹ′

=

A1 0v

a11--------- Lʹ′

a11 w0 U ʹ′

=

= LU!