l16 lp part2 homework review n design variables, m equations summary 1

29
L16 LP part2 • Homework • Review • N design variables, m equations • Summary 1

Upload: katie-huck

Post on 15-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

L16 LP part2

• Homework• Review• N design variables, m equations• Summary

1

H15 Prob 1

2

H15 prob 8.3

3

H15 Prob 8.8 and 8.9

4

H15 prob 8.19

5

H15 Prob 21

6

H15 Prob 21

7

432

431

421

321

432104 x

03 x02 x

01 x

x1 x2 x3 x4 b1 2 1 0 52 1 0 0 41 -1 0 -1 1

24

!

! !4! 4 3 2 1 4

43! 4 3 ! 3 2 1(1) 1

mn

nC

m n - m

C-

x1=0

8

basi

s

basis x2,x3,x4; and x1=0 means bring in x2 for x1 Infeasible-2*R2+R1 x3 -3 0 1 0 -3 x3=-3

x2 2 1 0 0 4 x2=4+R2toR3 x4 3 0 0 -1 5 x4=-5

f(x) = - x1 - 4x2 f = - 16basis x1,x3,x4; and x2=0 means bring in x1 for x2

-3 0 1 0 -3/R2 by 2 1 0.5 0 0 2

3 0 0 -1 5

3*R2+R1 x3 0 1.5 1 0 3 x3=3x1 1 0.5 0 0 2 x1=2

-3*R2+R3 x4 0 -1.5 0 -1 -1 x4=1f(x) = - x1 - 4x2 f = - 2

x2=0

9

-2*R2+R1 x3 -3 0 1 0 -3 x3=-3x2 2 1 0 0 4 x2=4

+R2toR3 x4 3 0 0 -1 5 x4=-5f(x) = - x1 - 4x2 f = - 16

basis x1,x3,x4; and x2=0 means bring in x1 for x2-3 0 1 0 -3

/R2 by 2 1 0.5 0 0 23 0 0 -1 5

3*R2+R1 x3 0 1.5 1 0 3 x3=3x1 1 0.5 0 0 2 x1=2

-3*R2+R3 x4 0 -1.5 0 -1 -1 x4=1f(x) = - x1 - 4x2 f = - 2

x3=0

10

3*R2+R1 x3 0 1.5 1 0 3 x3=3x1 1 0.5 0 0 2 x1=2

-3*R2+R3 x4 0 -1.5 0 -1 -1 x4=1f(x) = - x1 - 4x2 f = - 2

basis x1,x2,x4; and x3=0 means bring in x2 for x30 1.5 1 0 31 0.5 0 0 20 -1.5 0 -1 -1

/R1 by 1.5 0 1 0.666667 0 21 0.5 0 0 20 -1.5 0 -1 -1

Infeasiblex2 0 1 0.666667 0 2 x2=2

-0.5*R1+R2 x1 1 0 -0.33333 0 1 x1=11.5*R1+R3 x4 0 0 1 -1 2 x4= - 2

f(x) = - x1 - 4x2 f = - 9

x4=0

11

x2 0 1 0.666667 0 2 x2=2-0.5*R1+R2 x1 1 0 -0.33333 0 1 x1=11.5*R1+R3 x4 0 0 1 -1 2 x4= - 2

f(x) = - x1 - 4x2 f = - 9

basis x1,x2,x3; and x4=0 means bring x3 for x40 1 2/3 0 21 0 -1/3 0 10 0 1 -1 2

-3/2*R3+R1 x2 0 1 0 1.5 2/3 x2= 2/31/3*R3+R2 x1 1 0 0 -1/3 5/3 x1=5/3

x3 0 0 1 -1 2 x3=2f(x) = - x1 - 4x2 f = - 13/3

MINIMUM value

Prob 8.21 cont’d

12

Linear Programming Prob.s

13

j

k

jjijKiki

j

k

jjijKiki

j

k

jjijiKiki

kk

bxaorbxaxa

bxaorbxaxa

bxaorbxaxa

tsxcxcxcfMinimize

111

111

111

2211

