Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Three Classic Applications of LP • Product Mix at Ponderosa Industrial – Considered limited resources, and determined optimal mix of plywood products. – Increased overall profitability of company by 20%. • Personnel Scheduling at United Airlines – Designed work schedules for all employees at a location to meet service requirements most efficiently. – Saved $6 million annually. • Planning Supply, Distribution, and Marketing at Citgo Petroleum Corporation – The SDM system uses LP to coordinate the supply, distribution, and marketing of each of Citgo’s major products throughout the United States. – The resulting reduction in inventory added $14 million annually to Citgo’s profits. McGraw-Hill/Irwin 2.1 © The McGraw-Hill Companies, Inc., 2003 Wyndor Glass Co. Product Mix Problem • Wyndor has developed the following new products: An 8-foot glass door with aluminum framing (unit profit = $300); a 4-foot by 6-foot doublehung, wood-framed window (unit profit = $500). • The company has three plants: Plant 1 (capacity: 4 hrs available) produces aluminum frames and hardware; Plant 2 (capacity: 12 hrs available) produces wood frames; Plant 3 (18 hrs available) produces glass and assembles the windows and doors. • The 8-foot glass door requires some of the production capacity in Plants 1 and 3, but not Plant 2; The 4-foot wood-framed window needs only Plants 2 and 3. Technological coefficients (hrs/unit): Plant 1: 1 hr/doors, 0 hrs/windows; Plant 2: 0 hrs/doors, 2 hrs/windows; Plant 3: 3 hrs/doors, 2 hrs/windows. • Questions: What should be the product mix? McGraw-Hill/Irwin 2.2 © The McGraw-Hill Companies, Inc., 2003 Algebraic Model for Wyndor Glass Co. 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 ≤ 18 and D ≥ 0, W ≥ 0. McGraw-Hill/Irwin 2.3 © The McGraw-Hill Companies, Inc., 2003 Graph of Feasible Region Production rate for windows W 10 3 D + 2 W = 18 8 D= 4 6 2 W =12 4 Feasible 2 0 McGraw-Hill/Irwin region 2 4 Production rate for doors 2.4 6 8 D © The McGraw-Hill Companies, Inc., 2003 Finding the Optimal Solution Production rate W for windows 8 P = 3600 = 300D + 500W P = 3000 = 300D + 500W Optimal solution (2, 6) 6 Feasible 4 P = 1500 = 300D + 500W region 2 0 2 4 Production rate for doors McGraw-Hill/Irwin 2.5 6 8 10 D © The McGraw-Hill Companies, Inc., 2003 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. McGraw-Hill/Irwin 2.6 © The McGraw-Hill Companies, Inc., 2003 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. Unit Profit Plant 1 Plant 2 Plant 3 Doors $300 Hours Used Per Unit Produced 1 0 0 2 3 2 Doors McGraw-Hill/Irwin Windows $500 2.7 Windows Hours Used 1 2 5 <= <= <= Hours Available 4 12 18 Total Profit © The McGraw-Hill Companies, Inc., 2003 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. Unit Profit Plant 1 Plant 2 Plant 3 Units Produced McGraw-Hill/Irwin Doors $300 Windows $500 Hours Used Per Unit Produced 1 0 0 2 3 2 Doors 1 Windows 1 2.8 Hours Used 1 2 5 <= <= <= Hours Available 4 12 18 Total Profit $800 © The McGraw-Hill Companies, Inc., 2003 The Complete Solver Dialogue Box McGraw-Hill/Irwin 2.9 © The McGraw-Hill Companies, Inc., 2003 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 non-negativity constraints to all the changing cells. McGraw-Hill/Irwin 2.10 © The McGraw-Hill Companies, Inc., 2003 The Solver Results Dialogue Box McGraw-Hill/Irwin 2.11 © The McGraw-Hill Companies, Inc., 2003 The Optimal Solution Unit Profit Plant 1 Plant 2 Plant 3 Units Produced McGraw-Hill/Irwin Doors $300 Windows $500 Hours Used Per Unit Produced 1 0 0 2 3 2 Doors 2 Windows 6 2.12 Hours Used 2 12 18 <= <= <= Hours Available 4 12 18 Total Profit $3,600 © The McGraw-Hill Companies, Inc., 2003 The Profit & Gambit Co. • Management has decided to undertake a major advertising campaign that will focus on the following three key products: – A spray prewash stain remover. – A liquid laundry detergent. – A powder laundry detergent. • The campaign will use both television and print media • The general goal is to increase sales of these products. • Management has set the following goals for the campaign: – Sales of the stain remover should increase by at least 3%. – Sales of the liquid detergent should increase by at least 18%. – Sales of the powder detergent should increase by at least 4%. Question: how much should they advertise in each medium to meet the sales goals at a minimum total cost? McGraw-Hill/Irwin 2.13 © The McGraw-Hill Companies, Inc., 2003 Profit & Gambit Co. Spreadsheet Model B 3 4 5 6 7 8 9 10 11 12 13 14 Unit Cost ($millions) Stain Remover Liquid Detergent Powder Detergent Advertising Units McGraw-Hill/Irwin C D Television 1 Print Media 2 E Increase in Sales per Unit of Advertising 0% 1% 3% 2% -1% 4% Television 4 Print Media 3 2.14 Increased Sales 3% 18% 8% F G >= >= >= Minimum Increase 3% 18% 4% Total Cost ($millions) 10 © The McGraw-Hill Companies, Inc., 2003 Algebraic Model for Profit & Gambit Let TV = the number of units of advertising on television PM = the number of units of advertising in the print media Minimize Cost = TV + 2PM (in millions of dollars) subject to Stain remover increased sales: PM ≥ 3 Liquid detergent increased sales: 3TV + 2PM ≥ 18 Powder detergent increased sales: –TV + 4PM ≥ 4 and TV ≥ 0, PM ≥ 0. McGraw-Hill/Irwin 2.15 © The McGraw-Hill Companies, Inc., 2003 Applying the Graphical Method Amount of print media advertising PM Feasible 10 region 8 6 4 PM = 3 2 -TV + 4 PM = 4 -4 McGraw-Hill/Irwin -2 0 2 3 TV + 2 PM = 18 4 6 Amount of TV advertising 2.16 8 10 TV © The McGraw-Hill Companies, Inc., 2003 The Optimal Solution PM 10 Feasible region Cost = 15 = TV + 2 PM Cost = 10 = TV + 2 PM 4 (4,3) optimal solution 0 5 10 15 TV Amount of TV advertising McGraw-Hill/Irwin 2.17 © The McGraw-Hill Companies, Inc., 2003 A Production Problem Weekly supply of raw materials: 8 Small Bricks 6 Large Bricks Products: Table Profit = $20 / Table McGraw-Hill/Irwin Chair Profit = $15 / Chair 2.18 © The McGraw-Hill Companies, Inc., 2003 Linear Programming • Linear programming uses a mathematical model to find the best allocation of scarce resources to various activities so as to maximize profit or minimize cost. Let T = Number of tables to produce C = Number of chairs to produce Maximize Profit = ($20)T + ($15)C subject to 2T + C ≤ 6 large bricks 2T + 2C ≤ 8 small bricks and T ≥ 0, C ≥ 0. McGraw-Hill/Irwin 2.19 © The McGraw-Hill Companies, Inc., 2003 Graphical Representation McGraw-Hill/Irwin 2.20 © The McGraw-Hill Companies, Inc., 2003 Components of a Linear Program • Data Cells • Changing Cells (“Decision Variables”) • Target Cell (“Objective Function”) • Constraints McGraw-Hill/Irwin 2.21 © The McGraw-Hill Companies, Inc., 2003 When is a Spreadsheet Model Linear? • All equations (output cells) must be of the form = ax + by + cz + … where a, b, c are constants (data cells) and x, y, z are changing cells. McGraw-Hill/Irwin 2.22 © The McGraw-Hill Companies, Inc., 2003 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 McGraw-Hill/Irwin 2.23 © The McGraw-Hill Companies, Inc., 2003 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). B 3 4 5 6 7 8 McGraw-Hill/Irwin Profit Large Bricks Small Bricks C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 2.24 E F G Available 6 8 © The McGraw-Hill Companies, Inc., 2003 Developing a Spreadsheet Model • 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). B 3 4 5 6 7 8 9 10 11 Profit Large Bricks Small Bricks Production Quantity: McGraw-Hill/Irwin C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 Tables 0 2.25 E F G Available 6 8 Chairs 0 © The McGraw-Hill Companies, Inc., 2003 Developing a Spreadsheet Model • 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). B 3 4 5 6 7 8 9 10 11 Profit Large Bricks Small Bricks Production Quantity: C Tables $20.00 D Chairs $15.00 E F Bill of Materials 2 1 2 2 G Available 6 8 Tables Chairs Total Profit 1 0 $20.00 10 G Total Profit 11 =SUMPRODUCT(C4:D4,C11:D11) McGraw-Hill/Irwin 2.26 © The McGraw-Hill Companies, Inc., 2003 Developing a Spreadsheet Model • 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. – Note the use of relative and absolute addressing to make it easy to copy formulas in column E. B 3 4 5 6 7 8 9 10 11 Profit Large Bricks Small Bricks Production Quantity: C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 Total Used 3 4 F G <= <= Available 6 8 Tables Chairs Total Profit 1 1 $35.00 6 7 8 McGraw-Hill/Irwin E 2.27 E Total Used =SUMPRODUCT(C7:D7,$C$11:$D$11) =SUMPRODUCT(C8:D8,$C$11:$D$11) © The McGraw-Hill Companies, Inc., 2003 Defining the Target Cell • • • 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. B 3 4 5 6 7 8 9 10 11 McGraw-Hill/Irwin C Tables $20.00 Profit Large Bricks Small Bricks Production Quantity: 2.28 D Chairs $15.00 Bill of Materials 2 1 2 2 E F G Total Used 3 4 <= <= Available 6 8 Tables Chairs Total Profit 1 1 $35.00 © The McGraw-Hill Companies, Inc., 2003 Identifying the Changing Cells • Enter all the changing cells in the “By Changing Cells” window. – You may either drag the cursor across the cells or type the addresses. – If there are multiple sets of changing cells, separate them by typing a comma. B 3 4 5 6 7 8 9 10 11 Profit Large Bricks Small Bricks Production Quantity: McGraw-Hill/Irwin C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 E F G Total Used 3 4 <= <= Available 6 8 Tables Chairs Total Profit 1 1 $35.00 2.29 © The McGraw-Hill Companies, Inc., 2003 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. B 3 4 5 6 7 8 9 10 11 McGraw-Hill/Irwin Profit Large Bricks Small Bricks Production Quantity: C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 E F G Total Used 3 4 <= <= Available 6 8 Tables Chairs Total Profit 1 1 $35.00 2.30 © The McGraw-Hill Companies, Inc., 2003 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. McGraw-Hill/Irwin 2.31 © The McGraw-Hill Companies, Inc., 2003 The Solution • After clicking “Solve”, you will receive one of four messages: – “Solver found a solution. All constraints and optimality conditions are satisfied.” – “Set cell values did not converge.” – “Solver could not find a feasible solution.” – “Conditions for Assume Linear Model are not satisfied.” B 3 4 5 6 7 8 9 10 11 Profit Large Bricks Small Bricks Production Quantity: McGraw-Hill/Irwin C Tables $20.00 D Chairs $15.00 Bill of Materials 2 1 2 2 E Total Used 6 8 F G <= <= Available 6 8 Tables Chairs Total Profit 2 2 $70.00 2.32 © The McGraw-Hill Companies, Inc., 2003 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. McGraw-Hill/Irwin 2.33 © The McGraw-Hill Companies, Inc., 2003 Example: (Multiple Optimal Solutions) Minimize Z = 6x1 + 4x2 subject to x1 ≤ 4 2x2 ≤ 12 3x1 + 2x2 ≤ 18 and x1 ≥ 0, x2 ≥ 0. x2 10 9 8 7 6 5 4 3 2 1 1 McGraw-Hill/Irwin 2.34 2 3 4 5 6 7 8 9 10 x1 © The McGraw-Hill Companies, Inc., 2003 Example: (No Feasible Solution) Maximize Z = 3x1 + 5x2 subject to x1 ≥ 5 x2 ≥ 4 3x1 + 2x2 ≤ 18 and x1 ≥ 0, x2 ≥ 0. x2 10 9 8 7 6 5 4 3 2 1 1 McGraw-Hill/Irwin 2.35 2 3 4 5 6 7 8 9 10 x1 © The McGraw-Hill Companies, Inc., 2003 Example: (Unbounded Solution) Maximize Z = 5x1 + 12x2 subject to x1 ≤ 5 2x1 –x2 ≤ 2 and x1 ≥ 0, x2 ≥ 0. x2 10 9 8 7 6 5 4 3 2 1 1 McGraw-Hill/Irwin 2.36 2 3 4 5 6 7 8 9 10 x1 © The McGraw-Hill Companies, Inc., 2003