Download presentation

Presentation is loading. Please wait.

Published byMaleah Cheatham Modified about 1 year ago

1
Part 3IE 3121 Solving LP Models Improving Search Unimodal Convex feasible region Should be successful! Special Form of Improving Search Simplex method (now) Interior point methods (later)

2
Part 3IE 3122 Simple Example Top Brass Trophy Company Makes trophies for football wood base, engraved plaque, brass football on top $12 profit and uses 4 ’ of wood soccer wood base, engraved plaque, soccer ball on top $9 profit and uses 2 ’ of wood Current stock 1000 footballs, 1500 soccer balls, 1750 plaques, and 4800 feet of wood

3
Part 3IE 3123 Formulation

4
Part 3IE 3124 Graphical Solution 2000 1500 1000 500 500 1000 1500 2000 Optimal Solution

5
Part 3IE 3125 Feasible Solutions Feasible solution is a boundary point if at least one inequality constraint that can be strict is active interior point if no such constraints are active Extreme points of convex sets do not lie within the line segment of any other points in the set

6
Part 3IE 3126 Example 2000 1500 1000 500 500 1000 1500 2000

7
Part 3IE 3127 Optimal Solutions Every optimal solution is a boundary point We can find an improving direction whenever we are at an interior point If optimum unique the it must be an extreme point of the feasible region If optimal solution exist, an optimal extreme point exists

8
Part 3IE 3128 LP Standard Form Easier if we agree on exactly what a LP should look like Standard form only equality main constraints only nonnegative variables variables appear at most once in left-hand- side and objective function all constants appear on right hand side

9
Part 3IE 3129 Converting to Standard Inequality constraints Add nonnegative, zero-cost slack variables Add in inequalities Subtract in inequalities Variables not nonnegative nonpositive - substitute with negatives unrestrictive sign (URS) - substitute difference of two nonnegative variables

10
Part 3IE 31210 Top Brass Model

11
Part 3IE 31211 Why? Feasible directions Check only if active Keep track of active constraints Equality constraints Always active Inequality constraints May or may not be active Prefer equality constraints!

12
Part 3IE 31212 Standard Notation

13
Part 3IE 31213 LP Standard Form In standard notation In matrix notation

14
Part 3IE 31214 Write in Matrix Form

15
Part 3IE 31215 Extreme Points Know that an extreme point optimum exists Will search trough extreme points An extreme point is define by a set of constraints that are active simultaneously

16
Part 3IE 31216 Improving Search Move from one extreme point to a neighboring extreme point Extreme points are adjacent if they are defined by sets of active constraints that differ by only one element An edge is a line segment determined by a set of active constraints

17
Part 3IE 31217 Basic Solutions Extreme points are defined by set of active nonnegativity constraints A basic solution is a solution that is obtained by fixing enough variable to be equal to zero, so that the equality constraints have a unique solution

18
Part 3IE 31218 Example Choose x 1, x 2, x 3, x 4 to be basic

19
Part 3IE 31219 Where is the Basic Solution? 2000 1500 1000 500 500 1000 1500 2000

20
Part 3IE 31220 Example Compute the basic solution for x 1 and x 2 basis: Solve

21
Part 3IE 31221 Existence of Basis Solutions Remember linear algebra? A basis solution exists if and only if the columns of corresponding equality constraint form a basis (in other words, a largest possible linearly independent collection)

22
Part 3IE 31222 Checking The determinant of a square matrix D is A matrix is singular if its determinant = 0 and otherwise nonsingular Need to check that the matrix is nonsingular

23
Part 3IE 31223 Example Check whether basic solutions exist for

24
Part 3IE 31224 Basic Feasible Solutions A basic feasible solution to a LP is a basic solution that satisfies all the nonnegativity contraints The basic feasible solutions correspond exactly to the extreme points of the feasible region

25
Part 3IE 31225 Example Problem Suppose we have x 3, x 4, x 5 as slack variables in the following LP: Lets plot the original problem, compute the basic solutions and check feasibility

26
Part 3IE 31226 Solution Algorithm Simplex Algorithm Variant of improving search Standard display:

27
Part 3IE 31227 Simplex Algorithm Starting point A basic feasible solution (extreme point) Direction Follow an edge to adjacent extreme point: Increase one nonbasic variable Compute changes needed to preserve equality constraints One direction for each nonbasic variable

