Mt1 Slides Full

download Mt1 Slides Full

of 119

Transcript of Mt1 Slides Full

  • 8/8/2019 Mt1 Slides Full

    1/119

    IE 400 - Principles of Engineering Management

    Thanks to Niyazi Onur Bakr for the Slides

    Fall 2010

    http://find/
  • 8/8/2019 Mt1 Slides Full

    2/119

    Assumptions in LP problems

    Three major assumptions are:1 Proportionality and additivity The contribution of each

    decision variable to the objective function or to eachconstraint is proportional to the value of that variable. Thecontribution from decision variables are independent from one

    another and the total contribution is the sum of the individualcontributions.

    2 Divisibility Each decision variable is allowed to take fractionalvalues.

    3 Certainty All input parameters (coefficients of the objectivefunction and of the constraints) are known with certainty.

    Other mathematical programming models may constructedrelaxing one or more of the assumptions above at the expense of

    loosing tractability.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    3/119

    Modeling Examples

    Transportation Problem There are two power plants generating

    electricity and three factories that need electricity in theirproduction.

    PP1

    PP2

    F1

    F2

    F3

    1000MWa+s

    2000MWa+s

    Capacity

    1500MWa+s

    750MWa+s

    750MWa+s

    Demand

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    4/119

    Modeling Examples

    Transmission costs per MWatt

    F1 F2 F3PP1 50 100 60PP2 30 20 35

    How should we satisfy the demand of each factory from the twopower plants with minimum total cost?

    The unknown values are the amount of electricity supplied fromeach power plant to each factory.

    Let xij denote the (unknown) # of MWatts of electricitytransmitted from PPi to Fj, i = 1, 2; j = 1, 2, 3.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    5/119

    Modeling Examples

    Then the problem can be formulated as:

    min 50x11 + 100x12 + 60x13 + 30x21 + 20x22 + 35x23s.t.Demand constraints

    x11 + x21 = 1500x12 + x22 = 750x13 + x23 = 750

    Capacity constraints

    x11 + x12 + x13 1000x21 + x22 + x23 2000

    andxij 0, i = 1, 2;j = 1, 2, 3.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    6/119

    Modeling Examples

    Short-term Investment Planning You have 10, 000 TL at thebeginning of 2008 and would like to invest your money. Your goalis to maximize your total amount of money at the beginning of

    2011. You have the following options:

    Option Duration (yrs) Total interest rate Available at the beginning of

    1 2 26% 2008, 20092 1 12% 2008, 2009, 2010

    3 3 38% 20084 2 27% 2009

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    7/119

    Modeling Examples

    2008 2009 2010 2011

    Let xt denote the total amount of money available forreinvestment at the beginning of year t, t = 0, 1, 2, 3.

    Let yit denote the amount of money invested in option i at thebeginning of year t, i = 1, 2, 3, 4, t = 0, 1, 2, 3.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    8/119

    Modeling Examples

    With this information, the problem can be formulated as:

    max x3s.t.

    x0 = 10, 000,

    x0 = y10 + y20 + y30,x1 = 1.12y20,x1 = y11 + y21 + y41,x2 = 1.26y10 + 1.12y21,x2 = y22,x3 = 1.38y30 + 1.26y21 + 1.27y41 + 1.12y22

    x0, x1, x2, x3 0

    y10, y20, y30, y11, y21, y41, y22 0

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    9/119

    Modeling Examples

    Blending Problem XYZ oil company produces three types ofgasoline by blending three types of crude oil:

    Gas Sales price per barrel Crude oil Purchase price per barrel

    1 70 1 45

    2 60 2 353 50 3 25

    The company can purchase up to 5000 barrels of each type ofcrude oil daily. The production requirements are,

    Gas Octane rating Sulfur content

    1 at least 10 at most 1%2 at least 8 at most 2%3 at least 6 at most 1%

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    10/119

    Modeling Examples

    Crude oil specifications:

    Crude oil Octane rating Sulfur content

    1 12 0.5%2 6 2.0%3 8 3.0%

    It costs $4 to transform one barrel of crude oil into one barrel ofgasoline.

    The company can process up to 14, 000 barrels of crude oil daily.

    The company has to meet the daily demand as well:

    Gas Demand (barrels)

    1 40002 50003 3000

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    11/119

    Modeling Examples

    How can the company maximize total profit while satisfyingdemand and production requirements?

    The decision variables are xij : # of barrels of crude oil i used daily

    to produce gas j, i = 1, 2, 3, j = 1, 2, 3.The objective function is more complicated than in previousexamples. The objective function has 3 pieces. First, sales,

    Sales = 70(x11 + x21 + x31) + 60(x12 + x22 + x32)

    +50(x13 + x23 + x33)

    Purchase cost = 45(x11 + x12 + x13) + 35(x21 + x22 + x23)+25(x31 + x32 + x33)

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    12/119

    Modeling Examples

    Process cost = 4(x11 + x12 + x13 + x21 + x22 + x23 + x31 + x32 + x33)

    Hence the objective is:

    max 70(x11 + x21 + x31) + 60(x12 + x22 + x32)

    +50(x13 + x23 + x33) 45(x11 + x12 + x13)35(x21 + x22 + x23) 25(x31 + x32 + x33)4(x11 + x12 + x13 + x21 + x22 + x23 + x31 + x32 + x33)

    s.t.

    Demand constraintsx11 + x21 + x31 = 4000,x12 + x22 + x32 = 5000,x13 + x23 + x33 = 3000,

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    13/119

    Modeling Examples

    Purchase constraints

    x11 + x12 + x13 5000,x21 + x22 + x23 5000,x31 + x32 + x33 5000,

    Capacity constraint

    x11 + x12 + x13 + x21 + x22 + x23 + x31 + x32 + x33 14, 000

    Octane requirements

    Gas 1 12x11+6x21+8x31x11+x21+x31

    10 =

    12x11 + 6x21 + 8x31 10(x11 + x21 + x31) 0

    2x11 4x21 2x31 0

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    14/119

    Modeling Examples

    Octane requirements (continued)

    Gas 2 12x12 + 6x22 + 8x32 8(x12 + x22 + x31)

    = 4x12 2x22 0

    Gas 3 12x13 + 6x23 + 8x33 6(x13 + x23 + x33)

    = 6x13 + 2x33 0

    Sulfur requirements

    Gas 1 0.005x11 + 0.02x21 + 0.03x31 0.01(x11 + x21 + x31)

    = 0.005x11 + 0.01x21 + 0.02x31 0,

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    15/119

    Modeling Examples

    Sulfur requirements (continued)

    Gas 2 0.005x12 + 0.02x22 + 0.03x32 0.02(x12 + x22 + x32)= 0.015x12 + 0.01x32 0,

    Gas 3 0.005x13 + 0.02x23 + 0.03x33 0.01(x13 + x23 + x33)

    = 0.005x13 + 0.01x23 + 0.02x33 0

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    16/119

    Modeling Examples

    Ex 5: Suppose that milk chocolate is produced with threeingredients. One kg. of milk chocolate contains 0.5 kg. of milk,0.4 kg of cocoa, and 0.1 kg of sweetener. Each of these threeingredients needs to be processed before they can be used in theproduction of milk chocolate. The facility has two departmentsthat can process these ingredients. The following table summarizes

    the processing requirements.

    Dept. 1 (hrs./kg.) Dept. 2 (hrs./kg.)

    Milk 0.4 0.6Cocoa 0.3 0.2Sweetener 0.5 0.6

    The available # of hours per week is 150 for each department.Formulate an LP problem that maximizes the total # of kg.s ofmilk chocolate produced in a week.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    17/119

    Modeling Examples

    Let xij denote the # of kg.s of ingredient i processed indepartment j, i = 1 (milk), 2 (cocoa), 3 (sweetener), j = 1, 2.

    Furthermore, let y : # of kg.s of milk chocolate produced in aweek. y satisfies:

    y = min {x11+x120.5

    , x21+x220.4

    , x31+x320.1

    }

    What is the problem here?

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    18/119

    Modeling Examples

    We need to maximize y, but we cannot use the equality providedin the previous slide.The equation is nonlinear! .

    We could apply the common modeling trick below:

    max y

    s.t.

    y x11+x120.5

    y x21+x220.

    4

    y x31+x320.1

    What other constraints do we have?

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    19/119

    Modeling Examples

    We also have the following constraints:

    Dept. 1 0.4x11 + 0.3x21 + 0.5x31 150

    Dept. 2 0.6x12 + 0.2x22 + 0.6x32 150

    xij 0 i = 1, 2, 3 j = 1, 2

    With this example completed, we are now in a position to startthinking about solution methodologies. The simplex method is themost popular and oldest approach to solve linear programs.However, before we start discussing the simplex method, we take alook at simpler linear programs that include only two variables andcan be solved graphically.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    20/119

    Graphical Solution of 2-variable LP Problems

    Consider the following LP:

    max 3x1 + 2x2

    s.t.

    2x1 + x2 100

    x1 + x2 80

    x1 40

    x1

    0

    x2 0

    How do we solve this?

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    21/119

    Graphical Solution of 2-variable LP Problems

    The solution can be obtained very easily drawing the plot below:

    Figure: Graphical solution

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    22/119

    Graphical Solution of 2-variable LP Problems

    Consider the following linear

    program,

    min 50x1 + 100x2

    s.t.

    7x1 + 2x2 282x1 + 12x2 24

    x1, x2 0

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    23/119

    Graphical Solution of 2-variable LP Problems

    Now consider yet another problem,

    max x1 + 3x2

    s.t.

    x1 + x2 7x1 + 2x2 8

    x1 4

    x1 0

    x2 0

    The graphical solution to this problem is provided in the classroom,but here is some discussion on how you could obtain the solution.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    24/119

    Graphical Solution of 2-variable LP Problems

    First, consider the coefficients of x1 and x2 in the objectivefunction: 1 and 3, respectively. Now let:

    c =

    13

    Note that as we move the isoprofit line in the direction of c, thetotal profit increases.

    For a maximization problem, the vector given by the coefficients of

    x1 and x2 in the objective function is called the improving direction.To solve an LP problem in two variables, we should try to pushisoprofit lines in the improving direction as much as possible whilestill staying in the feasible region.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    25/119

    Graphical Solution of 2-variable LP Problems

    In this example, the best feasible point we can achieve in this

    direction is x

    (refer to the class notes). Note that x

    is given bythe intersection of the lines:

    x1 + x2 = 7

    1/2x1 + x2 = 4

    Solving this mini-system of linear equalities, we obtain:

    x =

    25

    as the optimal solution! Then, the maximum achievable profit isgiven by:

    x1 + 3x

    2 = 2 + 3 (5) = 17 TL

    In other words, the optimal value of the LP problem is 17.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    26/119

    General Concepts in LP

    Some properties and attributes of the feasible region are alsoimportant in the later stages of this course where we startdiscussing how to solve LPs involving more than 2 decisionvariables.

    A set of points S is a convex set if the line segment joining anypair of points in S is wholly contained in S.

    For any convex set S, a point P in S is an extreme point if eachline segment that lies completely in S and contains the point P

    has P as an endpoint of the line segment. Extreme points aresometimes called corner points, because if the set S is a polygon,the extreme points of S will be the vertices, or corners of thepolygon.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    27/119

    Graphical Solution of 2-variable LP Problems

    A company wishes to increase demand for its product throughadvertising. Each minute of radio ad costs 1 units and each minuteof TV ad costs 2 units. Each minute of radio ad increases the daily

    demand by 2 units and each minute of TV ad by 7 units. Thecompany would wish to place at least 9 minutes of daily ad intotal. It wishes to increase daily demand by at least 28 units. Howcan the company meet its advertising requirements at minimumtotal cost?

    What are the decision variables?

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    28/119

    Graphical Solution of 2-variable LP Problems

    x1 : # of minutes of radio ads purchased.x2 : # of minutes of TV ads purchased.

    The problem can be formulated as follows:

    min x1 + 2x2s.t.

    2x1 + 7x2 28x1 + x2 9

    x1 0, x2 0

    The geometric solution is provided in the classroom.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    29/119

    Graphical Solution of 2-variable LP problems

    Note that the vector given by the coefficients of decision variablesin the objective function is

    c =

    12

    Note that the total cost increases in this direction. Since we havea minimization problem, this is, hence, not the direction that wewant to move. We should move in the opposite direction, i.e. inthe direction of

    c = 1

    2

    In other words, for a minimization problem, we go in the oppositedirection of c (i.e. in the direction of c as much as possible whilestill remaining in the feasible region.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    30/119

    Graphical Solution of 2-variable LP problems

    The optimal solution is given by the intersection of the followingtwo lines:

    2x1 + 7x2 = 28

    x1 + x2 = 9

    Solving for the system of two equations, we obtain x1 = 7 andx2 = 2. Hence, the optimal solution is

    x = 7

    2

    The optimal value is 7 + 2(2) = 11. Therefore, the total minimumcost is 11 units. Also, note that both constraints are binding at theoptimum.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    31/119

    Graphical Solution of 2-variable LP Problems

    Alternate or multiple optimal solutions Suppose in the previousexample that it costs 4 units to place a minute of radio ad and 14units to place a minute of TV ad. Then the formulation could bemodified as:

    min 4x1 + 14x2

    s.t.2x1 + 7x2 28x1 + x2 9x1 0, x2 0

    Again, the graphical solution is provided in the classroom. Afterplotting the objective function as well as the constraints, one couldreadily see that any feasible point on the line segment betweenpoints A = (x1, x2) = (7, 2) and B = (x1, x2) = (14, 0) is anoptimal solution with the same optimal value.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    32/119

    Graphical Solution of 2-variable LP Problems

    At point A, 4(7) + 14(2) = 56

    At point B, 4(14) + 14(0) = 56

    The optimal value is 56. This is also true for any feasible pointbetween A & B. In this case, we say that LP has multiple oralternate optimal solutions.

    Mathematically speaking, we could represent the set of optimumpoints as the convex combination of A & B, or the line segment[A,B]

    {

    72

    + (1 )

    140

    : [0, 1]}

    G h l S l f bl LP bl

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    33/119

    Graphical Solution of 2-variable LP problems

    Alternative or Multiple Optimal Solutions An auto companymanufactures cars and trucks. Each vehicle must be processed inthe paint shop and body assembly shop. If the paint shop wereonly painting trucks, 40 per day could be painted. If the paint shop

    were only painting cars, 60 per day could be painted. If the bodyshop were only producing cars, it could process 50 per day. If thebody shop were only producing trucks, it could process 50 per day.Each truck contributes $300 to profit, and each car contributes$200 to profit. Use linear programming to determine dailyproduction schedule that will maximize the companys profits.

    Decision variables?

    G hi l S l i f 2 i bl LP bl

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    34/119

    Graphical Solution of 2-variable LP problems

    The company must decide how many cars and trucks should beproduced daily.

    x1 : # of trucks produced daily.x2 : # of cars produced daily.

    The company maximizes profits. In hundreds of dollars, theobjective function can be written as 3x1 + 2x2.

    There are two constraints based on the capacity of the paint andbody shops. For both departments, the fraction of day allocated to

    truck and car production must not exceed 1. Hence the constraintsare:

    1

    40x1 +

    1

    60x2 1

    1

    50x1 +

    1

    50x2 1

    G hi l S l i f 2 i bl LP bl

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    35/119

    Graphical Solution of 2-variable LP problems

    Clearly, the LP problem is:

    max 3x1 + 2x2

    s.t.1

    40x1 +1

    60x2 11

    50x1 +

    1

    50x2 1

    x1 0, x2 0

    The plot of the objective function and the feasible region shouldreveal the fact that the objective function has the same slope withone of the constraints, and it intersects an entire line segmentcorresponding to the binding constraint.

    G hi l S l ti f 2 i bl LP P bl

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    36/119

    Graphical Solution of 2-variable LP Problems

    Unboundedness Consider the following LP problem,

    max x1 + 3x2s.t.

    x1 + 2x2 8x1 0, x2 0

    After plotting the feasible region, one can observe that theobjective function can be increased by the moving in the improvingdirection c as much as we want while still staying in the feasibleregion. In this case, we say that the LP is unbounded.

    For unbounded LP max problems, there is no optimal solution andthe optimal value is defined to be +. For a min problem, we saythat the LP is unbounded if we can decrease the objective functionas much as we want while staying in the feasible region. In this

    case, the optimal value is .

    G hi l S l ti f 2 i bl LP bl

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    37/119

    Graphical Solution of 2-variable LP problems

    Unboundedness Another example of an unbounded feasible regionis as follows:

    max 2x1 x2

    s.t.x1 x2 1

    2x1 + x2 6x1 0, x2 0

    Again, after shifting the plot of the objective function in thefeasible region, one can observe that the objective function can beshifted to assume arbitrarily large values.

    Graphical Solution of 2 variable LP Problems

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    38/119

    Graphical Solution of 2-variable LP Problems

    Infeasible LP problems Consider the following LP

    max x1 + 3x2s.t.

    x1 + x2 6x1 + 2x2 8

    x2 6x1 0, x2 0

    After plotting the constraints, one can readily observe that afeasible region does not exist. We say that the LP problem isinfeasible.

    Graphical Solution of 2 variable LP Problems

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    39/119

    Graphical Solution of 2-variable LP Problems

    Infeasible LP problems Suppose in the previous auto manufacturingexample that auto dealers require that the auto company produceat least 30 trucks and 20 cars. The the problem becomes,

    max 3x1 + 2x2

    s.t. 140

    x1 +1

    60x2 1

    1

    50x1 +

    1

    50x2 1

    x1 30

    x2 20

    x1 0, x2 0

    Graphical Solution of 2 variable LP variables

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    40/119

    Graphical Solution of 2-variable LP variables

    The plot should immediately warn us of an infeasible problem. Wecould also recognize that there is an infeasible solution by

    immediately checking the paint shop constraint at the pointx1 = 30 and x2 = 20.

    LP is infeasible because producing 30 trucks and 20 cars requiresmore paint shop time than is available.

    General Characterization of LP Problems

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    41/119

    General Characterization of LP Problems

    Every LP problem falls into one of the four cases:

    Case 1 The LP problem has a unique optimal solution.

    Case 2 The LP problem has alternative or multiple optimalsolutions. In this case, there are infinitely many optimal solutions.

    Case 3 The LP problem is unbounded. There is no optimalsolution in this case.

    Case 4 The LP problem is infeasible. There is no feasible solution.

    Summary So Far

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    42/119

    Summary So Far

    So far, we have seen the solution of LP problems with only twodecision variables.

    Such problems can easily be solved graphically.

    However, many LP problems include more than two variables. Howcan we solve them?

    We will learn how to solve more complex linear programs using thesimplex method. Simplex method is a solution algorithm that

    searches for the optimal solution checking the extreme points ofthe feasible region iteratively.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    43/119

    The Simplex Method

    Last time, we began to solve linear programs using the graphical

    method. During our discussion, we observed that the optimalsolution, if it exists, is either an extreme point or a linearcombination of two extreme points. This characteristic of LPproblems provide some analytical convenience in solving morecomplex LP problems involving more than 2 decision variables.

    Simplex method is the first method, invented in late 1940s toexploit this characteristic of LP problems. Simplex method can beused to solve very large LPs, involving thousands of constraintsand variables.

    So far, we have seen simple LP problems with both equality andinequality constraints. The decision variables were allowed to takenonnegative values. However, in general, LP problems can alsohave variables that are required to be nonpositive or those allowed

    to be unrestricted in sign.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    44/119

    The Simplex Method

    To use the simplex method, we need to convert the problem first

    into the standard form. To convert an LP problem into thestandard form, each inequality constraint must be replaced by anequality constraint.

    We will illustrate the simplex method step by step, using the

    example below,max 5x1 + 4x2 + 3x3

    s.t.

    2x1 + 3x2 + x3 54x1 + x2 + 2x3 11

    3x1 + 4x2 + 2x3 8

    x1, x2, x3 0

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    45/119

    The Simplex Method

    To convert this problem into its standard form, we need to define

    slack variables. For each inequality constraint, we define a slackvariable, as follows:

    s1 = 5 2x1 3x2 x3

    s2 = 11

    4x1

    x2

    2x3

    s3 = 8 3x1 4x2 2x3

    Clearly, each slack variable corresponds to the difference betweenthe right hand side (RHS) and the left hand side (LHS) of each of

    the first three constraints. This implies s1, s2, s3 0 for everyfeasible solution of the LP problem. In summary, if constraint i ofan LP is a constraint, we convert it to an equality constraintby adding a slack variable si to the i

    th constraint and adding thesign restriction si 0.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    46/119

    The Simplex Method

    Similarly, let us denote the objective function by:

    z = 5x1 + 4x2 + 3x3.

    After the necessary conversions, we obtain what we call Dictionary

    1:

    Row 0 z = 5x1 + 4x2 + 3x3Row 1 s1 = 5 2x1 3x2 x3Row 2 s2 = 11 4x1 x2 2x3Row 3 s3 = 8 3x1 4x2 2x3

    To begin with, we need an initial feasible solution. How could youobtain one?

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    47/119

    The Simplex Method

    A simple initial feasible solution can be obtained by setting theoriginal decision variables equal to 0. Hence, the first feasiblesolution is:

    x1 = 0, x2 = 0, x3 = 0,s1 = 5, s2 = 11, s3 = 8.

    The current value of the objective function is z = 0. Our goal is tolook for another feasible solution that yields a larger objectivefunction value (since this is a max. problem). To do so, weconsider increasing x1, x2 and x3 from their current values. This

    also increases the current z value.

    By looking at row 0 above, we the see that increasing x1 by 1increases z by 5. Similarly, increasing x2 by 1 and x3 by 1 increasez by 4 and 3 respectively.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    48/119

    p

    Ratio Test

    It makes sense to increase the value of x1 because it offers thehighest amount of increase in z per unit of perturbation. As weincrease x1, we keep x2 and x3 at their initial values of 0. In doingso, we need to pay attention to the constraints as well. We cannotperturb x1 in violation of the constraints. So the question is: Howmuch can we increase x1?

    The new solution will still be feasible as long as each of the originaland slack variables is still non-negative. Now, going back to thefirst dictionary,

    s1 = 5 2x1 3x2 x3 = 5 2x1 0 = x1 5/2

    s2 = 11 4x1 x2 2x3 = 11 4x1 0 = x1 11/4

    s3 = 8 3x1 4x2 2x3 = 8 3x1 0 = x1 8/3.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    49/119

    p

    Of the three bounds, the first one is the most restrictive.Therefore, we can increase the value of x1 up to 5/2 while keepingx2 and x3 at 0 to ensure feasibility. Now, we obtain a new feasiblesolution at x1 = 5/2. The second feasible solution is:

    x1= 5/2,

    x2= 0,

    x3= 0,s1 = 0, s2 = 1, s3 = 1/2.

    And the current value of the objective function is:

    z = 5 (52

    ) + 4 (0) + 3 (0) = 252.

    Note that the second feasible solution has indeed a larger objectivefunction value than the first feasible solution.

    However, our search for the optimal solution is probably not over!

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    50/119

    p

    Now, we shall look for an even better solution than the secondfeasible solution. Note that, in Dictionary 1, each of the variablesx1, x2 and x3 was on the RHS and had a value of 0. As such, thesame was true for the objective function.

    This enabled us to quickly identify which variables should beincreased from their current value of zero to obtain the largestincrease in the objective function value.

    To do the same, we shall rearrange dictionary 1, so that only thevariables which are 0 in the second feasible solution will be on theRHS. In feasible solution #2, x2 = 0, x3 = 0 and s1 = 0.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    51/119

    p

    In row 1 of dictionary 1, s1 should move from the LHS to the RHSand x1 should move from the RHS to the LHS. Mathematicallyspeaking,

    s1 = 5 2x1 3x2 x3

    becomes

    x1 = 5/2 3/2x2 1/2x3 1/2s1 (1)

    The same should be repeated for other rows as well. Note that, s2

    and s3 are still in the LHS and they should remain so. But x1should no longer be on the RHS of rows 2 and 3. To this end, wecould substitute (??) in rows 2 and 3 of dictionary #1. In the end,only x2, x3 and s1 will appear on the LHS of rows 2 and 3.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    52/119

    Substituting,

    s2 = 11 4x1 x2 2x3

    = 11 4(5

    2

    3

    2x2

    1

    2x3

    1

    2s1) x2 2x3

    = 1 + 5x2 + 2s1

    and

    s3 = 8 3x1 4x2 2x3

    = 8 3(5

    2 3

    2 x2

    1

    2 x3

    1

    2 s1) 4x2 2x3

    =1

    2+

    1

    2x2

    1

    2x3 +

    3

    2s1

    We do the same for row 0 as well.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    53/119

    As a result,

    z = 5x1 + 4x2 + 3x3

    = 5(5

    2

    3

    2x2

    1

    2x3

    1

    2s1) + 4x2 + 3x3

    =25

    2

    7

    2

    x2 +1

    2

    x3 5

    2

    s1.

    We are now ready to form the new dictionary (Dictionary #2):

    Row 0 z = 252

    7

    2x2 +

    1

    2x3

    5

    2s1

    Row 1 x1 =5

    2

    3

    2x2

    1

    2x3

    1

    2s1

    Row 2 s2 = 1 + 5x2 + 2s1

    Row 3 s3 =1

    2+ 1

    2x2

    1

    2x3 +

    3

    2s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    54/119

    Recall feasible solution #2:

    x1 = 5/2, x2 = 0, x3 = 0, s1 = 0, s2 = 1, s3 = 1/2, z =25

    2.

    Observe that in dictionary #2, only variables with zero values areon the RHS of each of the four rows.

    By looking at row 0, we see that only increasing x3 from 0 yieldsan even larger objective function value. This is not the case for theother variables. As in the previous case, we first decide how muchx3 can be increased while keeping x2 and s1 at 0.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    55/119

    To see this,

    x1 =5

    2 3

    2x2

    1

    2x3

    1

    2s1 =

    5

    2 1

    2x3 0 = x3 5.

    s2 = 1 + 5x2 + 2s1 = 1 0 = No restriction!

    s3 =1

    2+ 1

    2x2

    1

    2x3 +

    3

    2s1 =

    1

    2 1

    2x3 0 = x3 1

    Note that row #2 imposes no restriction on how much x3 can beincreased. Clearly, the most restrictive bound is given by row 3. Itsays that you can increase x3 at most by 1 without violatingfeasibility. With this in mind, the third feasible solution is:

    x1 = 2, x2 = 0, x3 = 1,s1 = 0, s2 = 1, s3 = 0,

    with an objective function value of z = 252

    + 12

    x3 = 13. This is animprovement!

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    56/119

    We still need to continue because we can still observe an

    improvement. Note that, as we increased x3 to 1, we forced s3down to 0. This suggests that we need to interchange the roles ofs3 and x3, i.e.,

    s3 =1

    2+ 1

    2x2

    1

    2x3 +

    3

    2s1

    = x3 = 1 + x2 + 3s1 2s3. (2)

    Substituting (??) in rows 1, 2 and 0, we get:

    Row 1 = x1 =

    5

    2

    3

    2 x2

    1

    2 x3

    1

    2 s1

    =5

    2

    3

    2x2

    1

    2(1 + x2 + 3s1 2s3)

    1

    2s1

    x1 = 2 2x2 2s1 + s3.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    57/119

    Row 2 = s2 = 1 + 5x2 + 2s1 (x3 does not appear, hence no change!)

    Row 0 = z =25

    2

    7

    2x2 +

    1

    2x3

    5

    2s1

    =

    25

    2

    7

    2 x2 +

    1

    2 (1 + x2 + 3s1 2s3)

    5

    2 s1

    = 13 3x2 s1 s3.

    After all these arrangements, we end up with the followingdictionary (Dictionary #3):

    Row 0 z = 13 3x2 s1 s3Row 1 x1 = 2 2x2 2s1 + s3Row 2 s2 = 1 + 5x2 + 2s1Row 3 x3 = 1 + x2 + 3s1 2s3

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    58/119

    Now, with x2 = 0, s1 = 0 and s3 = 0 we have a feasible solutionthat yields an objective function value of 13. Checking row 0, weimmediately see that if we try to increase the values of any ofthese variables, we decrease the objective function value.

    Therefore, we can no longer increase the objective function valueamong all feasible solutions. Hence, the third feasible solutionobtained in this process is actually an optimal value, i.e.,

    x1 = 2, x

    2 = 0, x

    3 = 1,

    s1 = 0, s2 = 1, s3 = 0.

    Again, the optimal value z = 13.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    59/119

    In the previous example, we observe the following,

    With the exception of z, the variables that appear on the LHSof a dictionary are called basic variables. For example, indictionary #3, x1, s2, and x3 are basic variables.

    All other variables that appear on the RHS of a dictionary are

    called non-basic variables. Note that non-basic variablesnecessarily have a value of 0 in a feasible solutioncorresponding to a dictionary. For example, in dictionary #3,x2, s1, and s3 are non-basic variables and x2 = s1 = s3 = 0.

    Each of the three feasible solutions obtained above is called abasic feasible solution (bfs). Therefore, a bfs has the propertythat each non-basic variable has a value of 0. Moreover, twoconsecutive bfss share all but one basic variable, and as suchthey are called neighboring bfss.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    60/119

    The simplex method works only with bfss and ignores all other

    feasible solutions.

    Note that, a basic feasible solution corner point.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    61/119

    More formally, lets consider an LP with n variables in its standardform:

    max c1x1 + c2x2 + . . . + cnxn

    s.t.

    a11x1 +a12x2 +a1nxn = b1a21x1 +a22x2 +a2nxn = b2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    am1x1 +am2x2 +amnxn = bmx1, x2, xn 0

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    62/119

    Define,

    A =

    a11 a12 a1na21 a22 a2n. . . . . . . . . . . . . . . . . . .

    am1 am2 amn

    x =

    x1x2...

    xn

    b =

    b1b2...

    bm

    and,c =

    c1 c2 cn

    Then the problem in matrix notation can be stated as,

    max cx s.t. Ax = b, x 0

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    63/119

    In simplex algorithm, rather than exhaustively searching theentirety of the feasible region for an optimum, we limit ourselves tosolutions in which n m of the variables in Ax = b are equal tozero. A basic solution to Ax = b is obtained by setting n mvariables equal to 0 and solving for the values of remaining m

    variables. This assumes that setting n m variables equal to 0yields unique values for the remaining m variables, or, equivalently,the columns for the remaining m variables are linearly independent.

    Definition (6)

    Any basic solution to Ax = b in which all variables are nonnegativeis a basic feasible solution.Two bfss are neighbors if they sharem 1 of their basic variables.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    64/119

    Why are basic feasible solutions important? The reason is,

    Theorem (1)

    The feasible region for any linear programming problem is a convex

    set. Also, if an LP has an optimal solution, there must be an

    extreme point of the feasible region that is optimal.

    Theorem (2)

    For any LP, there is a unique extreme point of the LPs feasible

    region corresponding to each basic feasible solution. Also, there is

    at least one bfs corresponding to each extreme point of the feasibleregion.

    In short, the simplex method is initiated with a bfs and iterativelycontinues until no better bfs is found.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    65/119

    Consider the following linear program,

    max z = cx s.t. Ax = b, x 0

    where A is an m n matrix with rank m, where m n. Thesimplex algorithm is initiated by equalizing n m of the variablesto 0, and solve for the rest of the variables. The variables which

    are equalized directly to 0 are non-basic variables, while the restare basic variables. Let B and N denote the coefficients of basicvariables and non-basic variables in matrix A respectively. Then,the constraints Ax = b can be rewritten as BxB + NxN = b. SincexN = 0, then the initial basic feasible solution becomes

    xB = B1b. In other words, our basic solution corresponding tothis choice of basic variables (basis) is:

    x =

    B1b

    0

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    66/119

    Lets solve this simple linear program as an example,

    min z = x1 + x2 s.t. x1 + 2x2 4, x2 1, and x1, x2 0First we convert the problem to its standard form,

    min z = x1 + x2

    s.t. x1 + 2x2 + x3 = 4,

    x2 + x4 = 1,

    x1, x2, x3, x4 0

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    67/119

    So A matrix in this problem is,

    A = [a1, a2, a3, a4] =

    1 2 1 00 1 0 1

    We first consider the bfs corresponding to B = [a1 a2], whichimplies variables x1 and x2 are basic whereas x3 and x4 are

    non-basic. The current objective function value that correspondsto this bfs is,

    z0 = cBB1b = [1 1]

    1 20 1

    41

    = 3

    The values of x1 and x2 when we set x3 and x4 equal to 0 are,x1x2

    = b = B1b =

    1 20 1

    41

    =

    21

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    68/119

    We have computed the solution that pertains to the current bfs.The next step is to see whether this bfs is indeed the optimalsolution. To see this, we should convert the objective function toinclude only the non-basic variables and the current objectivefunction value. Hence, the required representation is,

    min 3 x3 + x4

    s.t. x3 2x4 + x1 = 2,

    x4 + x2 = 1,

    x1, x2, x3, x4 0

    This suggests that the objective function value can be furtherimproved by increasing x3. However, due the constraints, wecannot let x3 increase indefinitely. To avoid violating the firstcontraint, x3 is set to 2, which forces x1 to 0. In other words, x3becomes basic, and x1 becomes non-basic rendering B = [a2 a3]

    and objective function value 1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    69/119

    How does the simplex method find alternate optimal solutions?Consider the problem below:

    max z = 2x1 + 2x2

    s.t.

    x1 + x2 2x1 + x2 4

    x1, x2 0

    This problem has alternate optimal solutions as graphicallydepicted in the next slide. The optimal solution lies between thepoints x1 = (0, 2) and x

    2 = (1, 3).

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    70/119

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    71/119

    Lets resolve the LP problem using the simplex method. The firstdictionary is:

    Row 0 z = 2x1 + 2x2Row 1 s1 = 2 + x1 x2Row 2 s2 = 4 x1 x2

    Starting from our usual choice of a feasible solution, we set theoriginal decision variables to 0, and solve for slack variablesaccordingly. This yields:

    x1 = 0, x2 = 0,s1 = 2, s2 = 4.

    The objective function value becomes z = 0.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    72/119

    Our usual test for a max. problem suggests that we can improve

    this objective function value further by perturbing x2 in thepositive direction while keeping x1 = 0.

    s1 = 2 + x1 x2 = 2 x2 0 = x2 2

    s2 = 4 x1 x2 = 4 x2 0 = x2 4

    The most restrictive bound is x2 2. This means, we shouldinterchange the roles of x2 and s1 i.e., x2 becomes basic, and s1becomes non-basic. The new row 1 is:

    x2 = 2 + x1 s1

    And other rows are also obtained after rearrangement,

    s2 = 4 x1 (2 + x1 s1)s2 = 2 2x1 + s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    73/119

    z = 2x1 + 2(2 + x1 s1) = 4 2s1

    Now, we can form the second dictionary.

    Row 0 z = 4 2s1Row 1 x2 = 2 + x1 s1Row 2 s2 = 2 2x1 + s1

    The second feasible solution is x2 = 2, s2 = 2, x1 = 0, s1 = 0. Theobjective function value is (0) + 2(2) = 4. Feasible solution 2 is

    optimal since there is no nonbasic variable with a positivecoefficient on the RHS of row 0. However, note that,

    z = 4 + 0.x1 2s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    74/119

    x1 is currently 0 and it has a coefficient of 0 in row 0 of the lastdictionary. This implies that increasing x1 does not change the

    value of z. Let us try to increase x1 while keeping s1 = 0:

    x2 = 2 + x1 s1 = 2 + x1 0 = x1 2 (no restriction)

    s2 = 2 2x1 + s1 = 2 2x1 0 = x1 1

    Increasing x1 to 1 and forcing s2 down to 0, we have the followingrearrangement of the rows in the previous dictionary,

    x1 = 1 +1

    2s1

    1

    2s2

    x2 = 2 + (1 +1

    2s1

    1

    2s2) s1

    x2 = 3 1

    2s1

    1

    2s2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    75/119

    z = 4 2s1

    The third dictionary is:

    Row 0 z = 4 2s1

    Row 1x2

    = 3

    1

    2

    s1

    1

    2

    s2

    Row 2 x1 = 1 +1

    2s1

    1

    2s2

    The feasible solution described in this dictionary is x1 = 1, x2 = 3(basic variables), and s1 = s2 = 0 (nonbasic variables). Theobjective function value is still z = 4.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    76/119

    Note that we have found another bfs with the same optimal value.Therefore, we have alternate optimal solutions. Feasible solution 2and 3 are both optimal solutions along with any feasible solutionthat lies on the line segment joining them.

    In addition, Dictionary 2 or Dictionary 3 can be used to find otheroptimal solutions that are not necessarily bfss.

    Consider Dictionary 2 below:

    Row 0 z = 4 2s1Row 1 x2 = 2 + x1 s1Row 2 s2 = 2 2x1 + s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    77/119

    We know we can increase x1 from zero while keeping s1 = 0. Letx1 = . Since, we found earlier that x1 1, 0 1. Then,

    x2 = 2 + x1 s1 = 2 + (since s1 = 0)

    s2 = 2 2x1 + s1 = 2 2z = 4 2s1 = 4

    Since the objective function value is still 4, for any 0 1,

    x1 = , x2 = 2 + , s1 = 0 and s2 = 2 2is an optimal solution.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    78/119

    Another way to represent this solution is a linear combination ofvectors below:

    {(1 )

    0

    202

    +

    1

    300

    : [0, 1]}

    For instance, for =1

    2 , x1 =1

    2 , x2 =5

    2 , s1 = 0, and s2 = 1 is anoptimal solution.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    79/119

    Consider another problem with alternative optima. Recall the

    Dakota furniture example from the previous lecture. We make aslight change in the objective function and take a look at thefollowing modified problem,

    max z = 60x1 + 35x2 + 20x3

    s.t.8x1 + 6x2 + x3 48

    4x1 + 2x2 + 1.5x3 202x1 + 1.5x2 + 0.5x3 8

    x2 5x1, x2, x3 0

    As we will see, as a result of a slight change in the slope of theobjective function, we observe alternate optimal solutions.

    The Simplex Method

    The initial dictionary is

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    80/119

    The initial dictionary is,

    Row 0 z = 60x1 + 35x2 + 20x3Row 1 s1 = 48 8x1 6x2 x3Row 2 s2 = 20 4x1 2x2 1.5x3Row 3 s3 = 8 2x1 1.5x2 0.5x3Row 4 s4 = 5 x2

    x1 should enter the set of basic variables. Checking rows 1 to 3,

    Row 1 = 48 8x1 0 = x1 6

    Row 2 = 20 4x1 0 = x1 5

    Row 3 = 8 2x1 0 = x1 4

    Hence, x1 enters the set of basic variables and s3 leaves. Makingthe appropriate rearrangements,

    x1= 4 0 5

    s30 75

    x20 25

    x3

    The Simplex Method

    48 8(4 0 5 0 75 0 25 ) 6

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    81/119

    s1 = 48 8(4 0.5s3 0.75x2 0.25x3) 6x2 x3s1 = 16 + 4s3 + x3

    s2 = 20 4(4 0.5s3 0.75x2 0.25x3) 2x2 1.5x3s2 = 4 + 2s3 + x2 0.5x3

    s4 = 5 x2

    z = 60(4 0.5s3 0.75x2 0.25x3) + 35x2 + 20x3z = 240 30s3 10x2 + 5x3

    The resulting second dictionary is,

    Row 0 z = 240 30s3 10x2 + 5x3Row 1 s1 = 16 + 4s3 + x3Row 2 s2 = 4 + 2s3 + x2 0.5x3Row 3 x1 = 4 0.5s3 0.75x2 0.25x3Row 4 s4 = 5 x2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    82/119

    The current feasible solution is x1 = 4, x2 = 0, x3 = 0 ands1 = 16, s2 = 4, s3 = 0, s4 = 5. The positive coefficient in row 0suggests that x3 should become basic. In this iteration,non-negativity constraints for s2 and x1 should be checked,

    Row 2 = 4 0.5x3 0 = x3 8

    Row 3 = 4 0.25x3 0 = x3 16

    Hence, x3 becomes basic forcing s2 to become nonbasic. In thisiteration,

    x3 = 8 + 4s3 + 2x2 2s2,

    s1 = 16 + 4s3 + (8 + 4s3 + 2x2 2s2)s1 = 24 + 8s3 + 2x2 2s2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    83/119

    x1 = 4 0.5s3 0.75x2 0.25(8 + 4s3 + 2x2 2s2)x1 = 2 1.5s3 1.25x2 + 0.50s2

    z = 240 30s3 10x2 + 5(8 + 4s3 + 2x2 2s2)z = 280 10s3 10s2.

    And the new dictionary is,

    Row 0 z = 280 10s3 10s2Row 1 s1 = 24 + 8s3 + 2x2 2s2Row 2 x3 = 8 + 4s3 + 2x2 2s2Row 3 x1 = 2 1.5s3 1.25x2 + 0.5s2Row 4 s4 = 5 x2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    84/119

    The current feasible solution is x1 = 2, x2 = 0, x3 = 8 ands1 = 24, s2 = s3 = 0, s4 = 5. None of the coefficients in row 0 ispositive. Hence, the current solution is optimal. However, the onlyoriginal decision variable that remains nonbasic has a 0 coefficient

    in row 0. Therefore, introducing x2 to the set of basic variableswould not reduce the optimal value. This signals the existence ofalternate optimal solutions.

    If we wish to make x2 basic, we could increase x2 to at most2

    1.

    25 =8

    5 = 1.6 (check the non-negativity constraint for row 3). x1becomes non-basic.

    The Simplex Method

    After rearrangements for the rows we obtain the following

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    85/119

    After rearrangements for the rows, we obtain the followingdictionary,

    Row 0 z = 280 10s3 10s2Row 1 s1 = 27.2 + 5.6s3 1.6x1 1.2s2Row 2 x3 = 11.2 + 1.6s3 1.6x1 1.2s2Row 3 x2 = 1.6 1.2s3 0.8x1 + 0.4s2Row 4 s4 = 3.4 + 1.2s3 + 0.8x1 0.4s2

    This new dictionary describes another optimal solutionx1 = 0, x2 = 1.6, x3 = 11.2 and s1 = 27.2, s2 = s3 = 0, s4 = 3.4.This suggests alternate optimal solutions between the extreme

    points, 20

    8

    and

    01.6

    11.2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    86/119

    How does the simplex method detect an unbounded solution?Consider the problem below,

    max z = x1 + 2x2

    s.t.

    x1 + x2

    2

    x1, x2 0

    The graphical depiction, which is provided in the class, showsreadily that the feasible region and the solution is unbounded. Our

    goal is to see this in simplex method. The first dictionary is:Row 0 z = x1 + 2x2Row 1 s1 = 2 + x1 x2

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    87/119

    The first feasible solution is s1 = 2 (basic) and x1 = 0, x2 = 0

    (nonbasic), with an objective function value of z = 0. In thesecond iteration, we could increase x2 while keeping x1 at 0. Thebound on x2 in doing so is given by,

    s1 = 2 + x1 x2 = 2 x2 0 = x2 2.

    After rearranging rows,

    x2 = 2 + x1 s1

    z = x1 + 2(2 + x1 s1) = 4 + x1 s1

    The current dictionary is,

    Row 0 z = 4 + x1 2s1Row 1 x2 = 2 + x1 s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    88/119

    The feasible solution is x2 = 2, x1 = s1 = 0. Since the coefficient

    of x1 in row 0 is positive, we conclude that this solution is notoptimal. However, as we increase x1, x2 increases as well (checkrow 1).

    Hence, x1 can be increased indefinitely without violating the

    non-negative constraint for row 1. We still remain feasible.

    Then, by row 0, as x1 +, z +. The LP problem isunbounded. Note that we can use Dictionary 2 to obtain a feasiblesolution with any sufficiently large objective function value. To see

    this, let x1 = 0. Then,x2 = 2 + x1 s1 = 2 + ,

    z = 4 + x1 s1 = 4 + .

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    89/119

    For instance, we can easily compute a feasible solution with anobjective function value of 100, i.e.,

    z = 100 = 4 + = = 96, or

    x1 = = 96, x2 = 2 + = 98, s1 = 0.More generally,

    x1 = , x2 = 2 + , s1 = 0,

    is feasible for any 0 with objective function value z = 4 + .As +, z +.

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    90/119

    Another LP problem with an unbounded optimal solution is asfollows: Breadco Bakeries bakes two kinds of bread: french andsourdough. Each loaf of french bread can be sold for 36 cents, andeach loaf of sourdough bread for 30 cents. A loaf of french breadrequires 1 yeast packet and 6 oz of flour; sourdough requires 1yeast packet and 5 oz of flour. At present, Breadco has 5 yeastpackets and 10 oz of flour. Additional yeast packets can bepurchased at 3 cents each, and additional flour at 4 cents/oz.Formulate and solve an LP that can be used to maximize

    Breadcos profits.Decision variables?

    The Simplex Method

    b f l f f h b d b k d

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    91/119

    x1 : number of loaves of french bread baked

    x2 : number of loaves of sourdough bread baked

    x3 : number of yeast packets purchased

    x4 : number of ounces of flour purchased

    Breadcos profits can be represented as,

    z = 36x1 + 30x2 3x3 4x4

    There are two constraints, one associated with the availability of

    yeast, the other with the availability of flour. Those are,x1 + x2 x3 5

    6x1 + 5x2 x4 10

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    92/119

    The problem is,max z = 36x1 + 30x2 3x3 4x4

    s.t.x1 + x2 x3 5

    6x1 + 5x2 x4 10x1, x2, x3, x4 0

    The initial dictionary associated with this problem is,

    Row 0 z = 36x1 + 30x2 3x3 4x4Row 1 s1 = 5 x1 x2 + x3Row 2 s2 = 10 6x1 5x2 + x4

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    93/119

    Both x1 and x2 improve the objective function, but we choose tomake x1 basic first. From the non-negativity constraints imposedby rows 1 and 2, we conclude that x1 can be increased by at most10

    6. That pushes s2 out of the set of basic variables, and introduces

    x1 into that set. Then,

    x1 = 53 16s2 56x2 + 16x4

    s1 = 5 (5

    3 1

    6s2

    5

    6x2 +

    1

    6x4) x2 + x3

    s1 =10

    3+ 1

    6s2

    1

    6x2 + x3

    1

    6x4

    z = 36(

    5

    3

    1

    6s2

    5

    6x2 +

    1

    6x4) + 30x2 3x3 4x4z = 60 6s2 + 2x4 3x3

    The new dictionary is,

    The Simplex Method

    Row 0 z = 60 6s2 3x3 + 2x4

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    94/119

    Row 1 s1 = 103 + 16s2 16x2 + x3 16x4

    Row 2 x1 =5

    3 1

    6s2

    5

    6x2 +

    1

    6x4

    Next, x4 enters into the basis. After necessary rearrangements aremade, the following dictionary is obtained,

    Row 0 z = 100 4s2 2x2 + 9x3 12s1

    Row 1 x4 = 20 + s2 x2 + 6x3 6s1

    Row 2 x1 = 5 x2 + x3 s1

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    95/119

    The last dictionary does not describe an optimal solution either.The original decision variable x3 has a positive coefficient. Hence,it should be increased. Rows 1 and 2 do not impose any constraint

    on x3 because it has positive coefficients in those rows, too.

    This implies that the linear program is unbounded. The originaldecision variable x3 can be increased indefinitely to attain anyobjective function value.

    The Simplex Method

    The final problem for today is the minimization problem below

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    96/119

    The final problem for today is the minimization problem below,

    min z = 2x1 x2

    s.t.x1 + x2 2

    x1 + x2 4

    x1, x2 0

    The graphical description of the feasible region provided in theclassroom. To apply the simplex method, we have the firstdictionary as follows,

    Row 0 z = 2x1 x2Row 1 s1 = 2 + x1 x2Row 2 s2 = 4 x1 x2

    The Simplex Method

    The initial feasible solution is x1 = x2 = 0 and s1 = 2, s2 = 4. Wed i d h bj i f i l R 1

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    97/119

    need to increase x2 to decrease the objective function value. Row 1

    imposes the most restrictive constraint, x2 2. As such,

    x2 = 2 + x1 s1

    s2 = 4 x1 (2 + x1 s1) = 2 2x1 + s1

    z = 2x1 (2 + x1 s1) = 2 + x1 + s1

    The current dictionary is,

    Row 0 z = 2 + x1 + s1Row 1 x2 = 2 + x1 s1Row 2 s2 = 2 2x1 + s1

    We can no longer decrease z. This is the optimal solution(x1 = 0, x2 = 2 and s1 = 0, s2 = 2). The objective function value isz = 2.

    The Simplex Method: Two Phase (Stage)

    What if an initial feasible dictionary is not readily available?Stage I: Tr to find an initial feasible dictionar (bfs)

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    98/119

    Stage I: Try to find an initial feasible dictionary (bfs)

    Stage II: Starting with the bfs of Stage I, apply Simplex Methodtill optimality.max z = x1 x2 + x3

    s.t.

    2x1 x2 + 2x3 42x1 3x2 + x3 5

    x1 + x2 2x3 1

    x1, x2, x3 0

    If we define the slack variables s1, s2, and s3 associated with eachconstraint, and start with our usual feasible solution, then we endup with s1 = 4, s2 = 5, s3 = 1, x1 = x2 = x3 = 0. But slackvariables need to be non-negative as well. Therefore, thisdictionary does not yield a feasible solution.

    The Simplex Method: Two Phase (Stage)

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    99/119

    How should we initiate the simplex method with a feasiblesolution? We define an artificial variable a and modify theconstraints.

    2x1 x2 + 2x3 4 + a

    2x1 3x2 + x3 5 + ax1 + x2 2x3 1 + a

    x1, x2, x3, a 0

    Note that if we can get a feasible dictionary for the constraints

    above such that a = 0, then that gives us a feasible dictionary forthe original constraints.

    The Simplex Method: Two Phase (Stage)

    Therefore, we will try to minimize a. We define an auxiliary LP:

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    100/119

    , y y

    min a

    s.t.2x1 x2 + 2x3 a 4

    2x1 3x2 + x3 a 5

    x1 + x2 2x3 a 1

    x1, x2, x3, a 0

    Lets solve this problem. The initial dictionary is:

    Row 0 z = aRow 1 s1 = 4 + a 2x1 + x2 2x3Row 2 s2 = 5 + a 2x1 + 3x2 x3Row 3 s3 = 1 + a + x1 x2 + 2x3

    The Simplex Method: Two Phase (Stage)

    This dictionary is still infeasible since s1 = 4, s2 = 5 < 0 and

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    101/119

    This dictionary is still infeasible since s1 4, s2 5 < 0 and

    s3 = 1 < 0. But we now have the freedom to adjust the value ofa so that s1, s2, and s3 are all non-negative.

    In order to make s2 and s3 non-negative, we need to increase thevalue of a from 0. At the same time, our goal is to minimize a. In

    other words, the question is: What is the smallest value of a suchthat s1, s2 and s3 are all non-negative while keeping x1, x2, and x3at 0? We check the constraints imposed by the rows of the lastdictionary.

    s1 = 4 + a 0 = a 4 (i.e., no restriction)s2 = 5 + a 0 = a 5

    s3 = 1 + a 0 = a 1.

    The Simplex Method: Two Phase (Stage)

    Therefore, a = 5 is the smallest value to have non-negative s1, s2d If 5 th 9 0 d 4 A lt

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    102/119

    and s3. If a = 5, then s1 = 9, s2 = 0, and s3 = 4. As a result, s1,a, and s3 are basic and s3 becomes nonbasic.

    a = 5 + s2 + 2x1 3x2 + x3

    s1 = 4 + (5 + s2 + 2x1 3x2 + x3) 2x1 + x2 2x3

    s1 = 9 + s2 2x2 x3

    s3 = 1 + (5 + s2 + 2x1 3x2 + x3) + x1 x2 + 2x3s3 = 4 + s2 + 3x1 4x2 + 3x3

    z = a = 5 + s2 + 2x1 3x2 + x3. Then the current dictionary is:

    Row 0 z = 5 + s2 + 2x1 3x2 + x3Row 1 s1 = 9 + s2 2x2 x3Row 2 a = 5 + s2 + 2x1 3x2 + x3Row 3 s3 = 4 + s2 + 3x1 4x2 + 3x3

    The Simplex Method: Two Phase (Stage)

    Since we need to decrease the current objective function value, we

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    103/119

    j

    perturb x2 in the positive direction. Rows 1 to 3 imposeconstraints on this move.

    s1 = 9 2x2 0 = x2 4.5

    a = 5 3x2 0 = x2 5

    3

    s3 = 4 4x2 0 = x2 1

    The last constraint is the most restrictive one. x2 enters the basis,while s3 leaves it. We make the necessary rearrangements,

    x2 = 1 + 14s2 + 34x1 14s3 + 34x3

    s1 = 9 + s2 2(1 +1

    4s2 +

    3

    4x1

    1

    4s3 +

    3

    4x3) x3

    s1 = 7 +1

    2s2

    3

    2x1 +

    1

    2s3

    5

    2x3

    The Simplex Method: Two Phase (Stage)

    a = 5 + s2 + 2x1 3(1 +1

    4s2 +

    3

    4x1

    1

    4s3 +

    3

    4x3) + x3

    a = 2 + 1s21x1 +

    3s35x3

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    104/119

    a = 2 +4

    s2 4x1 + 4s3 4x3

    z = 5 + s2 + 2x1 3(1 +1

    4s2 +

    3

    4x1

    1

    4s3 +

    3

    4x3) + x3

    z = 2 + 14

    s2 1

    4x1 +

    3

    4s3

    5

    4x3

    The current dictionary is,

    Row 0 z = 2 + 14s2 14x1 + 34s3 54x3

    Row 1 s1 = 7 +1

    2s2

    3

    2x1 +

    1

    2s3

    5

    2x3

    Row 2 a = 2 + 14

    s2 14x1 +34

    s3 54x3

    Row 3 x2 = 1 +1

    4s2 +

    3

    4x1

    1

    4s3 +

    3

    4x3

    The Simplex Method: Two Phase (Stage)

    The current solution is, s1 = 7, a = 2, x2 = 1 (basic variables)whereas x1 = x3 = s2 = s3 = 0 (nonbasic variables). The objective

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    105/119

    1 3 2 3 ( ) j

    function value is z = 2. We could further increase x3 to decreasethe objective function further. Only the first two rows impose aconstraint on x3.

    s1 = 7 5

    2x3 0 = x3

    14

    5

    a = 2 54

    x3 0 = x3 85

    Rearranging rows,

    x3 =8

    5+ 1

    5s2

    1

    5x1 +

    3

    5s3

    4

    5a

    s1 = 7 + 12s2 32x1 + 12s3 52(85 + 15s2 15x1 + 35s3 45a)s1 = 3 x1 s3 + 2a

    x2 = 1 +1

    4s2 +

    3

    4x1

    1

    4s3 +

    3

    4(85

    + 15

    s2 1

    5x1 +

    3

    5s3

    4

    5a)

    x2 =11

    5+ 2

    5s2 +

    3

    5x1 +

    1

    5s3

    3

    5a

    The Simplex Method: Two Phase (Stage)

    z = 2 + 14

    s2 1

    4x1 +

    3

    4s3

    5

    4(85

    + 15

    s2 1

    5x1 +

    3

    5s3

    4

    5a) = a

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    106/119

    The associated dictionary is:Row 0 z = a

    Row 1 s1 = 3 x1 s3 + 2a

    Row 2 x3 =

    8

    5 +

    1

    5s2

    1

    5x1 +

    3

    5s3

    4

    5a

    Row 3 x2 =11

    5+ 2

    5s2 +

    3

    5x1 +

    1

    5s3

    3

    5a

    The basic variables assume valuess1 = 3,

    x3 =

    8

    5 ,x2 =

    11

    5 . Thenonbasic variables are x1, s2, s3, a. The objective function value isz = 0 for the auxiliary LP problem. Since a is left out of the basis,and the objective function value is 0, we can remove a from furtherconsideration.

    The Simplex Method: Two Phase (Stage)

    When we remove a we end up with a feasible dictionary for the

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    107/119

    When we remove a, we end up with a feasible dictionary for the

    original LP problem. Let us now consider the original objectivefunction.

    z = x1 x2 + x3

    But this objective function includes two variables that are basic inthe final dictionary of the auxiliary problem. However, row 0should be expressed in terms of non-basic variables. We use theexpressions in rows 2 and 3 to do so.

    z = x1 x2 + x3 = x1 (11

    5+ 3

    5x1 +

    2

    5s2 +

    1

    5s3)

    +(85

    15

    x1 +1

    5s2 +

    3

    5s3)

    = 35

    + 15

    x1 1

    5s2 +

    2

    5s3.

    The Simplex Method: Two Phase (Stage)

    This leads to the first feasible dictionary of the original problem,

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    108/119

    Row 0 z = 35

    15

    s2 + 15x1 +25

    s3

    Row 1 s1 = 3 x1 s3

    Row 2 x3 =8

    5+ 1

    5s2

    1

    5x1 +

    3

    5s3

    Row 3 x2 =11

    5+ 2

    5s2 +

    3

    5x1 +

    1

    5s3

    The basic variables are s1, x3 and x2. However, one could observethat the solution described by this dictionary is not optimal. Onecan pivot s3 into the basis and continue solving the problem.

    The Simplex Method: Two Phase (Stage)

    Artificial variables are also useful to detect infeasible problems.Consider the LP problem below

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    109/119

    Consider the LP problem below,

    max z = x1 + 3x2

    s.t.x1 + x2 6

    x1 + 2x2 8x2 6

    x1, x2 0

    One can observe that this problem is infeasible after plotting the

    constraints. If we wish to apply the simplex method, we seeimmediately that the last constraint causes a problem. You cannotdefine a slack variable and continue because the constraint is in form rather than form.

    The Simplex Method: Two Phase (Stage)

    First we transform the last constraint into

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    110/119

    First we transform the last constraint into .

    x2 6

    Then add slack and artificial variables to obtain the auxiliaryproblem as follows,

    min a

    s.t.x1 + x2 a + s1 = 6

    x1 + 2x2 a + s2 = 8

    x2 a + s3 = 6

    x1, x2, s1, s2, s3, a 0

    The Simplex Method: Two Phase (Stage)

    The initial dictionary for the auxiliary problem is,

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    111/119

    Row 0 z = aRow 1 s1 = 6 + a x1 x2Row 2 s2 = 8 + a + x1 2x2Row 3 s3 = 6 + a x2

    Since this solution is infeasible, we find the minimum value of athat would make this problem feasible. Checking each row,

    s1 = 6 + a 0 = a 6 (no restriction)

    s2 = 8 + a 0 = a 8 (no restriction)

    s3 = 6 + a 0 = a 6.

    Hence, a enters the basis with a value of 6 and s3 leaves the basis.Making the usual arrangements on the rows of the initial dictionary,

    The Simplex Method: Two Phase (Stage)

    Row 0 z = 6 + s3 x2Row 1 s1 = 12 + s3 x1 2x2

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    112/119

    Row 2 s2 = 14 + s3 + x1 3x2Row 3 a = 6 + s3 x2

    The current feasible solution is x1 = x2 = 0, whereass1 = 12, s2 = 14, s3 = 0, a = 6. We wish to reduce z to zero if

    possible (z = 6 at this point). x2 can be perturbed to reduce zfurther. Checking the rows above,

    s1 = 12 2x2 0 = x2 6

    s2 = 14 3x2 0 = x2 14

    3

    a = 6 x2 0 = x2 6

    Therefore, we increase x2 to14

    3. Making the necessary

    arrangements,

    The Simplex Method: Two Phase (Stage)

    Row 0 z = 43

    + 23

    s3 1

    3x1 +

    1

    3s2

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    113/119

    Row 1 s1 =8

    3+ 1

    3s3

    5

    3x1 +

    2

    3s2

    Row 2 x2 =14

    3+ 1

    3s3 +

    1

    3x1

    1

    3s2

    Row 3 a = 43

    + 23

    s3 1

    3x1 +

    1

    3s2

    This dictionary is not optimal either. With the current feasiblesolution of x1 = 0, x2 =

    14

    3, s1 =

    8

    3, s2 = 0, s3 = 0, a =

    4

    3, z = 4

    3.

    We realize that x1 could enter the basis here as well. Check rows 1and 3,

    s1 =8

    3 5

    3x1 0 = x1

    8

    5.

    The Simplex Method: Two Phase (Stage)

    a = 43

    13

    x1 0 = x1 4.

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    114/119

    Increasing x1 to85

    and making s1 nonbasic in the process, weobtain the dictionary,

    Row 0 z = 45

    + 35

    s3 +1

    5s1 +

    1

    5s2

    Row 1 x1 =8

    5+ 1

    5s3

    3

    5s1 +

    2

    5s2

    Row 2 x2 =26

    5+ 2

    5s3

    1

    5s1

    1

    5s2

    Row 3 a = 45

    + 35

    s3 +1

    5s1 +

    1

    5s2

    The Simplex Method: Two Phase (Stage)

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    115/119

    This final dictionary is optimal. All the coefficients on the RHS ofrow 0 are positive. This implies that the objective function value zfor the auxiliary problem cannot be reduced further from 4

    5.

    However, since a is an artificial variable, it has to be zero for

    feasibility. In this case, we say that the LP problem is infeasible.

    To confirm infeasibility, we could substitute the current solutioninto the original decision problem. Note that, x1 =

    8

    5, x2 =

    26

    5.

    Check the first constraint in the original problem (x1 + x2 6).

    Clearly, x

    1 + x

    2 =34

    5 6. The current solution is infeasible.

    The Simplex Method

    Here is a summary of the simplex method,

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    116/119

    If a feasible solution, a corner point (bfs) solution.If an optimal solution, a corner point (bfs) optimalsolution.

    In max. problems, the variable with the most positive coefficient

    enters the basis. Stop when all objective coefficients arenonpositive.

    In min. problems, the variable with the most negative coefficiententers the basis. Stop when all objective coefficients are

    nonpositive.

    Improvement in objective after a simplex iteration= |entering variable coefficient| x result of the ratio test

    The Simplex Method

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    117/119

    If the LP problem is unbounded, then an entering variable withno leaving variable, i.e., the result of the ratio test is .

    The simplex method detects alternative optima when at theoptimal dictionary the coefficient of a nonbasic variable is zero in

    the objective row and the result of the ratio test is > 0. Otherwisethe bfs does not change and is a unique optimum.

    An LP problem may also be infeasible. Simplex method detectsinfeasible LPs during the solution of the auxiliary problem. When

    the auxiliary LP is solved, a positive objective function value isobtained.

    The Fundamental Theorem of LP

    Consider the following LP problem:

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    118/119

    max c1x1 + c2x2 + . . . + cnxn

    s.t.

    a11x1 + a12x2 + + a1nxn b1a21x1 + a22x2 + + a2nxn b2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    am1x1 + am2x2 + + amnxn bm

    x1 0, . . . , xn 0

    Every LP problem in this form has the following properties:

    The Fundamental Theorem of LP

    http://find/http://goback/
  • 8/8/2019 Mt1 Slides Full

    119/119

    (a) If it has no optimal solution, then it is either infeasible orunbounded.

    (b) If it has a feasible solution, then it has a bfs

    (c) If it has an optimal solution, then it has a bfs as an optimalsolution.

    Simplex method can detect unboundedness. It can also detectinfeasibility when the optimal value of the auxiliary LP problem isgreater than 0. Otherwise, it generates dictionaries corresponding

    to bfss and finds a bfs as an optimal solution.

    http://find/http://goback/