Presentation on theme: "Modeling with Linear Programming and Graphical Solution"— Presentation transcript:
1 Modeling with Linear Programming and Graphical Solution
2 Steps in formulating Linear Programming (LP) Models Understand the problem.Identify the decision variablesState the objective function as a linear combination of the decision variables.State the constraints as linear combinations of the decision variables.Identify any upper or lower bounds on the decision variables.
3 LP Model Formulation: A Maximization Example 1 – Product mix problem - Beaver Creek Pottery Company (1 of 4)Beaver Creek Pottery Company employs skilled artisans to produce clay bowls and mugs. The two resources used by the company are special pottery clay and skilled labor. Given these limited resources, the company desires to know how many bowls and mugs to produce each day in order to maximize profit.This is generally referred to as a product mix problem.
4 Resource Requirements LP Model FormulationA Maximization Example 1 (2 of 4)Resource RequirementsProductLabor(Hr./Unit)Clay(Lb./Unit)Profit($/Unit)Bowl1440Mug2350Product mix problem - Beaver Creek Pottery CompanyHow many bowls and mugs should be produced to maximize profits given labor and materials constraints?Resource Availability: hrs of labor per day (labor constraint)120 lbs of clay (material constraint)
5 A Maximization Example 1 (3 of 4) LP Model FormulationA Maximization Example 1 (3 of 4)Resource hrs of labor per dayAvailability: 120 lbs of clayDecision x1 = number of bowls to produce per dayVariables: x2 = number of mugs to produce per dayObjective Maximize Z = $40x1 + $50x2Function: Where Z = profit per dayResource 1x1 + 2x2 40 hours of laborConstraints: 4x1 + 3x2 120 pounds of clayNon-Negativity x1 0; x2 0Constraints:
6 A Maximization Example 1 (4 of 4) LP Model FormulationA Maximization Example 1 (4 of 4)Complete Linear Programming Model:Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0
7 Feasible SolutionsA feasible solution does not violate any of the constraints:Example: x1 = 5 bowlsx2 = 10 mugsZ = $40x1 + $50x2 = $700Labor constraint check: 1(5) + 2(10) = 25 ≤ 40 hoursClay constraint check: 4(5) + 3(10) = 70 ≤ 120 pounds
8 Infeasible SolutionsAn infeasible solution violates at least one of the constraints:Example: x1 = 10 bowlsx2 = 20 mugsZ = $40x1 + $50x2 = $1400Labor constraint check: 1(10) + 2(20) = 50 > 40 hours
9 Example 2 of LP Problem - Blue Ridge Hot Tubs Blue Ridge Hot Tubs produces two types of hot tubs: Aqua-Spas & Hydro-Luxes.Aqua-Spa Hydro-LuxPumps 1 1Labor 9 hours 6 hoursTubing 12 feet 16 feetUnit Profit $350 $300There are 200 pumps, 1566 hours of labor, and 2880 feet of tubing available.
10 Formulating LP Model: Blue Ridge Hot Tubs 1. Understand the problem2. Identify the decision variablesX1=number of Aqua-Spas to produceX2=number of Hydro-Luxes to produce3. State the objective function as a linear combination of the decision variables.MAX: 350X X24. State the constraints as linear combinations of the decision variables1X1 + 1X2 <= 200 } pumps9X1 + 6X2 <= 1566 } labor12X1 + 16X2 <= 2880 } tubing5. Identify any upper or lower bounds on the decision variables.X1 >= 0 , X2 >= 0
11 Summary of the LP Model for Blue Ridge Hot Tubs MAX Z = 350X X2S.T.1X X <= 2009X X2 <= 156612X1 + 16X2 <= 2880X1 >= 0X2 >= 0
12 Example 3:Wershon Suit Company Jackets Slacks AvailableProfit, $/unitMaterial,Square yardsPerson HoursHow many jackets and slacks should be produced ?25
13 Example 3:Wershon Suit Company Type of Objective FunctionMaximize ProfitVariable DefinitionJ = number of jackets produced / weekS = number of slacks produced / week25
14 Example 3:Wershon Suit Company Max Z = $34 J + $40 SSuch that2 J + 5 S 50 (Material)4 J + 2 S 36 (sewing)J , S (Nonnegativity)25
15 Example 4: Product Mix Problem TJ’s, Inc., makes 2 nut mixes for sale to grocery chains in the states. The 2 mixes, referred to as the Regular Mix and the Deluxe Mix, are made by mixing different percentages of 3 types of nuts. In preparation for the fall season, TJ’s has just purchased 6000 pounds of almonds, 6000 pounds of pecans, and 7500 pounds of walnuts. The Regular Mix consists of 30% almonds, 20% pecans, and 50% walnuts. The Deluxe Mix consists of 35% of almonds, 30% pecans, and 35% walnuts. TJ’s accountant has analyzed the cost of packaging materials, sales price per pound, and other factors and has determined that the profit contribution per pound is $1.65 for the Regular Mix and $2.00 for the Deluxe Mix. TJ’s is committed to using the available nuts to maximize total profit contribution over the fall season.20
16 Example 4: Product Mix Problem Let R = amount of regular mix (pounds)D = amount of deluxe mix (pounds)Max z = 1.65R D (Total profit)s.t. 0.3R D 6000 (Availability with0.2R + 0.3D ingredient0.5R D specifications)R, D (Nonnegativity)21
17 Example 5: Transportation Problem A product is to be shipped in the amounts al, a2, ..., am from m shipping origins and received in amounts bl, b2, ..., bn at each of n shipping destinations.The cost of shipping a unit from the ith origin to the jth destination is known for all combinations of origins and destinations.The problem is to determine the amount to be shipped from each origin to each destination such that the total cost of transportation is a minimum.
18 Transportation Problem – Example 5 The Zephyr Television Company ships televisions from three warehouses to three retail stores on a monthly basis. Each warehouse has a fixed supply per month, and each store has a fixed demand per month. The manufacturer wants to know the number of television sets to ship from each warehouse to each store in order to minimize the total cost of transportation.
19 Demand & SupplyEach warehouse has the following supply of televisions available for shipment each month:Warehouse Supply (sets)1. Cincinnati2. Atlanta3. Pittsburgh700Each retail store has the following monthly demand for television sets:Store Demand (sets)A. New YorkB. DallasC. Detroit600
20 Cost MatrixCosts of transporting television sets from the warehouses to the retail stores vary as a result of differences in modes of transportation and distances. The shipping cost per television set for each route is as follows:To StoreFromWarehouse A B C1 $16 $18 $11
21 Model DevelopmentThe model for this problem consists of nine decision variables, representing the number of television sets transported from each of the three warehouses to each of the three stores:xij = number of television sets shipped from warehouse i to store jwhere i = 1, 2, 3, and j = A, B, CThe objective function of the television manufacturer is to minimize the total transportation costs for all shipments. Thus, the objective function is the sum of the individual shipping costs from each warehouse to each store:minimize Z = $16x1A + 18x1B + 11x1C + 14x2A + 12x2B + 13x2C + 13x3A + 15x3B + 17x3CIn a "balanced" transportation model, supply equals demand such that all constraints are equalities; in an "unbalanced" transportation model, supply does not equal demand, and one set of constraints is ≤.
23 Model Summaryminimize Z = $16x1A + 18x1B + 11x1C + 14x2A + 12x2B + 13x2C + 13x3A + 15x3B + 17x3Csubject toThe transportation model can also be optimally solved by Linear Programming
24 Example 6: Scheduling Problem The personnel manager must schedule a security force in order to satisfy staffing requirements shown below. Each worker has an eight hour shift and there are six such shifts each day. The starting and ending time for each of the 6 shifts is also given below. The personnel manager wants to determine how many people need to work each shift in order to minimize the total number of officers employed while satisfying the staffing requirements.Time# Officers RequiredShiftShift Time12am-4am5112am-8am7151294am-8am8am-noonnoon-4pm4pm-8pm8pm-12am4am-noon8am-4pmnoon-8pm4pm-12am8pm-4am234626
25 Example 6: Scheduling Problem Let xi = number of officers who work on shift i, i = 1, ..., 6Min z = x1 + x2 + x3 + x4 + x5 + x6(Total number of officers employed)s.t. x6 + x1 5 (12am-4am)x1 + x2 7 (4am-8am)x2 + x3 15 (8am-noon)x3 + x4 7 (noon-4pm)x4 + x5 12 (4pm-8pm)x5 + x6 9 (8pm-12am)xi 0, i = 1, ..., 6 (Nonnegativity)27
26 Example 7: An Investment Example Kathleen Allen, an individual investor, has $70,000 to divide among several investments. The alternative investments are municipal bonds with an 8.5% annual return, certificates of deposit with a 5% return, treasury bills with a 6.5% return, and a growth stock fund with a 13% annual return. The investments are all evaluated after 1 year. Kathleen wants to know how much to invest in each alternative in order to maximize the return.The following guidelines have been established for diversifying the investments and lessening the risk perceived by the investor:1. No more than 20% of the total investment should be in municipal bonds.2. The amount invested in certificates of deposit should not exceed the amount invested in the other three alternatives.3. At least 30% of the investment should be in treasury bills and certificates of deposit.4. To be safe, more should be invested in CDs and treasury bills than in municipal bonds and the growth stock fund, by a ratio of at least 1.2 to 1.Kathleen wants to invest the entire $70,000.
27 An Investment Example - Model Decision Variables:x1 = amount ($) invested in municipal bondsx2 = amount ($) invested in certificates of depositx3 = amount ($) invested in treasury billsx4 = amount ($) invested in growth stock fundThe Objective Function:Maximize Z = $0.085x x x x4Constraints:x1 ≤$14,000Model Summaryx2 ≤x1 + x3 + x4x2 + x3 ≥$21,000[(x2 + x3)/(x1 + x4)] ≥1.2x1 + x2 + x3 + x4 = $70,000
28 Linear Programming (LP) General DescriptionProblem: to determine decision variablesObjective: to maximize or minimize an objective functionRestrictions: represented by constraintsSolution methods: graphical, simplex, computer14
29 General Form of a Linear Programming (LP) Problem MAX (or MIN): c1X1 + c2X2 + … + cnXnSubject to a11X1 + a12X2 + … + a1nXn b1:ak1X1 + ak2X2 + … + aknXn ≥ bkam1X1 + am2X2 + … + amnXn = bmX1 , X2 …… Xn ≥ 0Note: If all the functions in the model are linear, the problem is a Linear Programming (LP) problem
30 Graphical Solution of LP Models Graphical solution is limited to linear programming models containing only two decision variables.Graphical methods provide visualization of how a solution for a linear programming problem is obtained.
31 Example 1 – Product mix problem - Beaver Creek Pottery Company Complete Linear Programming Model:Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0
32 Graphical Solution of Maximization Model (1 of 11) Coordinate AxesGraphical Solution of Maximization Model (1 of 11)X2 is mugsMaximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0X1 is bowlsFigure: Coordinates for graphical analysis
33 Graphical Solution of Maximization Model (2 of 11) Labor ConstraintGraphical Solution of Maximization Model (2 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Graph of labor constraint
34 Graphical Solution of Maximization Model (3 of 11) Labor Constraint AreaGraphical Solution of Maximization Model (3 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Labor constraint area
35 Graphical Solution of Maximization Model (4 of 11) Clay Constraint AreaGraphical Solution of Maximization Model (4 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: The constraint area for clay
36 Graphical Solution of Maximization Model (5 of 11) Both ConstraintsGraphical Solution of Maximization Model (5 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Graph of both model constraints
37 Feasible Solution Area Graphical Solution of Maximization Model (6 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: The feasible solution area
38 Objective Function Solution = $800 Graphical Solution of Maximization Model (7 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Objective function line for Z = $800
39 Alternative Objective Function Solution Lines Graphical Solution of Maximization Model (8 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Alternative objective function lines for profits Z of $800, $1,200, and $1,600
40 Graphical Solution of Maximization Model (9 of 11) Optimal SolutionGraphical Solution of Maximization Model (9 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Identification of optimal solution point
41 Optimal Solution Coordinates Graphical Solution of Maximization Model (10 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0Figure: Optimal solution coordinates
42 Extreme (Corner) Point Solutions Graphical Solution of Maximization Model (11 of 11)Maximize Z = $40x1 + $50x2subject to: 1x1 + 2x2 404x2 + 3x2 120x1, x2 0The optimal solution of a maximization problem is at the extreme point farthest to the origin.Figure: Solutions at all corner points
43 Slack VariablesStandard form requires that all constraints be in the form of equations (equalities).A slack variable is added to a constraint to convert it to an equation (=).A slack variable typically represents an unused resource.A slack variable contributes nothing to the objective function value.
44 Linear Programming Model: Standard Form Max Z = 40x1 + 50x2 + 0s1 + 0s2subject to:1x1 + 2x2 + s1 = 404x2 + 3x2 + s2 = 120x1, x2, s1, s2 0Where:x1 = number of bowlsx2 = number of mugss1, s2 are slack variablesFigure: Solutions at points A, B, and C with slack
45 LP Model Formulation – Minimization (1 of 6) Two brands of fertilizer available - Super-gro, Crop-quick.Field requires at least 16 pounds of nitrogen and 24 pounds of phosphate.Super-gro costs $6 per bag, Crop-quick $3 per bag.Problem: How much of each brand to purchase to minimize total cost of fertilizer given following data ?
46 LP Model Formulation – Minimization (2 of 6) Decision Variables: x1 = bags of Super-grox2 = bags of Crop-quickThe Objective Function:Minimize Z = $6x1 + 3x2Where: $6x1 = cost of bags of Super-Gro$3x2 = cost of bags of Crop-QuickModel Constraints:2x1 + 4x2 16 lb (nitrogen constraint)4x1 + 3x2 24 lb (phosphate constraint)x1, x2 0 (non-negativity constraint)
47 Constraint Graph – Minimization (3 of 6) Minimize Z = $6x1 + $3x2subject to: 2x1 + 4x2 164x2 + 3x2 24x1, x2 0Figure: Constraint lines for fertilizer model
48 Feasible Region– Minimization (4 of 6) Minimize Z = $6x1 + $3x2subject to: 2x1 + 4x2 164x2 + 3x2 24x1, x2 0Figure: Feasible solution area
49 Graphical Solutions – Minimization (5 of 6) Minimize Z = $6x1 + $3x2 + 0s1 + 0s2subject to: 2x1 + 4x2 – s1 = 164x2 + 3x2 – s2 = 24x1, x2, s1, s2 0The optimal solution of a minimization problem is at the extreme point closest to the origin.Figure: Graph of the fertilizer example
50 Surplus Variables – Minimization (6 of 6) A surplus variable is subtracted from a constraint to convert it to an equation (=).A surplus variable represents an excess above a constraint requirement level.A surplus variable contributes nothing to the calculated value of the objective function.Subtracting surplus variables in the farmer problem constraints:2x1 + 4x2 - s1 = 16 (nitrogen)4x1 + 3x2 - s2 = 24 (phosphate)
51 Irregular Types of Linear Programming Problems For some linear programming models, the general rules do not apply.Special types of problems include those with:Multiple optimal solutionsInfeasible solutionsUnbounded solutions
52 Multiple Optimal Solutions Beaver Creek Pottery The objective function isparallel to a constraint line.Maximize Z=$40x1 + 30x2subject to: 1x1 + 2x2 404x1 + 3x2 120x1, x2 0Where:x1 = number of bowlsx2 = number of mugsFigure: Example with multiple optimal solutions
53 An Infeasible Problem Every possible solution violates at least one constraint:Maximize Z = 5x1 + 3x2subject to: 4x1 + 2x2 8x1 4x2 6x1, x2 0Figure: Graph of an infeasible problem
54 An Unbounded Problem Value of the objective function increases indefinitely:Maximize Z = 4x1 + 2x2subject to: x1 4x2 2x1, x2 0Figure: Graph of an unbounded problem
55 Characteristics of Linear Programming Problems A decision amongst alternative courses of action is required.The decision is represented in the model by decision variables.The problem encompasses a goal, expressed as an objective function, that the decision maker wants to achieve.Restrictions (represented by constraints) exist that limit the extent of achievement of the objective.The objective and constraints must be definable by linear mathematical functional relationships.
56 Properties of Linear Programming Models Proportionality - The rate of change (slope) of the objective function and constraint equations is constant.Additivity - Terms in the objective function and constraint equations must be additive.Divisibility - Decision variables can take on any fractional value and are therefore continuous as opposed to integer in nature.Certainty - Values of all the model parameters are assumed to be known with certainty (non-probabilistic).