Presentation on theme: "Planning with Linear Programming"— Presentation transcript:
1 Planning with Linear Programming Week 11, Chapter 12
2 Introduction To Linear Programming Today many of the resources needed as inputs to operations are in limited supply.Managers must understand the impact of this situation on meeting their objectives.Linear programming (LP) is one way that managers can determine how best to allocate their scarce resources.
3 Linear ProgrammingLinear programming is a way of solving some problems of constrained optimisationConstrained optimisation has:an aim of optimising – either maximising or minimising – some objective.a set of constraints that limit the possible solutions.
4 Linear ProgrammingThere are three distinct stages in solving a linear programme:formulation – getting the problem in the right formsolution – finding an optimal solution to the problemsensitivity analysis – seeing what happens when the problem is changed slightly.
5 Linear Programming Formulation contains decision variables an objective functiona set of constraintsa non-negativity constraint.
6 Linear ProgrammingThere are five common types of decisions in which LP may play a roleProduct mixProduction planIngredient mixTransportationAssignment
7 LP Problems: Product Mix ObjectiveTo select the mix of products or services that results in maximum profits for the planning periodDecision VariablesHow much to produce and market of each product or service for the planning periodConstraintsMaximum amount of each product or service demanded; Minimum amount of product or service policy will allow; Maximum amount of resources available
8 LP Problems: Production Plan ObjectiveTo select the mix of products or services that results in maximum profits for the planning periodDecision VariablesHow much to produce on straight-time labor and overtime labor during each month of the yearConstraintsAmount of products demanded in each month; Maximum labor and machine capacity available in each month; Maximum inventory space available in each month
9 Recognizing LP Problems Characteristics of LP ProblemsA well-defined single objective must be stated.There must be alternative courses of action.The total achievement of the objective must be constrained by scarce resources or other restraints.The objective and each of the constraints must be expressed as linear mathematical functions.
10 Steps in Formulating LP Problems fine the objective. (min or max) 1. Define the decision variables. (positive, binary) 2. Write the mathematical function for the objective. 3. Write a 1- or 2-word description of each constraint. 4. Write the right-hand side (RHS) of each constraint. 5. Write <, =, or > for each constraint. 6. Write the decision variables on LHS of each constraint. 7. Write the coefficient for each decision variable in each constraint.
11 AssumptionsObjective function and constraints are linear functions. So if production is doubled, the use of resources is doubled. This is usually ok, but not always the case. E.g increasing production – reduce set-up times OR may lead to more faulty products.Resources are used in the same amount regardless of product – not always the case. E.g. A skilled worker will be assigned to the most complex tasks, but if they are assigned to less complex task they would likely do that task faster/better than normally.
12 Example 1A small factory makes two types of liquid fertilizer: SuperBig and FastGrow.They are both made by similar processes: blending, mixing raw materials.Factory has limited amount of equipment there are constraints on total time available for each process.Only 20 hours of blending per week, 30 hours of distilling per week, 15 hours of finishing per week.Fertilizers are made in batches, and each batch needs the following hours on each process:If the factory makes a net profit of $250 on each batch of SuperBig and $150 on each batch of FastGrow, How many should it make in a week?
13 Example 1 Maximize: 250S + 150F Objective function 2S + 4F < 20 Blending constraint1.5S + 2F < 30 Distilling ConstraintS + 0.5F < 15 Finishing ConstraintS > 0 and F > 0 Non-negativity constraintsS is number of batches of SuperBig per weekF is the number of batches of FastGrow per week
14 Example 2Cycle Trends is introducing two new lightweight bicycle frames, the Deluxe and the Professional, to be made from aluminum and steel alloys. The anticipated unit profits are $10 for the Deluxe and $15 for the Professional.The number of pounds of each alloy needed per frame is summarized on the next slide. A supplier delivers 100 pounds of the aluminum alloy and 80 pounds of the steel alloy weekly. How many Deluxe and Professional frames should Cycle Trends produce each week?
15 Pounds of each alloy needed per frame Example 3Pounds of each alloy needed per frameAluminum Alloy Steel Alloy Deluxe 2 3 Professional 4 2
16 Example 3 Define the objective Define the decision variables Maximize total weekly profitDefine the decision variablesx1 = number of Deluxe frames produced weeklyx2 = number of Professional frames produced weeklyWrite the mathematical objective functionMax Z = 10x1 + 15x2
17 Example 3 Write a one- or two-word description of each constraint Aluminum availableSteel availableWrite the right-hand side of each constraint10080Write <, =, > for each constraint< 100< 80
18 Example 3Write all the decision variables on the left-hand side of each constraintx1 x2 < 100x1 x2 < 80Write the coefficient for each decision in each constraint+ 2x1 + 4x2 < 100+ 3x1 + 2x2 < 80
19 Example 3 LP in Final Form Max Z = 10x1 + 15x2 Subject To 2x1 + 4x2 < 100 ( aluminum constraint)3x1 + 2x2 < 80 ( steel constraint)x1 , x2 > (non-negativity constraints)
20 Example 4Montana Wood Products manufacturers two-high quality products, tables and chairs. Its profit is $15 per chair and $21 per table. Weekly production is constrained by available labor and wood. Each chair requires 4 labor hours and 8 board feet of wood while each table requires 3 labor hours and 12 board feet of wood. Available wood is 2400 board feet and available labor is 920 hours. Management also requires at least 40 tables and at least 4 chairs be produced for every table produced. To maximize profits, how many chairs and tables should be produced?
21 Example 4 Define the objective Define the decision variables Maximize total weekly profitDefine the decision variablesx1 = number of chairs produced weeklyx2 = number of tables produced weeklyWrite the mathematical objective functionMax Z = 15x1 + 21x2
22 Example 4 Write a one- or two-word description of each constraint Labor hours availableBoard feet availableAt least 40 tablesAt least 4 chairs for every tableWrite the right-hand side of each constraint9202400404 to 1 ratioWrite <, =, > for each constraint< 920< 2400> 404 to 1
23 Example 4Write all the decision variables on the left-hand side of each constraintx1 x2 < 920x1 x2 < 2400x2 > 404 to 1 ratio x1 / x2 ≥ 4/1Write the coefficient for each decision in each constraint+ 4x1 + 3x2 < 920+ 8x1 + 12x2 <x2 > 40x1 ≥ 4 x2
24 Example 4 LP in Final Form Max Z = 15x1 + 21x2 Subject To 4x1 + 3x2 < 920 ( labor constraint)8x1 + 12x2 < ( wood constraint)x > 0 (make at least 40 tables)x1 - 4 x2 > 0 (at least 4 chairs for every table)x1 , x2 > (non-negativity constraints)
25 LP Problems in GeneralUnits of each term in a constraint must be the same as the RHSUnits of each term in the objective function must be the same as ZUnits between constraints do not have to be the sameLP problem can have a mixture of constraint types
26 Example 5 (minimization) a division of Kodak, which makes BW & color chemicals. At least 30 tons of BW and at least 20 tons of color must be made each month. The total chemicals made must be at least 60 tons. How many tons of each chemical should be made to minimize costs?BW: $2,500 manufacturing cost per monthColor: $ 3,000 manufacturing cost per month
27 Example 5 Decision variables Objective Constraints X1 = tons of BW chemical producedX2 = tons of color chemical producedObjectiveMinimize Z = 2500X X2ConstraintsX1 30 (BW); X2 20 (Color)X1 + X2 60 (Total tonnage)X1 0; X2 0 (Non-negativity)
28 Example 6Williams Steel Company produces steel. The raw materials for Steel are iron and carbon. Iron costs $7.2 per ton and carbon costs $10.01 per ton. The exact requirements are: Iron makes up 98% the weight of steel and carbon makes up 2% the weight of steel.. Each day 3200 tons of Steel are produced. To minimize costs, how many tons of Iron and Carbon should be purchased each day?
29 Example 6 LP in Final Form Minimize = 7.2I + 10.01C Subject To I = ( mix constraint)C = 64 ( mix constraint )I , C > (non-negativity constraints)
30 Example 7A soft drink manufacturer produces the drink called “Purple Rush”, which is made using glucose, water, and Colouring liquid. Purple rush must be at least 30% glucose, at most 80% water and at most 40% purple colouring. A litre of purple rush sells for $20. A litre of water costs $0.10, a litre of glucose costs $1.00 and a litre of purple colouring costs $4.80. The firm wishes to maxmize profit.
31 Example 7Decision variables: W – litre of water, G – litre of glucose, P – litre of purple c. Profit = revenue – cost Revenue: 20(W+G+P) Cost: 0.1W + G + 4.8P Profit: 19.9W + 19G P
32 Example 7Constraints: G > 0.3 ( W + G + P) (mix constraint) W < 0.8 (W + G + P) (mix constraint) P < 0.4 (W + G + P) (mix constraint) W, P, G > 0
33 Example 8Galaxy Ind. produces two water guns, the Space Ray and the Zapper. Galaxy earns a profit of $3 for every Space Ray and $2 for every Zapper. Space Rays and Zappers require 2 and 4 production minutes per unit, respectively. Also, Space Rays and Zappers require .5 and .3 pounds of plastic, respectively. Given constraints of 40 production hours, 1200 pounds of plastic, Space Ray production can’t exceed Zapper production by more than 450 units; formulate the problem such that Galaxy maximizes profit.
34 Example 8R = # of Space Rays to produce Z = # of Zappers to produce Maximize = 3.00R Z Subject T0: 2R + 4Z ≤ 2400 can’t exceed available hours (40*60) .5R + .3Z ≤ 1200 can’t exceed available plastic R - Z ≤ 450 Space Rays can’t exceed Zappers by more than 450 R, Z ≥ 0 non-negativity constraint
35 Example 9A company has $3 million to invest an is considering the following investments: The company want minimal risk with a dividend of at least $88,000 a year, portfolio growth of a least 10%, and a rating of at least 6.
36 Example 9A: amount of money ($) to put into investment A. Minimize: 0.15A+0.13B+0.07C+0.23D+0.05E+0.08F+0.09G+0.1H+0.09I+0.08J Subject to: $3m = A+B+C+D+E+F+G+H+I+J (total investment) $88,000<0.05A+0.06B+0.06C+….. (dividend requirement) $300,000<0.12A+0.11B+0.06C+….. (growth requirement) 18,000,000<4A+9B+8C+….. (rating requirement)
37 Example 10A ship has two cargo holds, one fore and one aft. The fore cargo hold has a weight capacity of 70,000 pounds and a volume capacity of 30,000 cubic feet. The aft hold has a weight capacity of 90,000 pounds and a volume capacity of 40,000 cubic feet. The shipowner has contracted to carry loads of packaged beef and grain. The total weight of the available beef is 85,000 pounds; the total weight of the available grain is 100,000 pounds. The volume per mass of the beef is 0.2 cubic foot per pound, and the volume per mass of the grain is 0.4 cubic foot per pound. The profit for shipping beef is $0.35 per pound, and the profit for shipping grain is $0.12 per pound. The shipowner is free to accept all or part of the available cargo; he wants to know how much meat and grain to accept in order to maximize profit.
38 Example 10BF = # lbs beef to load in fore cargo hold BA = # lbs beef to load in aft cargo hold GF = # lbs grain to load in fore cargo hold GA = # lbs grain to load in aft cargo hold Maximize = .35 BF + .35BA + .12GF GA Subject T0: BF + GF ≤ fore weight capacity – lbs BA + GA ≤ aft weight capacity – lbs .2BF + .4GF ≤ for volume capacity – cubic feet .2BA + .4GA ≤ for volume capacity – cubic feet BF + BA ≤ max beef available GF + GA ≤ max grain available
39 Example 11In the summer, the City of Sunset Beach staffs lifeguard stations seven days a week. Regulations require that city employees (including lifeguards) work five days a week and be given two consecutive days off. Insurance requirements mandate that Sunset Beach provide at least one lifeguard per 8000 average daily attendance on any given day. The average daily attendance figures by day are as follows: Sunday – 58,000, Monday – 42,000, Tuesday – 35,000, Wednesday – 25,000, Thursday – 44,000, Friday – 51,000 and Saturday – 68,000. Given a tight budget constraint, the city would like to determine a schedule that will employ as few lifeguards as possible.
40 Example 11 X1 = number of lifeguards scheduled to begin on Sunday X2 = “ “ “ “ “ MondayX3 = “ “ “ “ “ TuesdayX4 = “ “ “ “ “ WednesdayX5 = “ “ “ “ “ ThursdayX6 = “ “ “ “ “ FridayX7 = “ “ “ “ “ Saturday
42 Example 12The White Horse Apple Products Company purchases apples from local growers and makes applesauce and apple juice. It costs $0.60 to produce a jar of applesauce and $0.85 to produce a bottle of apple juice. The company has a policy that at least 30% but not more than 60% of its output must be applesauce. The company wants to meet but not exceed demand for each product. The marketing manager estimates that the maximum demand for applesauce is 5,000 jars, plus an additional 3 jars for each $1 spent on advertising. Maximum demand for apple juice is estimated to be 4,000 bottles, plus an additional 5 bottles for every $1 spent to promote apple juice. The company has $16,000 to spend on producing and advertising applesauce and apple juice. Applesauce sells for $1.45 per jar; apple juice sells for $1.75 per bottle. The company wants to know how many units of each to produce and how much advertising to spend on each in order to maximize profit.
43 Example 12S = # jars apple Sauce to make J = # bottles apple Juice to make SA = $ for apple Sauce Advertising JA = $ for apple Juice Advertising Maximize = 1.45S J - .6S - .85J – SA – JA Subject To: S ≥ .3(S + J) at least 30% apple sauce S ≤ .6(S + J) no more than 60% apple sauce S ≤ SA don’t exceed demand for apple sauce J ≤ JA don’t exceed demand for apple juice .6S + .85J + SA + JA ≤ budget
44 Example 13A cargo plane has three compartments for storing cargo: front, centre and rear. These compartments have the following limits on both weight and space:The following four cargoes are available for shipment on the next flight:Formulate LP to maximize profit (any proportions of cargo can be accepted)CompartmentWeight Capacity (tonnes)Space capacity (cubic metres)Front106800Center168700Rear85300CargoWeight (tonnes)Volume (cubic metres/tonne)Profit ($ per tonne)C118480310C215650380C323580350C412390282
45 Example 13Variables: Xij : the number of tonnes of cargo “i” that that is put into compartment “j” for i : 1 = C1 , 2 = C2 , 3 = C3 , 4 = C4 for j: 1 = front , 2 = centre , 3 = rear where xij >=0 i=1,2,3,4; j=1,2,3 (note: we are explicitly told we can split the cargoes into any proportions (fractions) that we like. Objective function: Maximize 310[x11+ x12+x13] + 380[x21+ x22+x23] + 350[x31+ x32+x33] + 285[x41+ x42+x43]
46 Example 13Constraints Weight constraint per cargo: x11 + x12 + x13 <= 18 x21 + x22 + x23 <= 15 x31 + x32 + x33 <= 23 x41 + x42 + x43 <= 12 Weight constraint per compartment: x11 + x21 + x31 + x41 <= 10 x12 + x22 + x32 + x42 <= 16 x13 + x23 + x33 + x43 <= 8 Volume (space) capacity constraint of each compartment: 480x x x x41 <= x x x x42 <= x x x x43 <= 5300
47 Example 14A company manufactures four products (1,2,3,4) on two machines (X and Y). The time (in minutes) to process one unit of each product on each machine is shown below:The profit per unit for each product (1,2,3,4) is $10, $12, $17 and $8 respectively. Product 1 must be produced on both machines X and Y but products 2, 3 and 4 can be produced on either machine.The factory is very small and this means that floor space is very limited. Only one week's production is stored in 50 square metres of floor space where the floor space taken up by each product is 0.1, 0.15, 0.5 and 0.05 (square metres) for products 1, 2, 3 and 4 respectively.ProductMachine XMachine Y1102721219313334823
48 Example 14Customer requirements mean that the amount of product 3 produced should be related to the amount of product 2 produced. Over a week twice as many units of product 2 should be produced as product 3.Machine X is out of action (for maintenance/because of breakdown) 5% of the time and machine Y 7% of the time.Assuming a working week 35 hours long formulate the problem of how to manufacture these products as a linear program to maximize profit.
49 Example 14Variables:xi = amount of product i (i=1,2,3,4) produced on machine X per weekyi = amount of product i (i=2,3,4) produced on machine Y per weekwhere xi >= 0 i=1,2,3,4 and yi >= 0 i=2,3,4Note here that as product 1 must be processed on both machines X and Y we do not define y1.Objective Function:Maximize10x1 + 12(x2 + y2) + 17(x3 + y3) + 8(x4 + y4)
51 Example 15A company assembles four products (1, 2, 3, 4) from delivered components. The profit per unit for each product (1, 2, 3, 4) is $10, $15, $22 and $17 respectively. The maximum demand in the next week for each product (1, 2, 3, 4) is 50, 60, 85 and 70 units respectively. There are three stages (A, B, C) in the manual assembly of each product and the man-hours needed for each stage per unit of product are shown below:StageProduct 1Product 2Product 3Product 4A21B4C365
52 Example 15The nominal time available in the next week for assembly at each stage (A, B, C) is 160, 200 and 80 man-hours respectively.Production constraints also require that the ratio (product 1 units assembled)/(product 4 units assembled) must lie between 0.9 and 1.15.Formulate the problem to maximize profit.
53 Example 15 Variables: xi = amount of product i produced (i=1,2,3,4) Where all variables >= 0, and xi variables are integers.Objective function:Maximize10x1 + 15x2 + 22x3 + 17x4
55 Example 16A company is producing a product which requires, at the final assembly stage, three parts. These three parts can be produced by two different departments as detailed belowOne week, 1050 finished (assembled) products are needed (but up to 1200 can be produced if necessary). If department 1 has 100 working hours available, but department 2 has 110 working hours availableBecause of the way production is organized in the two departments it is not possible to produce, for example, only one or two parts in each department, e.g. one hour of working in department 1 produces 7 part 1 units, 6 part 2 units and 9 part 3 units and this cannot be altered.Formulate the LP to mi
56 Example 16Variables:xi = number of hours used in department i (i=1,2)y = number of finished (assembled) products madewhere xi >= 0 i=1,2 and y >= 0, and y variables are integersObjective Function:Minimize25.0x1 + 12.5x2
57 Example 16Constraints: Working hours constraint: x1 <= 100 x2 <= 110 Assembled product constraint: y <= 1200 y >= 1050 Hours for each assembled product constraint: 7x1 + 6x2 >= y 6x1 + 11x2 >= y 9x1 + 5x2 >= y