the simplex method. standard linear programming problem standard maximization problem 1. all...

27
The Simplex Method

Upload: irma-atkins

Post on 01-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

The Simplex Method

Page 2: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Standard Linear Programming Problem

Standard Maximization Problem

1. All variables are nonnegative.

2. All the constraints (the conditions) can be expressed as inequalities of the form:

ax + by ≤ c, where c is a positive constant

Page 3: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Illustrating Example (1)

Maximize the objective function:P(x,y) = 5x + 4ySubject to:x + y ≤ 202x + y ≤ 35-3x + y ≤ 12x ≥ 0y ≥ 0

Page 4: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Solution

Page 5: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

0

12

35

20

100045

010013

001012

000111

:

:

045

:

123,352,20

::,,

"",Re

45123,352,20

:

:

tsanconstpwvuyx

tablefollowingtheconstructWe

Second

pyx

followsasfunctionobjectivetheofformulatherewriteand

wyxvyxuyx

followsasfollowsaswandvu

riablesvaslacktroducinginbyesinequalitithewrite

yxpandyxyxyx

hadWe

formulaandconditionsgiventherewriteWe

First

Page 6: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

)(2,

,2/35.2/35201/20:,

)

(

.)(

.

.).5(

:)(

:.

:),(

:

0

12

35

20

100045

010013

001012

000111

entryelementpivottheistheiswhichentryingcorrespond

thesoandsmallesttheisquotientTheandarequotientstheHere

rowpivottheislocated

isitwhererowtheandelementpivottheisquotientsmallestthetoingcorrespondentryThe

quotientahavenotdowethennegativeisentrythatIfquotientpositiveaobtainto

columnpivottheinentrypositiveingcorrespondthebyroweachinntconstathedivideWeb

columnxtheiscolumnpivottheThushereiswhch

linethetoleftrowlasttheinentrynegativemostthecontainingcolumntheiswhich

columnpivotthelocateWea

followsasentryelementpivotthelocateWe

Third

tsanconstpwvuyx

Page 7: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

2175

2129

235

25

25

23

23

25

21

21

21

21

)5(,)3(,)(

235

21

21

2

1

1000

0100

0001

0010

0

12

20

100045

010013

0001

000111

0

12

35

20

100045

010013

001012

000111

.;'0

1

423212

2

tsanconstpwvuyx

tsanconstpwvuyx

tsanconstpwvuyx

columnunitatocolumnthatingtransformthusstocolumnpivottheinentriesotherthe

andtoelementpivotthetransformtooperationsrowelementarynecessarytheperformWe

Fourth

RRRRRR

R

Page 8: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

)(2

1,,

2

55

425

5

129

2

5/

2

12935.

2

1/

2

35,5

2

1/

2

5:,

)

(

.)(

.

.).2

