Linear Programming IS 01
e-optimization.com A Resource Page on Optimization
Distribution System at Proctor and Gamble Proctor and Gamble needed to consolidate and re-design their North American distribution system in the early 1990 s. 50 product categories 0 plants 15 distribution centers 1000 customer zones Solved many transportation problems (one for each product category). Goal: find best distribution plan, which plants to keep open, etc. Closed many plants and distribution centers, and optimized their product sourcing and distribution location. Implemented in 199. Saved $200 million per year. For more details, see 1997 Jan-Feb Interfaces article, Blending OR/MS, Judgement, and GIS: Restructuring P&G s Supply Chain.
History of the Diet Problem Stigler (1945) The Cost of Subsistence heuristic solution. Cost = $39.93. Dantzig invents the simplex method (1947) Stigler s problem solved in 120 man days. Cost = $39.9. Dantzig goes on a diet (early 1950 s), applies diet model: 1,500 calories objective: maximize (weight minus water content) 500 food types Initial solutions had problems 500 gallons of vinegar 200 bouillon cubes For more details, see July-Aug 1990 Interfaces article The Diet Problem.
Workforce Scheduling at United Airlines United employs 5,000 reservation and customer service agents. Some part-time (2- hour shifts), some full-time (-10 hour shifts). Workload varies greatly over day. Modeled problem as LP: Decision variables: how many employees of each shift length should begin at each potential start time (half-hour intervals). Constraints: minimum required employees for each half-hour. Objective: minimize cost. Saved United about $ million annually, improved customer service, still in use today. For more details, see Jan-Feb 19 Interfaces article United Airlines Station Manpower Planning System.
A Product Mix Problem The company has developed the following new products: An -foot glass door with aluminum framing. A 4-foot by -foot double-hung, wood-framed window. The company has three plants Plant 1 produces aluminum frames and hardware. Plant 2 produces wood frames. Plant 3 produces glass and assembles the windows and doors. Questions: 1. Should they go ahead with launching these two new products? 2. If so, what should be the product mix?
Developing a Spreadsheet Model Step #1: Data Cells Enter all of the data for the problem on the spreadsheet. Make consistent use of rows and columns. It is a good idea to color code these data cells (e.g., light blue). Doors Windows Unit Profit $300 $500 Available Hou Used Per Unit Produced s Plant 1 1 0 4 Plant 2 0 2 12 Plant 3 3 2 1
Step #2: Changing Cells Add a cell in the spreadsheet for every decision that needs to be made. If you don t have any particular initial values, just enter 0 in each. It is a good idea to color code these changing cells (e.g., yellow with border). Doors Windows Unit Profit $300 $500 Used Per Unit Produced Available Plant 1 1 0 4 Plant 2 0 2 12 Plant 3 3 2 1 Doors Windows Units Produced 0 0
Step #3: Target Cell Develop an equation that defines the objective of the model. Typically this equation involves the data cells and the changing cells in order to determine a quantity of interest (e.g., total profit or total cost). It is a good idea to color code this cell (e.g., orange with heavy border). Doors Windows Unit Profit $300 $500 Used Per Unit Produced Available Plant 1 1 0 4 Plant 2 0 2 12 Plant 3 3 2 1 Doors Windows Total Profit Units Produced 1 1 $00 11 12 G Total Profit =SUMPRODUCT(UnitProfit,UnitsProduced)
Step #4: Constraints For any resource that is restricted, calculate the amount of that resource used in a cell on the spreadsheet (an output cell). Define the constraint in three consecutive cells. For example, if Quantity A Quantity B, put these three items (Quantity A,, Quantity B) in consecutive cells. Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 1 <= 4 Plant 2 0 2 2 <= 12 Plant 3 3 2 5 <= 1 Doors Windows Total Profit Units Produced 1 1 $00 5 7 9 E Used =SUMPRODUCT(C7:D7,UnitsProduced) =SUMPRODUCT(C:D,UnitsProduced) =SUMPRODUCT(C9:D9,UnitsProduced)
A Trial Solution Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 4 <= 4 Plant 2 0 2 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 4 3 $2,700 The spreadsheet for the problem with a trial solution (4 doors and 3 windows) entered into the changing cells.
Algebraic Model for the Problem Let D = the number of doors to produce W = the number of windows to produce Maximize P = $300D + $500W subject to D 4 2W 12 3D + 2W 1 and D 0, W 0.
Graphing the Product Mix W Production rate (units per week) for windows 7 5 4 3 2 A product mix of D = 4 and W = (4, ) A product mix of D = 2 and W = 3 (2, 3) 1 Origin -2-1 0 1 2 3 4 5 7 Production rate (units per week) for doors -1 D -2
Graph Showing Constraints: D 0 and W 0 W 4 2 Production rate for windows 0 2 4 Production rate for doors D
Nonnegative Solutions Permitted by D 4 W D = 4 4 2 Production rate for windows 0 D 2 4 Production rate for doors
Nonnegative Solutions Permitted by Production rate for windows W 2W 12 2 W = 12 4 2 0 2 4 Production rate for doors D
Boundary Line for Constraint 3D + Production rate for windows W 10 2W 1 (0, 9) (1, 7 1_ ) 2 (2, ) 3 D + 2 W = 1 4 (3, 4 1_ ) 2 (4, 3) 2 (5, 1 1_ ) 2 0 2 4 Production rate for doors (, 0) D
Changing Right-Hand Side Creates Parallel Constraint Boundary Lines Production rate for windows W 12 10 3D + 2W = 24 4 3D + 2W = 1 2 3D + 2W = 12 0 2 4 10 Production rate for doors D
Nonnegative Solutions Permitted by 3D + 2W 1 Production rate for windows W 10 4 3D + 2W = 1 2 0 2 4 Production rate for doors D
Graph of Feasible Region Production rate for windows W 10 3 D + 2 W = 1 D = 4 2 W =12 4 Feasible 2 region 0 2 4 Production rate for doors D
Objective Function (P = 1,500) Production rate for windows W P = 1500 = 300D + 500W 4 Feasible region 2 0 2 4 Production rate for doors D
Finding the Optimal Solution Production rate W for windows P = 300 = 300D + 500W P = 3000 = 300D + 500W Optimal solution (2, ) P = 1500 = 300D + 500W 4 Feasible region 2 0 2 4 Production rate for doors 10 D
Summary of the Graphical Method Draw the constraint boundary line for each constraint. Use the origin (or any point not on the line) to determine which side of the line is permitted by the constraint. Find the feasible region by determining where all constraints are satisfied simultaneously. Determine the slope of one objective function line. All other objective function lines will have the same slope. Move a straight edge with this slope through the feasible region in the direction of improving values of the objective function. Stop at the last instant that the straight edge still passes through a point in the feasible region. This line given by the straight edge is the optimal objective function line. A feasible point on the optimal objective function line is an optimal solution.
The Graphical Method for Solving LP s Formulate the problem as a linear program Plot the constraints Identify the feasible region Draw an imaginary line parallel to the objective function (Z = a) Find the optimal solution
Why Use Linear Programming? Linear programs are easy (efficient) to solve The best (optimal) solution is guaranteed to be found (if it exists) Useful sensitivity analysis information is generated Many problems are essentially linear
Properties of Linear Programming Solutions An optimal solution must lie on the boundary of the feasible region. There are exactly four possible outcomes of linear programming: A unique optimal solution is found. An infinite number of optimal solutions exist. No feasible solutions exist. The objective function is unbounded (there is no optimal solution). If an LP model has one optimal solution, it must be at a corner point. If an LP model has many optimal solutions, at least two of these optimal solutions are at corner points.
The Simplex Method Algorithm 1. Start at a feasible corner point (often the origin). 2. Check if adjacent corner points improve the objective function: a) If so, move to adjacent corner and repeat step 2. b) If not, current corner point is optimal. Stop. x 2 10 9 7 5 4 3 2 1 1 2 3 4 5 7 9 10 x 1
Identifying the Target Cell and Changing Cells Choose the Solver from the Tools menu. Select the cell you wish to optimize in the Set Target Cell window. Choose Max or Min depending on whether you want to maximize or minimize the target cell. Enter all the changing cells in the By Changing Cells window. Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 1 <= 4 Plant 2 0 2 2 <= 12 Plant 3 3 2 5 <= 1 Doors Windows Total Profit Units Produced 1 1 $00
Adding Constraints To begin entering constraints, click the Add button to the right of the constraints window. Fill in the entries in the resulting Add Constraint dialogue box. Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 1 <= 4 Plant 2 0 2 2 <= 12 Plant 3 3 2 5 <= 1 Doors Windows Total Profit Units Produced 1 1 $00
The Complete Solver Dialogue Box
Some Important Options Click on the Options button, and click in both the Assume Linear Model and the Assume Non-Negative box. Assume Linear Model tells the Solver that this is a linear programming model. Assume Non-Negative adds nonnegativity constraints to all the changing cells.
The Solver Results Dialogue Box
The Optimal Solution 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 2 <= 4 Plant 2 0 2 12 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 2 $3,00
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $200 $500 Used Per Unit Produced Used Available Plant 1 1 0 2 <= 4 Plant 2 0 2 12 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 2 $3,400 The profit per door has been revised from $300 to $200. No change occurs in the optimal solution.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $500 $500 Used Per Unit Produced Used Available Plant 1 1 0 2 <= 4 Plant 2 0 2 12 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 2 $4,000 The profit per door has been revised from $300 to $500. No change occurs in the optimal solution.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $1,000 $500 Used Per Unit Produced Used Available Plant 1 1 0 4 <= 4 Plant 2 0 2 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 4 3 $5,500 The profit per door has been revised from $300 to $1,000. The optimal solution changes.
Using the Sensitivity Report to Find the Allowable Range Adjustable Cells Final Reduced Objective Allowable Allowable Cell Name Value Cost Coefficient Increase Decrease $C$12 Units Produced Doors 2 0 300 450 300 $D$12 Units Produced Windows 0 500 1E+30 300
Graphical Insight into the Allowable Range W Production rate for windows (2, ) is optimal for 0 < P D < 750 Line B P D = 0 (Profit = 0 D + 500 W) 4 2 Feasible region Line C P D = 300 (Profit = 300 D + 500 W) P D = 750 (Profit = 750 D + 500 W) Line A 0 2 4 Production rate for doors D The two dashed lines that pass through the solid constraint boundary lines are the objective function lines when P D (the unit profit for doors) is at an endpoint of its allowable range, 0 P D 750.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $450 $400 Used Per Unit Produced Used Available Plant 1 1 0 2 <= 4 Plant 2 0 2 12 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 2 $3,300 The profit per door has been revised from $300 to $450. The profit per window has been revised from $500 to $400. No change occurs in the optimal solution.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $00 $300 Used Per Unit Produced Used Available Plant 1 1 0 4 <= 4 Plant 2 0 2 <= 12 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 4 3 $3,300 The profit per door has been revised from $300 to $00. The profit per window has been revised from $500 to $300. The optimal solution changes.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 1.7 <= 4 Plant 2 0 2 13 <= 13 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 1.7.5 $3,750 The hours available in plant 2 have been increased from 12 to 13. The total profit increases by $150 per week.
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 0 <= 4 Plant 2 0 2 1 <= 1 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 0 9 $4,500 The hours available in plant 2 have been further increased from 13 to 1. The total profit increases by $750 per week ($150 per hour added in plant 2).
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 0 <= 4 Plant 2 0 2 1 <= 20 Plant 3 3 2 1 <= 1 Doors Windows Total Profit Units Produced 0 9 $4,500 The hours available in plant 2 have been further increased from 1 to 20. The total profit does not increase any further.
Using the Sensitivity Report Adjustable Cells Final Reduced Objective Allowable Allowable Cell Name Value Cost Coefficient Increase Decrease $C$12 Units Produced Doors 2 0 300 450 300 $D$12 Units Produced Windows 0 500 1E+30 300 Constraints Final Shadow Constraint Allowable Allowable Cell Name Value Price R.H. Side Increase Decrease $E$7 Plant 1 Used 2 0 4 1E+30 2 $E$ Plant 2 Used 12 150 12 $E$9 Plant 3 Used 1 100 1
Graphical Interpretation of the Allowable Range Production rate for windows W 10 (0, 9) 2 W = 1 Profit = 300 (0) + 500 (9) = $4,500 Line B (2, ) 2 W = 12 Profit = 300 (2) + 500 () = $3,00 4 2 Feasible region for original problem (4, 3) 2 W = Profit = 300 (4) + 500 (3) = $2,700 Line C (3 D + 2 W = 1) Line A (D = 4) 0 2 4 Production rate for doors D
Using the Spreadsheet to do Sensitivity Analysis 3 4 5 7 9 10 11 12 B C D E F G Doors Windows Unit Profit $300 $500 Used Per Unit Produced Used Available Plant 1 1 0 1.333 <= 4 Plant 2 0 2 13 <= 13 Plant 3 3 2 17 <= 17 Doors Windows Total Profit Units Produced 1.333.5 $3,50 One available hour in plant 3 has been shifted to plant 2. The total profit increases by $50 per week.