7

Click here to load reader

Lecture 4 Linear Programming II - Solving Problems Six Slides

Embed Size (px)

DESCRIPTION

quantitative methods chapter 4

Citation preview

  • 1LINEAR PROGRAMMING IISOLVING LINEAR PROBLEMS

    Lecture 4

    Lecturer: Dr. Dwayne Devonish

    MGMT 2012: Introduction to Quantitative MethodsLearning Objectives

    Students should be able to:

    To outline the key steps of solving linearprogramming (LP) problems graphically

    To apply the graphical method to solving LPproblems in real-life situations dealing with profitmaximization and cost minimization,

    To apply QM software in solving larger and morecomplex LP problems

    To conduct sensitivity analysis to determine thestability of LP model results

    Solving linear problems Once linear programs (LPs) for problems are

    developed, we must seek to solve them.

    Methods for solving LPs include:

    The graphical procedure

    Simplex method

    Computer-assisted procedures (i.e. QM software)

    We will focus on the graphical procedure andcomputer-assisted procedures.

    The simplex method requires an iterativemathematical process to solving linear problemsbut is often tedious when done manually.

    Graphical Method

    The graphical method is a method for obtaining anoptimal solution to two-variable problems.

    It can be used for problems with only 2 decisionvariables (X1 and X2).

    The graphical method first involves plotting theconstraints of the linear problem on a graph, andan area of the graph is located that satisfies allconstraints. This area is the feasible solutionspace (shape of polygon).

    Several corner points or vertices of this space(shape) are identified and assessed, and theoptimal solution is determined.

    STEPS TO GRAPHICAL PROCEDURE

    1. Set up objective function and constraints inmathematical format (i.e. Formulation).

    2. Plot the constraints

    3. Identify the feasible solution space

    4. Examine corner points of feasible solutionspace (the corner-point solution method: aneasier alternative to the traditional isoprofitline solution method)

    5. Choose the x,y coordinates that generate theoptimal solution.

    Flair Furniture Company Data

    DepartmentX1

    Tables

    X2

    Chairs

    Available

    Hours This

    Week Carpentry (hrs)

    Painting

    &Varnishing (hrs)

    4

    2

    3

    1

    240

    100

    Profit Amount $70 per table $50 per chair

    Maximize Profit: 70X1 + 50X2

    Constraints: 4X1 + 3X2 240 (Carpentry)

    2X1 + 1X2 100 (Paint & Varnishing)

    X1, X2 0 ( nonnegative constraints)

    Mathematical formulation: (Step 1)Mathematical formulation: (Step 1)

  • 2Step 2: Plotting Constraints Graphically

    Using a graph, the X1 variable (no. of tables) isplaced on horizontal axis, and X2 (no. of chairs)variable on the vertical axis. Each constraint mustnow be graphically plotted.

    Nonnegativity constraints suggest that one isalways working in the first (or north-east) quadrantof the graph.

    Flair Furniture Company Step 2: Plot Constraints

    Number of Tables X1

    100

    80

    60

    40

    20

    0

    Nu

    mb

    er o

    f C

    hai

    rs X

    2

    20 40 60 80 100

    This axis represents non-negative

    Constraint: X1 0

    This axis represents non-negative

    Constraint: X2 0

    Plotting Constraints The 1st constraint on hours of carpentry: 4X1 +3X2

    240: must be converted to an equation of astraight line.

    This is done by changing sign to = sign so youwill have a linear equation: 4X1 +3X2 = 240 .

    You will then have to have to find any two pointsthat satisfy this equation, then draw a line throughthese two points on the graph.

    The two easiest points are those at which the lineintersects the X1 and X2 axes.

    So when X1 = 0, find the value of X2. Then whenX2 = 0, find the value of X1. Use the equation toobtain these values.

    Plotting Constraints

    So for the 1st constraint on carpentry hrs, if X1 = 0,we have: 4(0) +3X2 = 240 , which is works out as:

    3X2 = 240, so X2 = 240/3 = 80. So if we had notables for carpentry, we can produce 80 chairs(x2) within the 240 hours (80 x 3hrs). Locate 80on the x2 vertical axis.

    Then, if X2 = 0, we have: 4X1 +3(0) = 240 , whichis 4X1 = 240, so X1 = 240/4 = 60. So if we had nochairs for carpentry, we can produce 60 tables(x1) within the 240 hours (60 x 4hrs). Locate 60on the x1 horizontal axis.

    Lets plot the points, and draw a line joining them.Focus on red line.

    Graph of Carpentry Constraint Equation:4X1 + 3X2 = 240

    Number of Tables X1

    100

    80

    60

    40

    20

    0

    Nu

    mb

    er o

    f C

    hai

    rs X

    2

    20 40 60 80 100

    (X1 = 60, X2 = 0)

    (X1= 0, X2 =80)

    Plotting Constraints Next, 2nd constraint on hours of

    painting/varnishing: 2X1 + 1X2 100: must beconverted to an equation of a straight line.

    This is done by changing sign to = sign so youwill have a linear equation: 2X1 +1X2 = 100.

    You will then have to have to find any two pointsthat satisfy this equation, then draw a line throughthese two points on the graph.

    The two easiest points are those at which the lineintersects the X1 and X2 axes.

    So when X1 = O, find the value of X2. Then whenX2 = 0, find the value of X1. Use the equation toobtain these values.

  • 3Plotting Constraints

    So if X1 = 0, we have: 2(0) +1X2 = 100 , which is

    1X2 (or X2) = 100. So if we had no tables topaint/varnish, we can organise 100 chairs (x2)within the 100 hours. Locate 100 on the x2vertical axis.

    Then, if X2 = 0, we have: 2X1 +1(0) = 100 , whichis 2X1 = 100, so X1 = 100/2 = 50. So if we had nochairs to paint/varnish we can organise 50 tables(x1) within the 100 hours. Locate 50 on the x1horizontal axis.

    Lets plot the points, and draw a line joining them.Focus on blue line.

    Graph of Carpentry Constraint Equation:4X1 + 3X2 = 240 and Painting/Varnis. Constraint

    Equation: 2X1 + 1X2 = 100

    Number of Tables X1

    100

    80

    60

    40

    20

    0

    Nu

    mb

    er o

    f C

    hai

    rs X

    2

    20 40 60 80 100

    (X1 = 50, X2 = 0)

    Carpentry line: red

    Painting/varnishing: blue

    (X1 = 0, X2 =100)

    50

    Step 3: Locate Feasible Solution Space

    After all constraints are plotted, you must find thefeasible solution space, which is the area that containsall points (x1, x2) that satisfy constraintssimultaneously.

    We are going to shade this area. Any combination ofX1:X2 coordinate points in this area will satisfyconstraints, hence, it is known as a feasible solution.

    There are multiple feasible solutions, but the one thatwith the best profit maximization is the optimal one.

    Graph of Carpentry Constraint Equation:4X1 + 3X2 = 240 and Painting/Varnis. Constraint

    Equation: 2X1 + 1X2 = 100

    Number of Tables X1

    100

    80

    60

    40

    20

    0

    Nu

    mb

    er o

    f C

    hai

    rs X

    2

    20 40 60 80 100

    (X1 = 50, X2 = 0)

    Carpentry line: red

    Painting/varnishing: blue

    (X1 = 0, X2 =100)

    50

    Feasible area

    shown

    Infeasible area

    Infeasible Solution Space

    Any point outside of the region will violate one ormore of the constraints. For example, if we saidwe would make 70 tables (x1) and 40 chairs (x2).

    We would have violated:

    4X1 + 3X2 240 (Carpentry) where 4 (70) x 3 (40)= 400 hrs. 400 is more than 240.

    2X1 + 1X2 100 (Paint & Varnishing) where2 (70) x 1 (40) = 180 hrs. 180 is more than 100

    Hence, we have to focus on points within thefeasible region.

    Step 4: Examine the corner-points of the feasible space

    The feasible space typically forms a polygon shape.

    The solution to any problem is found at any one ofthe corner points of the space (intersections).

    You have to determine the coordinates (x1,x2) ateach corner point of the space, and use thosevalues to compute the value of objective function(e.g. profit).

    After all corner-points have been evaluated, the onethat generates the optimal value (i.e. maximum forprofit maximization problems) is the optimalsolution.

    I have placed the corner point coordinates in boxes.

  • 4Graph of Carpentry Constraint Equation:4X1 + 3X2 = 240 and Painting/Varnis. Constraint

    Equation: 2X1 + 1X2 = 100

    Number of Tables X1

    100

    80

    60

    40

    20

    0

    Nu

    mb

    er o

    f C

    hai

    rs X

    2

    20 40 60 80 100

    Carpentry line: red

    Painting/varnishing: blue

    50

    Feasible area

    shown

    Infeasible area

    2

    1

    3

    4

    Corner Point Solution MethodCorner Point Solution Method

    The feasible region for the Flair Furniture Company problem is a four-sided polygon with four corner, or extreme, points.

    These points are labeled 1 ,2 ,3 , and 4 on the next graph.

    To find the (x1, x2) values producing the maximum profit, find the coordinates of each corner point and test their profit levels.

    Point 1:(x1 = 0,x2 = 0) profit = $70(0) + $50(0) = $0

    Point 2:(x1 = 0,x2 = 80) profit = $70(0) + $50(80) = $4000

    Point 3:(x1 = 30,x2 = 40) profit = $70(30) + $50(40) = $4100

    Point 4 : (x1 = 50, x2 = 0) profit = $70(50) + $50(0) = $3500

    Flair Furniture Company Corner Point

    ANDI

    Given that point 3 (where x1 = 30, x2 = 40)generates the highest profit (i.e $4100), theoptimal number of tables and chairs are 30 and40, respectively.

    If we had a minimization problem (minimizingcosts), we can use the same graphicalprocedure, but in most cases, the feasiblesolution is found on the right of the constraintlines (given constraints).

    The next three slides were provided by Renderet al to show you a demonstration ofminimization problems.

    MINIMIZATION PROBLEM Holiday Meal Turkey purchases two brands of feed to

    provide a good quality but low cost diet for its turkeys.Three important nutritional ingredients are needed forthe turkeys diet. Each pound of brand 1 contains 5ounces of Ingredient A, 4 ounces of Ingredient B, and1 ounce of Ingredient C. Each pound of brand 2contains 10 ounces of Ingredient A, 3 ounces ofIngredient B, and no Ingredient C. Brand 1 costs 2cents per pound, and Brand 2 costs 3 cents perpound. The minimum monthly requirements of eachIngredient for the turkeys are 90 ounces of A, 48ounces of B, and 3 ounces of C. Lets determine thelowest cost diet that meets monthly intakerequirements i.e. the minimum number of pounds ofeach brand to purchase.

    Solving Minimization ProblemsHoliday Meal Turkey Ranch exampleHoliday Meal Turkey Ranch example

    Minimize: 2X1 + 3X2Subject to:

    5X1 + 10X2 90 oz. (A)

    4X1 + 3X2 48 oz. (B)

    X1 3 oz. (C)

    X1, X2 0 (D)where,

    X 1 = # of pounds of brand 1 feed to purchase

    X 2 = # of pounds of brand 2 feed to purchase

    (A) = ingredient A constraint

    (B) = ingredient B constraint

    (C) = ingredient C constraint

    (D) = non-negativity constraints

    Holiday Meal Turkey Ranch

    Using the Corner Point MethodUsing the Corner Point Method

    To solve this problem:

    1. Construct the feasible solution region.

    This is done by plotting each of the three constraint

    equations.

    2. Find the corner points.

    This problem has 3 corner points, labeled a, b, and c.

    - Minimization problems are often unbound

    outward (i.e., to the right and on top), but this causes no

    difficulty in solving them.

    - As long as they are bounded inward (on the left side and

    the bottom), corner points may be established.

    - The optimal solution will lie at one of the corners as it

    would in a maximization problem.

  • 5Holiday Meal Turkey Problem

    Corner PointsCorner Points

    Holiday Meal Turkey Problem

    Corner PointsCorner Points

    This shaded side is the feasible space

    The unshaded area below lines is infeasible

    Corner Points and Solution There are three corner points and one must work out

    the optimal values (cost) for x1, x2 at these points.

    Then we plug in the values in objective function: MinC. = 2X1 + 3X2 (in cents)

    A: X1 = 3; X2 = 12: Total Cost: 2(3) + 3(12) = 42cents

    B: X1 =8.4, X2 =4.8: Total Cost: 2(8.4) + 3(4.8) =31.2 cents

    C: X1 = 18, X2 = 0: Total Cost: 2(18) + 3(0) = 36cents.

    Given that the lowest cost is needed, the managershould purchase 8.4 lbs of Brand 1, and 4.8 poundsof Brand 2 (with only a cost of 31 cents).

    QM for Windows: Solving using Computer Procedures

    Lets use QM for Windows, a quantitative softwarepackage that will help formulate and solve our firstmaximization scenario regarding the tables andchairs. Computer-assisted QM software canimprove the efficiency of formulating and solvingsmall and large linear problems (i.e multiple-variable problems). See below formulation:

    Maximize Profit: 70X1 + 50X2 subject to

    4X1 + 3X2 240 (Carpentry)

    2X1 + 1X2 100 (Paint & Varnishing)

    X1, X2 0 ( nonnegative constraints)

    Sensitivity Analysis Sensitivity analysis is important to assess whether an

    optimal solution is likely to change (or remainconstant) if changes occur to other factors such asprices of raw materials, product demand changes,production capacity changes, and so on.

    Managers must be able to act quickly to determinewhether the decisions they had made would have tochange.

    Sensitivity analysis determines the range of valuechanges that will not affect the optimal solution.

    We will focus on changes to objective functioncoefficients (profit/cost values) and to right-hand sidevalues (quantity constraint values).

    Prior Example

    Maximize Profit: 70X1 + 50X2

    Subject to Constraints:

    4X1 + 3X2 240 (Carpentry)

    2X1 + 1X2 100 (Paint & Varnishing)

    X1, X2 0 ( nonnegative constraints)

    We will look at this example into QM for windows to examine the sensitivity results.

  • 6Sensitivity Analysis I: Objective Function Coefficient (Profit Values) Changes

    In the sensitivity analysis section, you can seethe optimal values of 30 for tables (X1) and 40for chairs (X2).

    You will see profit values for tables is $70 and$50 for chairs. Recall that sensitivity analysiscan tell you whether you will still need to obtain30 tables and 40 chairs to maximize profitsbased on changes to profits.

    These values are usually presented in tabularform.

    Sensitivity Analysis on Profit Changes

    Variables Solution OriginalValue (Profit)

    LowerBound

    Upper Bound

    Tables 30 $70 $66.66 $100

    Chairs 40 $50 $35 $52.50

    So looking at the table from lower bound to upper bound, the optimal solution (30,40) will remain the same if profit for tables drop as low as $66.66 or rise as high as $100. Or it will remain the same if the profit for chairs drop as low as $35 or rise as high as $52.50.

    SoI

    So if we have a drop in profit in tables; forexample, the profit dropped from $70 to $68.Then, we will still need to produce 30 tables and40 chairs in order to maximise profit.

    However, if the profit drops to $59, this is outsidethe range of optimality ($66.66 to $100), adifferent optimal solution will be needed.

    Sensitivity analysis for objective function (profit)value changes determine whether optimal solutionwill change or not change.

    Sensitivity Analysis II: Quantity Constraint Changes

    Quantity constraint (Right Hand Side) values are thevalues right of the inequality sign. i.e. 240 hoursavailable for carpentry, and 100 hours available forpainting and varnishing.

    Sensitivity analysis for quantity constraint valuesfocuses on the range of feasibility.

    You are interested in the following questions:

    Keeping all other factors the same, how much wouldthe optimal value of the objective function (forexample, the profit) change if the right-hand side of aconstraint changed by one unit? (aka Dual price)

    For how many additional or fewer units will this perunit change be valid? (range of feasibility withinwhich the dual price will be valid)

    Sensitivity Analysis II on Quantity Constraint Values

    Constraint DualPrice

    Slack/Surplus

    OriginalValue

    LowerBound

    UpperBound

    Carpentry $15 0 240 hrs 200 300

    Painting/Var.

    $5 0 100 hrs 80 120

    Dual prices are calculated from the sensitivity analysis for eachconstraint. Slack is what remains after you operated on optimalsolution (make 30 tables and 40 chairs). Original valuerepresents current limits of constraints, and lower and upperbound represents range of feasibility for quantity constraints. Forexample, $15 will be added on total profit for every unit (hour)added to carpentry from 240 up to 300 hours. Outside of therange of 200 to 300 hours, dual price will not be relevant.

    Dual (Shadow) Prices The dual price is the value of the optimal solution for

    one additional unit of a scare resource. It is the improvement of the optimal solution per unit

    increase in the right-hand side constraint. The dual price for carpentry (constraint 1) is $15 per

    hour, and for painting/varnishing, it is $5. So if one additional carpentry hour was added to the

    total available, the overall optimal profit will increaseby $15, or if one additional hour forpainting/varnishing to the total available, the overallprofit will increase by $5. However, if we lose 1 hourfrom either carpentry or painting/varnishing availablehours, our profit will drop by $15 or $5 respectively.

    Note: this is only true within the ranges offeasibility.

  • 7Sensitivity Analysis II on Quantity Constraint Values

    Constraint DualPrice

    Slack/Surplus

    OriginalValue

    LowerBound

    UpperBound

    Carpentry $15 0 240 200 300

    Painting/Var.

    $5 0 100 80 120

    Dual prices are calculated from the sensitivity analysis for each constraint. Slack is what remains after you operated on optimal solution (make 30 tables and 40 chairs). Original value represents current limits of constraints, and lower and upper bound represents range of feasibility for quantity constraints. For example, $15 will be added on total profit for every unit (hour) added to carpentry from 240 up to 300 hours. Outside of the limit of 200 to 300 hours, dual price will not be relevant.

    Range of Feasibility for RHS

    So the range of feasibility for carpentry is 200 to 300hrs this is the range of values for the right handside of a constraint in which dual prices for theconstraint remain unchanged. Dual price for thisconstraint is $15.

    The range of feasibility for painting/varnishing is 80to 120 hours. Dual price is $5.

    To find out how the objective profit value changes inthe range of feasibility:

    Change in objective value = [Dual price][Change in the right hand side value]

    Practice Example

    Using the same example, remember the profitof $4100.

    1. If the manager had obtained an additional 25hours to the total carpentry hours, what will bethe total profit (i.e. value of objective function)?

    2. If the manager had lost 12 hours of totalcarpentry hours, what will be the total profit?

    3. If the painting/varnishing hours had increasedfrom 100 to 110 hrs, what will be the totalprofit?

    Sensitivity Analysis on Quantity Constraint Values

    Constraint DualPrice

    Slack/Surplus

    OriginalValue

    LowerBound

    UpperBound

    Carpentry $15 0 240 200 300

    Painting/Var.

    $5 0 100 80 120

    Dual prices are calculated from the sensitivity analysis for each constraint. Slack is what remains after you operated on optimal solution (make 30 tables and 40 chairs). Original value represents current limits of constraints, and lower and upper bound represents range of feasibility for quantity constraints. For example, $15 will be added on total profit for every unit (hour) added to carpentry from 240 up to 300 hours. Outside of the limit of 200 to 300 hours, dual price will not be relevant.

    Practice Solution 1

    Recall that total carpentry hours is 240 hours, soif we had an additional 25 hours, we now have265 hours of total carpentry hours. This is stillwithin the range of optimality: 200 to 300 hrs forcarpentry,

    The dual price for carpentry was recorded to be$15. So to obtain the profit, we multiply $15 byeach hour added to current value (i.e. total 25hrs), so we obtain additional $375. So we addthis to $4100 to obtain a total profit of $4475.

    END OF LECTURE

    Download tutorial assignment for solvinglinear programming problems.

    Read Chapter 7 (Linear programming) focus on problem formulations andsolutions as well as Chapter 8 of Renderet. al.