28
Part 3IE 31228 Top Brass Example Initial solution Basic variables

29
Part 3IE 31229 Looking in All Directions … Must adjust these! Can increase either one of those

30
Part 3IE 31230 So Many Choices... Want to try to improve the objective The reduced cost of a nonbasic variable: Want Defines improving direction

31
Part 3IE 31231 Top Brass Example Improving x 1 gives Improving x 2 gives Both directions are improving directions!

32
Part 3IE 31232 Where and How Far? Any improving direction will do If no component is negative Improve forever - unbounded! Otherwise, compute the minimum ratio

33
Part 3IE 31233 Computing Minimum Ratio

34
Part 3IE 31234 Moving to New Solution

35
Part 3IE 31235 Updating Basis New basic variable Nonbasic variable generating direction New nonbasic variable(s) Basic variables fixing the step size

36
Part 3IE 31236 What Did We Do? 2000 1500 1000 500 500 1000 1500 2000

37
Part 3IE 31237 Where Will We Go? 2000 1500 1000 500 500 1000 1500 2000 Why is this guaranteed? Optimum in three steps!

38
Part 3IE 31238 Simplex Algorithm (Simple) Step 0: Initialization. Choose starting feasible basis, construct basic solution x (0), and set t=0 Step 1: Simplex Directions. Construct directions Dx associated with increasing each nonbasic variable x j and compute the reduced cost c j =c · x. Step 2: Optimality. If no direction is improving, then stop; otherwise choose any direction x (t+1) corresponding to some basic variable x p. Step 3: Step Size. If no limit on move in direction x (t+1) then stop; otherwise choose variable x r such that Step 4: New Point and Basis. Compute the new solution and replace x r in the basis with x p. Let t = t+1 and go to Step 1.

39
Part 3IE 31239 Stopping The algorithm stop when one of two criteria is met: In Step 2 if no improving direction exists, which implies local optimum, which implied global optimum In Step 3 if no limit on improvement, which implies problem is unbounded

40
Part 3IE 31240 Optimization Software Spreadsheet (e.g, MS Excel with What ’ s Best!) Optimizers (e.g., LINDO) Combination Modeling Language Solvers Either together (e.g., LINGO) or separate (e.g., GAMS with CPLEX) LINDO and LINGO are in Room 0010 (OR Lab) Also on disk with your book

41
Part 3IE 31241 LINDO The main software that I ’ ll ask you to use is called LINDO Solves linear programs (LP), integer programs (IP), and quadratic programs (QP) We will look at many of its more advanced features later on, but as of yet we haven ’ t learned many of the concepts that we need

42
Part 3IE 31242 Example

43
Part 3IE 31243 LINDO Program MAX 12 x1 + 9 x2 ST x1 + x2 = 1000 x2 + x4 = 1500 x1 + x2 + x5 = 1750 4x1+ 2x2 + x6 = 4800 x1>=0 x2>=0 x3>=0 x4>=0 x5>=0 x6>=0 END

44
Part 3IE 31244

45
Part 3IE 31245

46
Part 3IE 31246 Output LP OPTIMUM FOUND AT STEP 4 OBJECTIVE FUNCTION VALUE 1) 12000.00 VARIABLE VALUE REDUCED COST X1 1000.000000 0.000000 X2 0.000000 3.000000 X4 1500.000000 0.000000 X5 750.000000 0.000000 X6 800.000000 0.000000 X3 0.000000 0.000000

47
Part 3IE 31247 Output (cont.) ROW SLACK OR SURPLUS DUAL PRICES 2) 0.000000 12.000000 3) 0.000000 0.000000 4) 0.000000 0.000000 5) 0.000000 0.000000 6) 1000.000000 0.000000 7) 0.000000 0.000000 8) 0.000000 0.000000 9) 1500.000000 0.000000 10) 750.000000 0.000000 11) 800.000000 0.000000 NO. ITERATIONS= 4

48
Part 3IE 31248 LINDO: Basic Syntax Objective Function Syntax: Start all models with MAX or MIN Variable Names: Limited to 8 characters Constraint Name: Terminated with a parenthesis Recognized Operators (+, -, >, <, =) Order of Precedence: Parentheses not recognized

49
Part 3IE 31249 Syntax (cont.) Adding Comment: Start with an exclamation mark Splitting lines in a model: Permitted in LINDO Case Sensitivity: LINDO has none Right-hand Side Syntax: Only constant values Left-hand Side Syntax: Only variables and their coefficients