3(

:)(

:.

)3(

)4()3(

1000

0100

0001

0010

2

3:,,

.,,

:

2175

2129

235

25

25

23

23

25

21

21

21

21

entryelementpivottheisrowfirstthein

theiswhichentryingcorrespondthesoandsmallesttheisquotientThe

andarequotientstheHere

rowpivottheislocated

isitwhererowtheandelementpivottheisquotientsmallestthetoingcorrespondentryThe

quotientahavenotdowethennegativeisentrythatIfquotientpositiveaobtainto

columnpivottheinentrypositiveingcorrespondthebyroweachinntconstathedivideWeb

columnytheiscolumnpivottheThushereiswhch

linethetoleftrowlasttheinentrynegativemostthecontainingcolumntheiswhich

columnpivotthelocateWea

Step

andstepsepeatR

tsanconstpwvuyx

iswhichrowlasttheinentrynegativeahaveweHere

fourandthreesteprepeatweentriesnegativcontainsstillrowlastthethatafterIf

Fifth

Page 9: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

95

52

15

5

101300

014500

001101

001110

1000

0100

0001

0010

.;

'01

)4(

4131211 )3(,)5(,)(,2

2175

2129

235

25

25

23

23

25

21

21

21

21

tsanconstpwvuyx

tsanconstpwvuyx

columnunitatocolumnthatingtransformthus

stocolumnpivottheinentriesothertheandtoelementpivot

thetransformtooperationsrowelementarynecessarytheperformWe

Step

RRRRRRR

Page 10: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

520,0,5,15max

95max

9552,0,5,15

:

).(

1&

))((

:

.

,

:

wandvuyxwhenoccursvalueThis

ispfunctionobjectivetheofvaluetheTherfore

pandwvuyx

Thus

columnunitawithassiciatedonesthe

ariablesvbasicforthecontainingrowtheinlyingntstaconingcorrespondthe

columnunitaheadingwithassiciatednotonesthe

ariablesvnonbasicallforzero

aresolutinoptialthistoariablesvtheofvaluesingcorrespondThe

reachedbeenhassolutionoptimalthethatmeanswhich

positivearelinetheofleftthetorowlasttheinetriesallNow

Sixth

Page 11: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

What about when all of the constraints (the inequalities) are of

the type “≤ positive constant”But we want to minimize the objective function instead of

maximizing.

Page 12: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Minimization with “≤” constraintsIllustrating Example (2)

Minimize the objective function:p(x,y) = -2x - 3ySubject to:5x + 4y ≤ 32x + 2y ≤ 10x ≥ 0y ≥ 0

Page 13: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

SolutionLetq(x) = - p(x) = - ( -2x -3y) = 2x + 3yTo minimize p is to maximize q. Thus, we solve the

following standard maximization linear programming problem:

Maximize the objective function:q(x) = 2x + 3ySubject to:5x + 4y ≤ 32x + 2y ≤ 10x ≥ 0y ≥ 0

Page 14: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Rewriting the inequalities as equations, by introducing the “slack” variables u and v and the formula of the objective function as done in example (1).

5x + 4y ≤ 32 , x + 2y ≤ 10 and q = 2x +3y

Are transformed to:

5x + 4y + u = 32

x + 2y + v = 10

- 2x - 3y + q = 0

Page 15: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

)3,4(),(17,min

:,

)3,4(),(17,max

173,4:

17

.

3

4

100

.....

010

001

:),1(

0

.

10

32

10032

.....

01021

00145

:tableaussimplextheconstructWe

0 q3y2x- 10,v2y x32,u4y 5x

,

67

61

65

61

32

31

yxatiswhichvaluetheattainsp

thenqpSince

yxatiswhichvaluetheattainsq

qandyxThus

antsconstqvuyx

atarriveweexampleinxplainedeasmethodtheApplying

antsconstqvuyx

haveWe

Page 16: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Standard Linear Programming Problem

Standard Minimization Problem

1. All variables are nonnegative.

2. All the constraints (the conditions) can be expressed as inequalities of the form:

ax + by ≥ c, where c is a positive constant

Page 17: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Solving

The Standard Minimization Problem

We use the fundamental theorem of Duality

Page 18: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Illustrating Example (3)

Minimize the objective function:p(x,y) = 6x + 8ySubject to:40x + 10y ≥ 240010x + 15y ≥ 21005x + 15y ≥ 1500x ≥ 0y ≥ 0

Page 19: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Minimize the objective function: p(x,y) = 6x + 8ySubject to:40x + 10y ≥ 2400, 10x + 15y ≥ 2100 , 5x + 15y ≥ 1500, x ≥ 0 and y ≥ 0We will refer to the above given problem by the primal (original) problem

First: We construct the following table, which we will refer to by the “primal” table:x y constant---------------------------------40 10 240010 15 21005 15 1500---------------------------------6 8

Second: We construct a dual (twin) table from interchanging the rows and columns in the primal table:

x' y' z' constant----------------------------------------------------------- 40 10 5 6 10 15 15 8---------------------------------------------------------2400 2100 1500

Third: We interpret the “dual table” as a standard maximization problem, which will refer to as the “dual problem” or “twin problem” of the “primal problem” or the “original problem”

Miaximoze the objective function: q( x ' , y ' , z ' ) = 2400x' + 2100y' + 1500z'Subject to:40x' + 10y' + 5z' ≤ 6, 10x' + 15y' + 15z' ≤ 8 , x' ≥ 0 and y' ≥ 0, z' ≥ 0

Page 20: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Fourth: We apply the simplex method explained in example (1) to solve this problem

Maximize the objective function: q(x,y,z) = 2400x' + 2100y' + 1500z'

Subject to:

40x' + 10y' + 5z' ≤ 6, 10x' + 15y' + 15z' ≤ 8 , x' ≥ 0 and y' ≥ 0, z' ≥ 0

4.a.Rewriting the inequalities and the formula of the objective function, with the slack variables being the same x and y (in that order) of the original (minimization) problem :

40x' + 10y' + 5z' + x = 6

10x' + 15y' + 15z' + y = 8

- 2400x' - 2100y' - 1500z‘ + q = 0

4.b. We construct the simplex table for this problem

Page 21: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

1140

.

11203045000

......

010

001

:

..4

0

.

8

6

100150021002400

......

010151510

00151040

0 q z1500 - 2100y' - 2400x' -

8 y 15z' 15y' 10x'

6 x 5z' 10y' 40x'

2513

501

252

501

1011

501

1003

203

antconstqyxzyx

tablefollowingthetoleadwillwhichmethodsimplextheby

dnecessiateoperationsrowelementarytheallperformWec

antconstqyxzyx

Page 22: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Fifth: We read the solution from the table

4)2(20))2,0(

2,0:max

:

440)2(20)2,0(

:

4maxmin

20:

:""

min)(

4

.

2

3

12001

......

01011

01101

q

yxwhenisq

Checking

p

pofformulathefromanswerthisgetalsocanWe

qofvaluethepofvalueThe

yandxThus

yandxariablesvslacktheunderrowlasttheinappears

problemimizationoriginalprimalthetosolutionThe

antconstqyxyx

Page 23: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Illustrating Example (4)

Minimize the objective function:p(x,y) = x + 2ySubject to:-2x + y ≥ 1- x + y ≥ 2x ≥ 0y ≥ 0

Page 24: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Minimize the objective function: p(x,y) = x + 2ySubject to:-2x + y ≥ 1, - x + y ≥ 2 We will refer to the above given problem by the primal (original) problem

First: We construct the following table, which we will refer to by the “primal” table:x y constant----------------------------------2 1 1-1 1 2---------------------------------1 2

Second: We construct a dual (twin) table from interchanging the rows and columns in the primal table:

x' y' constant------------------------------------------- -2 -1 1 1 1 2-----------------------------------------1 2

Third: We interpret the “dual table” as a standard maximization problem, which will refer to as the “dual problem” or “twin problem” of the “primal problem” or the “original problem”

Maximize the objective function: q( x ' , y ‘ ) = x' + 2y' Subject to:-2x' - y' ≤ 1, x' + y' ≤ 2 , x' ≥ 0 and y' ≥ 0

Page 25: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Fourth: We apply the simplex method explained in example (1) to solve this problem

Maximize the objective function: q( x ' , y ‘ ) = x' + 2y'

Subject to:

- 2x' - y' ≤ 1, x' + y' ≤ 2 , x' ≥ 0 and y' ≥ 0

4.a.Rewriting the inequalities and the formula of the objective function, with the slack variables being the same x and y (in that order) of the original (minimization) problem :

- 2x' - y' ' + x = 1

x' + y' + y = 2

- x' - 2y' + q = 0

4.b. We construct the simplex table for this problem

Page 26: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

4

.

2

3

12001

......

01011

01101

:

..4

0

.

2

1

10021

......

01011

00112

0 q 2y' - x'-

2 y y' x'

1 x ' y' - 2x' -

antconstqyxyx

tablefollowingthetoleadwillwhichmethodsimplextheby

dnecessiateoperationsrowelementarytheallperformWec

antconstqyxyx

Page 27: The Simplex Method. Standard Linear Programming Problem Standard Maximization Problem 1. All variables are nonnegative. 2. All the constraints (the conditions)

Homework

1. Using the simplex method, maximize: p = x + (6/5)y subject to:2x + y ≤ 180 , x + 3y ≤ 300 , x ≥ 0 , y ≥ 0Solution: p(48,84) = 148.8

2. Minimize: p(x,y) = - 5x - 4y Subject to: x + y ≤ 20 , 2x + y ≤ 35 , -3x + y ≤ 12 , x ≥ 0y ≥ 0Solution: p(15,5) = - 95

3. Using the dual theorem, minimize: p = 3x + 2y subject to:8x + y ≥ 80 , 8x + 5y ≥ 240 , x + 5y ≥ 100, x ≥ 0 , y ≥ 0Solution: p(20,16) = 92Maximize the objective function: