modelling of lp problems 2wo09
play

Modelling of LP-problems (2WO09) assignor: Judith Keijsper room: HG - PowerPoint PPT Presentation

Modelling of LP-problems (2WO09) assignor: Judith Keijsper room: HG 9.31 email: J.C.M.Keijsper@tue.nl course info : http://www.win.tue.nl/ jkeijspe Technische Universiteit Eindhoven meeting 1 J.Keijsper (TUE) Modelling of LP-problems


  1. Modelling of LP-problems (2WO09) assignor: Judith Keijsper room: HG 9.31 email: J.C.M.Keijsper@tue.nl course info : http://www.win.tue.nl/ ∼ jkeijspe Technische Universiteit Eindhoven meeting 1 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 1 / 70

  2. Contents Motivation MIP and LP models 1 Definition LP 2 LP modeling 3 LP solving 4 LP: Sensitivity analysis 5 Mixed Integer Programming (MIP) 6 Solving MIP’s 7 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 2 / 70

  3. Motivation MIP and LP models A discrete optimization problem can often be modeled as a (Mixed) Integer (linear) Program (MIP). If integrality restrictions are removed from a MIP, a Linear Program (LP) is obtained. LP’s can be solved fast. Solving an MIP usually involves solving (very) many LP’s. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 3 / 70

  4. Definition LP A Linear Program (LP) is the task of optimizing (i.e. minimizing or maximizing) a linear function subject to linear inequalities. Example max 2 x + 3 y s.t. 3 x + 2 y ≤ 6 x + 2 y ≤ 4 ≥ 0 x y ≥ 0 Example max x 1 3 x 2 + 5 x 3 + 7 x 4 − s.t. 9 x 1 x 3 − ≤ 3 x 1 2 x 4 3 − ≥ 2 x 2 = 5 x 3 x 4 − − x 1 2 ≥ x 3 0 ≤ J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 4 / 70

  5. Here is an example of an LP in compact notation (using indexed parameters a i , j , b i , c j , indexed variables x j and indexed constraints): Example � n max j =1 c j x j � n s.t. j =1 a i , j x j b i for all i = 1 . . . m ≤ 0 for all j = 1 . . . n x j ≥ is compact notation for max c 1 x 1 + c 2 x 2 + · · · + c n x n s.t. a 1 , 1 x 1 + a 1 , 2 x 2 + · · · + a 1 , n x n b 1 ≤ a 2 , 1 x 1 + a 2 , 2 x 2 + · · · + a 2 , n x n b 2 ≤ · · · · · · a m , 1 x 1 + a m , 2 x 2 + · · · + a m , n x n b m ≤ x 1 0 ≥ · · · · · · x n 0 ≥ J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 5 / 70

  6. LP modeling 1 Variables : decisions. 2 Objective function: quantity (linear function of the variables) to be optimized. 3 Constraints: restrictions (linear inequalities in the variables) that decisions must satisfy. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 6 / 70

  7. Example Chips production (From Aimms documentation: Optimization Modeling) How to maximize profit for the factory with the following data? time required [min/kg] plain chips Mexican chips availability [min] slicing 2 4 345 frying 4 5 480 packing 4 2 330 net profit [dollar/kg] 2 1.5 x = production of plain chips [kg] = production of mexican chips [kg] y max 2 x + 1 . 5 y 2 x + 4 y ≤ 345 4 x + 5 y ≤ 480 4 x + 2 y ≤ 330 ≥ 0 x , y J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 7 / 70

  8. LP modeling in Aimms 0. Choose sets for indexing. 1. Declare parameters and variables (give meaningful names). Both can be indexed by sets. 2. Declare a scalar (non-indexed) variable: the objective function. It has a definition (as a linear function of the variables). 3. Declare constraints. A constraint can be indexed by a set. Every constraint has a definition (as a linear inequality in the variables). Simple bounds are specified in the range of a variable. 4. Declare a Mathematical Program (MP): specify the variable that defines the objective function, the direction of optimization (min/max), the set of constraints you want to use (default: all), the set of variables (default: all), the type of program (LP). 5. This abstract model is saved separately from the case (concrete dataset) that you would like to compute an optimal solution for. Cases can be modified easily without changing the abstract model. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 8 / 70

  9. LP solving by hand: graphical method (2 variables) max 2 x + 3 y s.t. 3 x + 2 y ≤ 6 + 2 y ≤ 4 x x ≥ 0 y ≥ 0 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 9 / 70

  10. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 10 / 70

  11. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 11 / 70

  12. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 12 / 70

  13. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 13 / 70

  14. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 2x+3y=6 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 14 / 70

  15. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 15 / 70

  16. LP solving by hand: graphical method (2 variables) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 16 / 70

  17. LP solving by hand: graphical method (2 variables) Conclusion: solving the system x + 2 y = 4 3 x + 2 y = 6 for x and y yields the optimal solution x = 1 y = 1 . 5 where the objective function 2 x + 3 y attains its maximum value 6 . 5. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 17 / 70

  18. LP solving by hand: graphical method (2 variables) 1 Draw lines (half-planes) in the x , y -plane corresponding to the constraints. 2 Shade the feasible region in the x , y -plane, consisting of those points that satisfy all the constraints. 3 Draw a contour of the objective function, and indicate the direction of optimization. 4 Shift this contour as far as possible in the direction of optimization so that it still touches the feasible region. 5 Now derive from the picture which constraint-lines are intersecting in the optimal feasible point, and solve the corresponding system of equalities to obtain the co¨ oordinates of this optimal point. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 18 / 70

  19. LP solving with the simplex method (software) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 19 / 70

  20. LP solving with the simplex method (software) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 20 / 70

  21. LP solving with the simplex method (software) x=0 y 3x+2y=6 x+2y=4 y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 21 / 70

  22. Special situations: infeasible x=0 y y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 22 / 70

  23. Special situations: unbounded x=0 y y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 23 / 70

  24. Special situations: multiple optimal solutions (no Aimms warning) x=0 y y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 24 / 70

  25. Special situations: multiple optimal solutions (no Aimms warning) x=0 y y=0 x O J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 25 / 70

  26. LP: Sensitivity analysis A parametric curve depicts the sensitivity of an LP model to parametric change by simply recomputing the optimal solution (or the optimal value of the objective) for a range of values of the chosen parameter. opt. value LP 10 parameter 90 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 26 / 70

  27. Definition Shadowprice The shadowprice of a constraint in an LP model is the rate of change of the optimal value of the objective function from a one unit increase in the righthand side of the constraint (for a small enough increase). Example max 2 x + 3 y s.t. 3 x + 2 y ≤ 6 x + 2 y ≤ 4 ≥ 0 x y ≥ 0 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 27 / 70

  28. Shadowprice x=0 y 3x+2y=6 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 28 / 70

  29. Shadowprice Conclusion: solving the system x + 2 y = 4 3 x + 2 y = 6 for x and y yields the optimal solution x = 1 y = 1 . 5 where the objective function 2 x + 3 y attains its maximum value 6 . 5. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 29 / 70

  30. Shadowprice To compute the shadowprice of the constraint 3 x + 2 y ≤ 6, change max 2 x + 3 y s.t. 3 x + 2 y ≤ 6 x + 2 y ≤ 4 ≥ 0 x y ≥ 0 to max 2 x + 3 y s.t. 3 x + 2 y ≤ 7 + 2 y ≤ 4 x x ≥ 0 ≥ 0 y J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 30 / 70

  31. Shadowprice x=0 y 3x+2y=7 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 31 / 70

  32. x=0 y 3x+2y=7 x+2y=4 y=0 x O 2x+3y=3 J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 32 / 70

  33. Shadowprice Conclusion: solving the system x + 2 y = 4 3 x + 2 y = 7 for x and y yields the optimal solution x = 1 . 5 = 1 . 25 y where the objective function 2 x + 3 y attains its maximum value 6 . 75. The shadowprice of the constraint 3 x + 2 y ≤ 6 is therefore 0 . 25. J.Keijsper (TUE) Modelling of LP-problems (2WO09) meeting 1 33 / 70

Recommend


More recommend