50
Part 3IE 31250 Why Modeling Language? More to learn! More ‘ complicated ’ to use than LINDO (at least at first glance) Advantages Natural representations Similar to mathematical notation Can enter many terms simultaneously Much faster and easier to read

51
Part 3IE 31251 Why Solvers? Best commercial software has modeling language and solvers separated Advantages: Select solver that is best for your application Learn one modeling language use any solver Buy 3rd party solvers or write your own!

52
Part 3IE 31252 Example Problem

53
Part 3IE 31253 Problem Formulation

54
Part 3IE 31254 LINDO Solution max 1.60 x1 + 1.40 x2 + 1.90 x3 + 1.20 x4 st x1 + x2 + x3 + x4 <=1200 x1 >= 310 x1 <= 434 x2 >= 245 x2 <= 343 x3 >= 255 x3 <= 357 x4 >= 190 x5 <= 266 end

55
Part 3IE 31255 LINGO Solution Capacity constraint @SUM(REGIONS(I): CASES(I)) <=1200; Minimum/maximum cases @FOR(REGIONS(I): CASES(I) <= UBOUND; CASES(I) >= LBOUND);

56
Part 3IE 31256 LINGO Solution Objective function MAX = @SUM(REGIONS(I): PROFIT*CASES(I)); We also need to define REGIONS, CASES, etc, and type in the data.

57
Part 3IE 31257 LINGO Solution Defining sets SETS: REGIONS / NE SE MW W/: LBOUND, UBOUND, PROFIT, CASES; ENDSETS

58
Part 3IE 31258 LINGO Solution Enter the data DATA: LBOUND = 310 245 255 190; UBOUND = 434 343 357 266; PROFIT = 1.6 1.4 1.9 1.2; ENDDATA

59
Part 3IE 31259 Sensitivity Analysis Basic Question: How does our solution change as the input parameters change? The objective function? More/less profit or cost The optimal values of decision variables? Make different decisions! Why? Only have estimates of input parameters May want to change input parameters

60
Part 3IE 31260 What We Know Qualitative Answers for All Problems Quantitative Answers for Linear Programs (LP) Dual program Same input parameters Decision variables give sensitivities Dual prices Easy to set up Theory is somewhat complicated

61
Part 3IE 31261 Back to Example Problem

62
Part 3IE 31262 LINDO Formulation max 1.60 x1 + 1.40 x2 + 1.90 x3 + 1.20 x4 st x1 + x2 + x3 + x4 <=1200 x1 >= 310 x1 <= 434 x2 >= 245 x2 <= 343 x3 >= 255 x3 <= 357 x4 >= 190 x5 <= 266 end

63
Part 3IE 31263 LINDO Solution (second half) ROW SLACK OR SURPLUS DUAL PRICES 2) 0.000000 1.600000 3) 98.000000 0.000000 4) 26.000000 0.000000 5) 0.000000 -0.200000 6) 98.000000 0.000000 7) 102.000000 0.000000 8) 0.000000 0.300000 9) 0.000000 -0.400000 10) 266.000000 0.000000

64
Part 3IE 31264 Dual Prices The Dual is Automatically Formed Also in LINGO Also in (all) other optimization software Report dual prices Gives us sensitivities to RHS parameter Know how much objective function will change When will the optimal solution change? Need to select that we want sensitivity analysis

65
Part 3IE 31265 LINDO Sensitivity Analysis (part) RANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGES VARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE X1 1.600000 0.300000 0.200000 X2 1.400000 0.200000 INFINITY X3 1.900000 INFINITY 0.300000 X4 1.200000 0.400000 INFINITY X5 0.000000 0.000000 INFINITY

66
Part 3IE 31266 Interpretation As long as prices for the NE region are between $1.4 and $1.9, we want to sell the same quantity to each region, etc.

67
Part 3IE 31267 Example An insurance company is introducing two new product lines: special risk insurance and mortgages. The expected profit is $5 per unit on special risk insurance and $2 per unit on mortgages. Management wishes to establish a sales target for the new product lines to maximize the expected profit. The work requirements are as follows:

68
Part 3IE 31268 LINDO Formulation max 5 x1 + 2 x2 st 3 x1 + 2 x2 <= 2400 x2 <= 800 2 x1 <= 1200 x1 >=0 x2 >=0 end

