2 A Production Problem Weekly supply of raw materials: Products: 8 Small Bricks6 Large BricksProducts:Slides 2.32–2.47 are based upon a lecture introducing the basic concepts of linear programming and the Solver to first-year MBA students at the University of Washington (as taught by one of the authors).The lecture is largely based upon a production problem using lego building blocks. This example is based upon an example introduced in an OR/MS Today article.To start the example, students are given a set of legos (8 small bricks and 6 large bricks)—one set per two students works pretty well. These are their “raw materials”. They are then to produce tables and chairs out of these legos (see the diagram on the slide). These are their “products”. Each table generates $20 profit and each chair generates $15 profit. Their goal is to use their limited resources (the bricks) to make products (tables and chairs) so as to make as much profit as possible.After some experimentation, the students discover the optimal solution. This then leads into discussing and illustrating how formulating a mathematical model (or, more specifically, a linear programming model) can enable finding this optimal solution.TableProfit = $20 / TableChairProfit = $15 / Chair
3 Linear ProgrammingLinear 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.In the class at UW, the model is not shown to the students. Instead, it is built interactively (e.g., using an overhead or the blackboard), step by step. Then, the complete model is shown.
4 Developing a Spreadsheet Model Step #1: Data CellsEnter 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).Figure 2.1 The initial spreadsheet for the Wyndor problem after transferring the data into data cells.
5 Developing a Spreadsheet Model Step #2: Changing CellsAdd 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).
6 Developing a Spreadsheet Model Step #3: Target CellDevelop 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).
7 Developing a Spreadsheet Model Step #4: ConstraintsFor 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.
8 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.
9 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.
10 Adding ConstraintsTo 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.
11 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.
12 The SolutionAfter 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.”
14 Wyndor Glass Co. Product Mix Problem Wyndor has developed the following new products:An 8-foot glass door with aluminum framing.A 4-foot by 6-foot double-hung, wood-framed window.The company has three plantsPlant 1 produces aluminum frames and hardware.Plant 2 produces wood frames.Plant 3 produces glass and assembles the windows and doors.Questions:Should they go ahead with launching these two new products?If so, what should be the product mix?
15 Algebraic Model for Wyndor Glass Co. Let D = the number of doors to produceW = the number of windows to produceMaximize P = $300D + $500Wsubject toD ≤ 4 2W ≤ 12 3D + 2W ≤ 18andD ≥ 0, W ≥ 0.
16 Developing a Spreadsheet Model Step #1: Data CellsEnter 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).
17 Developing a Spreadsheet Model Step #2: Changing CellsAdd 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).
18 Developing a Spreadsheet Model Step #3: Target CellDevelop 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).
19 Developing a Spreadsheet Model Step #4: ConstraintsFor 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.Figure 2.2 The complete spreadsheet for the Wyndor problem with an initial trial solution (both production rates equal to 1) entered into the changing cells (C12 and D12).
20 A Trial SolutionFigure 2.4 The spreadsheet for the Wyndor problem with a new trial solution entered into the changing cells Units Produced (C12:D12).The spreadsheet for the Wyndor problem with a trial solution (4 doors and 3 windows) entered into the changing cells.
21 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.Figure 2.8 The Solver dialogue box after specifying which cells in the spreadsheet are the target cell and the changing cells, plus indicating that the target cell is to be maximized.
22 Adding ConstraintsTo 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.Figure 2.9 The Add Constraint dialogue box after specifying that cells E7, E8, and E9 (HoursUsed) in the spreadsheet are required to be less than or equal to cells G7, G8, and G9 (HoursAvailable), respectively.
23 The Complete Solver Dialogue Box Figure The Solver dialogue box after specifying the entire model in terms of the spreadsheet.
24 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.Figure The Solver Options dialogue box after checking the Assume Linear Model and Assume Non-Negative options to indicate that we wish to solve a linear programming model that has nonnegativity constraints.
25 The Optimal SolutionFigure The spreadsheet obtained after solving the Wyndor problem.
26 Graphing the Product Mix Figure 2.5 Graph showing the points (D, W) = (2, 3) and (D, W) = (4, 6) for the Wyndor Glass Co. product-mix problem.
27 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.
28 Graph Showing Constraints: D ≥ 0 and W ≥ 0 Graph showing that the constraints D ≥ 0 and W ≥ 0 rule out solutions for the Wyndor Glass Co. product-mix problem that are to the left of the vertical axis or under the horizontal axis.
29 Nonnegative Solutions Permitted by D ≤ 4 Graph showing that the nonnegative solutions permitted by the constraint D ≤ 4 lie between the vertical axis and the line where D = 4.
30 Nonnegative Solutions Permitted by 2W ≤ 12 Graph showing that the nonnegative solutions permitted by the constraint 2W ≤ 12 must lie between the horizontal axis and the constraint boundary line whose equation is 2W = 12.
31 Boundary Line for Constraint 3D + 2W ≤ 18 Graph showing that the boundary line for the constraint 3D + 2W ≤ 18 intercepts the horizontal axis at D = 6 and intercepts the vertical axis at W = 9.
32 Changing Right-Hand Side Creates Parallel Constraint Boundary Lines Graph showing that changing only the right-hand side of a constraint (such as 3D + 2W ≤ 18) creates parallel constraint boundary lines.
33 Nonnegative Solutions Permitted by 3D + 2W ≤ 18 Graph showing that nonnegative solutions permitted by the constraint 3D + 2W ≤ 18 lie within the triangle formed by the two axes and this constraint’s boundary line, 3D + 2W = 18.
34 Graph of Feasible Region Figure 2.6 Graph showing how the feasible region is formed by the constraint boundary lines, where the arrows indicate which side of each line is permitted by the corresponding constraint.
35 Objective Function (P = 1,500) Graph showing the line containing all the points (D, W) that give a value P = 1,500 for the objective function.
36 Finding the Optimal Solution Figure 2.7 Graph showing three objective function lines for the Wyndor Glass Co. product-mix problem, where the top one passes through the optimal solution.
37 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 mediaThe 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?
38 Profit & Gambit Co. Spreadsheet Model Figure The spreadsheet model for the Profit & Gambit problem. The changing cells (Advertising Units in C14:D14) show the optimal solution obtained by the Solver.
39 Algebraic Model for Profit & Gambit Let TV = the number of units of advertising on televisionPM = the number of units of advertising in the print mediaMinimize Cost = TV + 2PM (in millions of dollars)subject toStain remover increased sales: PM ≥ 3 Liquid detergent increased sales: 3TV + 2PM ≥ 18Powder detergent increased sales: –TV + 4PM ≥ 4andTV ≥ 0, PM ≥ 0.
40 Applying the Graphical Method Graph showing the feasible region for the Profit & Gambit Co. advertising-mix problem, where the ≥ functional constraints have moved this region up and away from the origin.
41 The Optimal SolutionGraph showing two objective function lines for the Profit & Gambit Co. advertising-mix problem, where the bottom one passes through the optimal solution.
42 Components of a Linear Program Data CellsChanging Cells (“Decision Variables”)Target Cell (“Objective Function”)ConstraintsData CellsParameters of the problem (e.g. profit/unit)Changing Cells (“Decision Variables”)The decisions to be made (level of an activity)Ex: $ to spend, # to produce, # of peopleA separate cell should be assigned for each number neededTarget Cell (“Objective Function”)Usually maximize profit or minimize costMust be an equation in a single cell(If there are multiple objectives, can use goal programming)ConstraintsLimited resources (Ex: $, raw materials, time, people)Requirements to be met (Ex: staffing needs)Lay out in 3 consecutive cells: LHS (≤, =, ≥) RHSLHS is typically an equation (e.g., resource used)RHS is typically a number (e.g., amount of resource)
43 Four Assumptions of Linear Programming LinearityDivisibilityCertaintyNonnegativityLinearityAll equations must be linear (e.g., 1x + 2y + 3z, or SUM, or SUMPRODUCT)Implications: no economies of scale, each unit contributes equally to profitIf not: nonlinear programmingDivisibilityFractions must be okay (optimal solution may be fractional)Okay if production rate, or if rounding reasonableIf not: integer programmingCertaintyAll parameters known and certainSolution is only optimal with respect to model givenIf not: use expected value, sensitivity analysis, decision analysis, simulationNonnegativityAll variables nonnegative
44 Why Use Linear Programming? Linear programs are easy (efficient) to solveThe best (optimal) solution is guaranteed to be found (if it exists)Useful sensitivity analysis information is generatedMany problems are essentially linearWith all of the restrictions, why bother with LP?Linear programs are easy (efficient) to solveSimplex method developed by George Dantzig (1947)Problems with thousands of variables or constraints routinely solvedNonlinear and integer programs much more limitedThe best (optimal) solution is guaranteed to be found (if it exists)NLP might get stuck at a local optima (at this point, an example can be shown on an overhead or the blackboard)Useful sensitivity analysis information is generatedWhat if we could get more large bricks? How much would that be worth?What if the profit/table is lower/higher?This information is only available with linear programmingMany problems are essentially linearCan approximate and iterate if necessary
45 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.Examples #1-#3 were examples with one unique optimal solution.Example #4 will look a case where an infinite number of solutions exist.Example #5 will look at a case where no feasible solutions exist.Example #6 will look at a case with an unbounded objective function.The last two bullet points are the key to the simplex method. Because of these two points, the simplex method need only consider the corner points of the feasible region.
46 (Multiple Optimal Solutions) Maximize Z = 6x1 + 4x2 subject to x1 ≤ 42x2 ≤ 123x1 + 2x2 ≤ 18 and x1 ≥ 0, x2 ≥ 0.An example with multiple optimal solutions (2,4), (4,3) and all the points on the line in between.Managerial implications: look at alternative criteria and pick the best solution.
47 (No Feasible Solution) Maximize Z = 3x1 + 5x2 subject to x1 ≥ 5x2 ≥ 43x1 + 2x2 ≤ 18 and x1 ≥ 0, x2 ≥ 0.An example with no feasible solution.Managerial implications: all constraints cannot be met. Which can be relaxed?
48 (Unbounded Solution) Maximize Z = 5x1 + 12x2 subject to x1 ≤ 5 2x1 –x2 ≤ 2 and x1 ≥ 0, x2 ≥ 0.An example with an unbounded solution. Infinite profit is possible by producing an infinite amount of product 2.Managerial implication: either you’ve stumbled upon a great business that can make infinite profit or, more likely, you’ve forgotten a constraint.