..)(

x

Must convert to standard form LP Problem!

Transforming LP to Std Form LP

1. If Max, then f(x) = - F(x)2. If x is unrestricted, split into x+ and x-, and

substitute into f(x) and all gi(x) and renumber all xi

3. If bi < 0, then multiply constraint by (-1)

4. If constraint is ≤, then add slack si5. If constraint is ≥, then subtract surplus si14

Std Form LP Problem

15

ntojxmtoib

bxaxa

bxaxabxaxa

tsxcxcxcfMin

j

i

mnmnm

nn

nn

nn

1,01,0

..)(

11

22121

11111

2211

x Matrix form

All “≥0” i.e. non-neg.

0x0bbAx

xcx T

..

)(tsfMin

All “=“

Canonical form Ex 8.4 & TABLEAU

16

124

1

14

1

114

1

28

116

521

421

321

xxx

xxx

xxx

basis

Ex 8.4 cont’d

17

0,14/3

124

43

5

2

1

xxxxx

Pivot row

Pivot column

Terms• basic solutions - solutions created by setting (n-m)

variables to zero• basic feasible sol’ns - sol’ns @ vertices of feasibility

polygon• feasible solution - any solution in S polyhedron• basic variables - dependent variables, not set to zero • non-basic variables - independent variables, set to

zero, i.e. not in basis.• basis – identity columns of the coefficient matrix A

18

Method?

1. Set up LP prob in “tableau”2. Select variable to leave basis3. Select variable to enter basis (replace the one

that is leaving)4. Use Gauss-Jordan elimination to form

identity sub-matrix, (i.e. new basis, identity columns)

5. Repeat steps 2-4 until opt sol’n is found!

19

Can we be efficient?

• Are we at the min?• If not which non-basic variable should be

brought into basis?• Which basic variable should be removed to

make room for the new one coming on?

SIMPLEX METHOD!

20

Simplex Method – Part 1 of 2Single Phase Simplex Method

When the Standard form LP Problem has only≤ inequalties…. i.e. only slack variables, we can solve using the Single-Phase Simplex Method!

If surplus variables exist… we need the Two-Phase Simplex Method –with artificial variables… Sec 8.6 (after Spring Break)

21

Single-Phase Simplex Method1. Set up LP prob in a SIMPLEX tableau

add row for reduced cost, cj’ and column for min-ratio, b/a label the rows (using letters) of each tableau

2. Check if optimum, all non-basic c’≥0? 3. Select variable to enter basis(from non-basic)

Largest negative reduced cost coefficient/ pivot column

4. Select variable to leave basis Use min ratio column / pivot row

5. Use Gauss-Jordan elimination on rows to form new basis, i.e. identity columns

6.Repeat steps 2-5 until opt solution is found!22

23

Figure 8.3 Graphical solution to the LP problem Example 8.7. Optimum solution along line C–D. z*=4.

Ex 8.7 1 phase Simp Meth 1 2

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

( ) 2. .

4 3 1 0 0 122 1 0 1 0 41 2 0 0 1 4

Min f x xs tx x x x xx x x x xx x x x x

x

All constraints are “slack” typeTherefore, can use single-phase Simplex Method

Step 1. Set up Simplex Tableau

24

Simplex Tableaurow basic x1 x2 x3 x4 x5 b b/a_pivota x3 4 3 1 0 0 12b x4 2 1 0 1 0 4c x5 1 2 0 0 1 4d c' -2 -1 0 0 0 0

Step 2. check if optimum? X1 and x2 are <0! Continue!

Step3 & 4

25

3. Select variable to enter basis(from non-basic)Largest negative reduced cost coefficient/ pivot column

4. Select variable to leave basis Use min ratio column / pivot row

First Tableaurow basic x1 x2 x3 x4 x5 b b/a_pivot

a x3 4 3 1 0 0 12 3b x4 2 1 0 1 0 4 2 minc x5 1 2 0 0 1 4 4d c' -2 -1 0 0 0 0

Why use Min Ratio Rule?

26

We want to add x1 into basis, i.e. no longer is x1=0How much of x1 can we add?

1

2 3 4 5

2 3 4 5

2 3 4 5

2 3 4 5

2 3 4 5

2 3 4 5

let 24(2) 3 1 0 0 122(2) 1 0 1 0 41(2) 2 0 0 1 4

3 1 0 0 12 8 41 0 1 0 4 4 02 0 0 1 4 2 2

xx x x xx x x xx x x x

x x x xx x x xx x x x

Whoops!!!!

Step 5 Use Gauss-Jordan form new basis, i.e. identity columns

27

Second Tableaurow basic x1 x2 x3 x4 x5 b b/a_pivot

e x3 0 1 1 -2 0 4f x1 1 0.5 0 0.5 0 2g x5 0 1.5 0 -0.5 1 2h c' 0 0 0 1 0 4

f+ 4=0f = - 4Step 6. Repeat steps 2-5.

Step 2. Check if optimal?Since all c’≥0… We have found the optimal solution!

1

3

5

2 4

242

, 0( ) 4

xxxx xf

x

Use Excel to help with arithmetic?

28

See Excel spreadsheet on website

simplexEx8_7.xls

Summary• Need to transform into Std LP format

Unrestricted, slack, surplus variables, min = - Max

• Opt solution is on a vertex• Simplex Method moves efficiently from one

feasible combination of basic variables to another.

• Use Single-Phase Simplex Method when only “slack” type constraints.

• Use Excel to assist w/arithmetic

29