optimization mechanics of the simplex method

24
1 Optimization Mechanics of the Simplex Method

Upload: cruz-chen

Post on 01-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

Optimization Mechanics of the Simplex Method. Simplex Method. Find initial corner point (basic) feasible solution. Usually, the origin is a basic feasible solution. Iterate until the stopping conditions are met. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Optimization Mechanics of the Simplex Method

1

Optimization

Mechanics of the Simplex Method

Page 2: Optimization Mechanics of the Simplex Method

2

Simplex Method1. Find initial corner point (basic) feasible solution.

– Usually, the origin is a basic feasible solution.

2. Iterate until the stopping conditions are met.a. Are we optimal yet? Look at the current version of the objective

function to see if an entering basic variable is available. If not, then the current basic feasible solution is the optimum solution.

b. Select the entering variable: choose the non-basic variable that gives the fastest rate of increase in the objective function value.

c. Select the leaving variable by applying the Minimum Ratio Test.

d. Update the equations to reflect new basic feasible solution.

e. Go to step (a).

Page 3: Optimization Mechanics of the Simplex Method

3

TableauBasic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

S4 0 0 1 0 0 0 1 6

0,,,,,

6

9

80810

77117

tosubject

175150Maximize

432121

42

31

221

121

21

SSSSxx

Sx

Sx

Sxx

Sxx

xxZ

0)0()0()0()0(175150 432121 SSSSxxZ

First, we create a "tableau" out of the augmented system of equations and pick the origin as the starting point.

Page 4: Optimization Mechanics of the Simplex Method

4

Tableau (Proper Form)Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

S4 0 0 1 0 0 0 1 6

Characteristics of a tableau in proper form:• Exactly 1 basic variable per equation.

• The coefficient of the basic variable is always exactly +1, and the coefficients above and below the basic variable in the same column are all 0.

• Z is treated as the basic variable for the objective function row.

Page 5: Optimization Mechanics of the Simplex Method

5

Tableau (Proper Form)Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

S4 0 0 1 0 0 0 1 6

• When a tableau is in the proper form– The RHS values are the value of the basic variables.

– What is the value of x1?

• x1 is a non-basic variable, so its value is 0.

– What is the value of Z?• 0. (Z is a basic variable, so look at the RHS column)

Page 6: Optimization Mechanics of the Simplex Method

6

Are we optimal yet?Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

S4 0 0 1 0 0 0 1 6

• We are optimal if no entering basic variable is available (i.e., no basic variable, if introduced, can increase the value of Z).

• If there is any negative coefficient in the objective function row, then the current basic solution is not optimal.

Page 7: Optimization Mechanics of the Simplex Method

7

Select the entering basic variable

Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

S4 0 0 1 0 0 0 1 6

• Select the variable with the most negative coefficient in the objective function row as the entering variable.– We won't accidentally select a basic variable. Why?

• The column corresponds to the entering basic variable becomes the pivot column.

Page 8: Optimization Mechanics of the Simplex Method

8

Select the leaving basic variable

Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77 77/11=7

S2 0 10 8 0 1 0 0 80 80/8=10

S3 0 1 0 0 0 1 0 9 no limit

S4 0 0 1 0 0 0 1 6 6/1=6

• Perform Minimum Ratio Test (MRT)– Special cases: If the coefficient of the entering basic

variable is not a positive number, enter "no limit".

• Select the variable corresponding to the smallest MRT value as the leaving basic variable. Call the corresponding row the pivot row.

Page 9: Optimization Mechanics of the Simplex Method

9

Updating the tableauBasic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

x2 0 0 1 0 0 0 1 6

• Step 1: Replace the leaving basic variable in the "Basic" column by the entering basic variable.

• Step 2: Turn the tableau into a proper form – How?

Page 10: Optimization Mechanics of the Simplex Method

10

Updating the tableauBasic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 -175 0 0 0 0 0 never

S1 0 7 11 1 0 0 0 77

S2 0 10 8 0 1 0 0 80

S3 0 1 0 0 0 1 0 9

x2 0 0 1 0 0 0 1 6

• The coefficient of all the basic variables must be +1.– Divide the row corresponds to the entering basic variable

by its coefficient.

• The coefficients above and below the basic variable in the same column must be turned into 0.

– Apply (Gaussian) elimination steps

Page 11: Optimization Mechanics of the Simplex Method

11

End of iteration #1Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 0 0 0 0 175 1050 never

S1 0 7 0 1 0 0 -11 11

S2 0 10 0 0 1 0 -8 32

S3 0 1 0 0 0 1 0 9

x2 0 0 1 0 0 0 1 6

• When x1 = 0, x2 = 6, Z = 1050.

• Note: The columns correspond to the "old" basic variables do not change. (Why?)

• Are we optimal yet?

Page 12: Optimization Mechanics of the Simplex Method

12

Iteration #2Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 0 0 0 0 175 1050 never

S1 0 7 0 1 0 0 -11 11 11/7=1.571

S2 0 10 0 0 1 0 -8 32 32/10=3.2

S3 0 1 0 0 0 1 0 9 9

x2 0 0 1 0 0 0 1 6 no limit

• Select the entering basic variable: x1

• Perform MRT test and select the leaving basic variable: S1

Page 13: Optimization Mechanics of the Simplex Method

13

Iteration #2Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 -150 0 0 0 0 175 1050 never

x1 0 1 0 1/7 0 0 -11/7 11/7

S2 0 10 0 0 1 0 -8 32

S3 0 1 0 0 0 1 0 9

x2 0 0 1 0 0 0 1 6

• Updating tableau– Replace S1 by x1 in the "Basic" column

– Divide pivot row by coefficient of x1 (=7)

Page 14: Optimization Mechanics of the Simplex Method

14

Iteration #2Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 0 0 150/7 0 0 -425/7 9000/7 never

x1 0 1 0 1/7 0 0 -11/7 11/7

S2 0 0 0 -10/7 1 0 54/7 114/7

S3 0 0 0 -1/7 0 1 11/7 52/7

x2 0 0 1 0 0 0 1 6

• Updating tableau (continue)– Apply elimination steps.

(End of iteration #2)

• Are we optimal yet?

Page 15: Optimization Mechanics of the Simplex Method

15

Iteration #3Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 0 0 150/7 0 0 -425/7 9000/7 never

x1 0 1 0 1/7 0 0 -11/7 11/7 no limit

S2 0 0 0 -10/7 1 0 54/7 114/7 114/54

S3 0 0 0 -1/7 0 1 11/7 52/7 52/11

x2 0 0 1 0 0 0 1 6 6

• Select the entering basic variable: S4

• Perform MRT test and select the leaving basic variable: S2

Page 16: Optimization Mechanics of the Simplex Method

16

Iteration #3Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 0 0 150/7 0 0 -425/7 9000/7 never

x1 0 1 0 1/7 0 0 -11/7 11/7

S4 0 0 0 -10/54 7/54 0 1 114/54

S3 0 0 0 -1/7 0 1 11/7 52/7

x2 0 0 1 0 0 0 1 6

• Updating tableau– Replace S2 by S4 in the "Basic" column

– Divide pivot row by coefficient of S4 (=54/7)

Page 17: Optimization Mechanics of the Simplex Method

17

Iteration #3Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 0 0 10.185 7.870 0 0 1413.889 never

x1 0 1 0 -0.148 0.204 0 0 4.889

S4 0 0 0 -0.185 0.130 0 1 2.111

S3 0 0 0 0.148 -0.204 1 0 4.111

x2 0 0 1 0.185 -0.130 0 0 3.889

• Updating tableau (continue)– Apply elimination steps.

(End of iteration #3)

• Are we optimal yet?

Page 18: Optimization Mechanics of the Simplex Method

18

Iteration #3Basic Z x1 x2 S1 S2 S3 S4 RHS MRT

Z 1 0 0 10.185 7.870 0 0 1413.889 never

x1 0 1 0 -0.148 0.204 0 0 4.889

S4 0 0 0 -0.185 0.130 0 1 2.111

S3 0 0 0 0.148 -0.204 1 0 4.111

x2 0 0 1 0.185 -0.130 0 0 3.889

• Because there is no more negative coefficient in the objective function row, we cannot further improve the value of the objective function.

• The optimal value of the objective function is 1413.889 when x1 = 4.889 and x2 = 3.889.

Page 19: Optimization Mechanics of the Simplex Method

19

Special Cases in Tableau Manipulation

• In case of tie for the entering basic variable, select any of the tying variables.– When will a tie occur for the entering variable?

• In case of tie for the leaving basic variable, select any of the tying variables.– When will a tie occur for the leaving variable?– What does it mean when all MRT yield "No limit"?

• Increasing the value of the entering variable does not affect any variable. i.e., the problem is unbounded.

Page 20: Optimization Mechanics of the Simplex Method

20

Special Cases in Tableau Manipulation

Note: Here the coefficient is referring to the coefficient of a variable in the objective function row in the tableau.

• At the optimum, what's the coefficient of a non-basic variable?

• At the optimum, what's the coefficient of a basic variable?

• What does it mean when the coefficient of a non-basic variable is zero at the optimum?– We have alternate optimal solutions. i.e., increasing

the value of that non-basic variable does not increase or decrease the value of Z.

Page 21: Optimization Mechanics of the Simplex Method

21

Directions & References• Solving non-standard linear programming.

– Equality and greater-than-or-equal-to (≥) constraints– Variables that can be negative or unrestricted

variables

• Sensitivity Analysis• LP in practice: Revised Simplex method, interior

point methods.

• Ref: http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 22: Optimization Mechanics of the Simplex Method

22

Summary• Simplex Method for solving "Standard Form" LP

problems– Algorithm

– Understand the characteristics of the slack variables

– Understand how to select entering/leaving variables

– Performing simplex method in tableau form

– Understand the characteristics of the tableau (which can give you additional info of the problem).

Page 23: Optimization Mechanics of the Simplex Method

23

Summary – Optimization• One dimensional unconstrained

optimization – function with one variable– Newton's Method for finding x s.t. f'(x) = 0.– Bracketing methods (Iterative)

• Golden Section Search• Quadratic Interpolation

– Hybrid methods

Page 24: Optimization Mechanics of the Simplex Method

24

Summary – Optimization• Multi-dimensional unconstrained optimization –

function with 2 or more variables– Random Search

• Its advantages and disadvantages

– The "General Iterative Algorithm" for finding optimal point using either non-gradient and gradient methods.

– Non-gradient Methods• Univariate Search and Powell's Method

– Gradient Methods• Evaluate partial derivative• Derive gradients and Hessian matrix• Determine if a point is a maximum, minimum, or saddle point

using Hessian matrix• Finding optimal point in a given direction• Steepest Ascent and Newton's Method