69
Part 3IE 31269 Graphical Solution 100 200 300 400 500 600 700 800 800 700 600 500 400 300 200 100

70
Part 3IE 31270 Solution VARIABLE VALUE REDUCED COST X1 600.000000 0.000000 X2 300.000000 0.000000 ROW SLACK OR SURPLUS DUAL PRICES 2) 0.000000 1.000000 3) 500.000000 0.000000 4) 0.000000 1.000000 5) 600.000000 0.000000 6) 300.000000 0.000000

71
Part 3IE 31271 Sensitivity Analysis RANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGES VARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE X1 5.000000 INFINITY 2.000000 X2 2.000000 1.333333 2.000000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 2400.000000 1000.000000 600.000000 3 800.000000 INFINITY 500.000000 4 1200.000000 400.000000 666.666687 5 0.000000 600.000000 INFINITY 6 0.000000 300.000000 INFINITY

72
Part 3IE 31272 New Decisions! 100 200 300 400 500 600 700 800 800 700 600 500 400 300 200 100 Optimum Moves!

73
Part 3IE 31273 What-If ? Solve New Problem max 5 x1 + 2 x2 st 3 x1 + 2 x2 <= 2400 x2 <= 290 2 x1 <= 1200 x1 >=0 x2 >=0 end

74
Part 3IE 31274 New Solution VARIABLE VALUE REDUCED COST X1 600.000000 0.000000 X2 290.000000 0.000000 ROW SLACK OR SURPLUS DUAL PRICES 2) 20.000000 0.000000 3) 0.000000 2.000000 4) 0.000000 2.500000 5) 600.000000 0.000000 6) 290.000000 0.000000

75
Part 3IE 31275 Interior Point Methods Simplex always stays on the boundary Can take short cuts across the interior Interior point methods More effort in each move More improvement in each move Much faster for large problems

76
Part 3IE 31276 Simple Example Frannie ’ s Firewood sells up to 3 cords of firewood to two customers One will pay $90 per half-cord Other will pay $150 per full cord

77
Part 3IE 31277 Graphical Solution 1 2 3 4 5 6 43214321

78
Part 3IE 31278 Improving Directions Which direction improves the objective function the most? The gradient Direction:

79
Part 3IE 31279 Most Improving Direction?

80
Part 3IE 31280 Back to Example 1 2 3 4 5 6 43214321

81
Part 3IE 31281 Maintaining Feasibility At the initial point all directions are feasible because it is an interior point At the new point we have to make sure that a direction x at x (1) satisfies Interior point algorithms begin inside and move through the interior, reaching the boundary only at an optimal solution

82
Part 3IE 31282 Valid Interior Point Search? 2000 1500 1000 500 500 1000 1500 2000

83
Part 3IE 31283 Valid Interior Point Search? 2000 1500 1000 500 500 1000 1500 2000

84
Part 3IE 31284 Valid Interior Point Search? 2000 1500 1000 500 500 1000 1500 2000

85
Part 3IE 31285 LP Standard Form For Simplex used the form In Frannie ’ s Firewood

86
Part 3IE 31286 Benefits of Standard Form? In Simplex: Made easy to check which variables are basic, non- basic, etc. Needed to know which solutions are on boundary Here quite similar: Know which are not on boundary Check that nonnegativity constraints are strict! A feasible solution to standard LP is interior point if every component is strictly positive

87
Part 3IE 31287 Interior Points?

88
Part 3IE 31288 Projections Must satisfy main equality constraints Want direction x that satisfies this equation and is as nearly d as possible The projection of a vector d onto a system of equalities is the vector that satisfies the constraints and minimizes the total squared difference between the components

89
Part 3IE 31289 Obtaining Projection The projection of d onto A x=0 is where is the projection matrix.

90
Part 3IE 31290 Example: Frannie ’ s Firewood

91
Part 3IE 31291 Example The cost vector is c=(90 150 0)

92
Part 3IE 31292 Improvement The projection matrix is design to make an improving direction feasible with minimum changes Is it still an improving direction? Yes! The projection x=Pc of c onto Ax=b is an improving direction at every x

93
Part 3IE 31293 Sample Exercise Determine the direction d of most rapid improvement Project it onto the main equality constraints to get x Verify that the move direction x is feasible Verify that the move direction x is improving

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google