chapter4 or

Upload: vishal-virmani

Post on 02-Apr-2018

242 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Chapter4 Or

    1/65

    Hillier and Lieberman

    Chapter 4

  • 7/27/2019 Chapter4 Or

    2/65

    The Essence of the Simplex

    It is an algebraic procedure

    Wyndor glass example

    Constraint boundaries, figure 4.1

  • 7/27/2019 Chapter4 Or

    3/65

    Wyndor Glass

    Maximize Z = 3X1 + 5X2

    Subject to:

    X1 42X2 12

    3X1 + 2X2 18

  • 7/27/2019 Chapter4 Or

    4/65

    Figure 4.1

    0, 6

    4,0

    4,3

    2, 6

    Corners: (0,0) (4,0) (4.3)

    (2,6) and (0,6)

  • 7/27/2019 Chapter4 Or

    5/65

    Corner Point Feasible Solutions

    Corner point feasible solutions (CPF solutions)

    occur at the intersections of the constraint

    boundaries, which are in the feasible region.

    The problem has 2 decision variables, so each

    corner occurs at the intersection of two constraints.

    The dimension of the problem determines the

    number of constraints that intersect at each corner.If there are, for example, 5 decision variables the

    corner points occur at the intersection of

    5 constraints.

  • 7/27/2019 Chapter4 Or

    6/65

    Adjacent feasible solutions

    For any linear programming model with n

    decision variables, two CPF solutions are

    adjacent to each other if they share n-1

    constraints. The two adjacent CPF solutions

    are connected by a line segment that lies

    on the same shared constraint boundaries.

    Such a constraint boundary is referred to asan edge of the feasible region.

  • 7/27/2019 Chapter4 Or

    7/65

    Figure 4.1

    0, 6

    4,0

    4,3

    2, 6

    0,0

    (0,0) and (0,6) adjacent

    (0,6) and (2,6) adjacent

    (2,6) and (4,3) adjacent

    (4,3) and (4,0) adjacent

    (4,0) and (0,0) adjacent

    There are 5 edges.

    From each CPF solution,

    2 edges emanate.

    Each CPF solution has 2

    adjacent solutions.

  • 7/27/2019 Chapter4 Or

    8/65

    Optimality test

    If a CPF solution has no adjacent CPF

    solution that is better (in terms of the value

    of the objective function) then it must be

    an optimal solution.

  • 7/27/2019 Chapter4 Or

    9/65

    Solving the example

    Initialization. Choose point (0,0) because

    it is convenient (no calculation needed to

    show it is feasible)

    Optimality test: Conclude that (0,0) is not

    optimal because adjacent CPF solutions

    are better

    Iteration 1: Move to a better CPF solution

  • 7/27/2019 Chapter4 Or

    10/65

    Simplex Iteration

    Consider the two edges that emanate from (0,0).Move up the X2 axis because X2 contributesmore to the objective function of Z = 3X1 + 5X2.

    Stop at the next constraint boundary, 2X2 = 12

    (or X2 = 6). This is point (0,6). You cant movefurther in this direction without leaving thefeasible region.

    Find the other adjacent CPF solution for this

    point (2,6) from the intersection of constraints.Optimality test: (0,6) is not optimal because

    (2,6) is better.

    Repeat steps. (2,6) is optimal solution.

  • 7/27/2019 Chapter4 Or

    11/65

    Solution Concepts

    Simplex focuses only on CPF solutions, a finiteset.

    It is an iterative procedure, meaning a fixed

    series of steps is repeated (an iteration) until adesired result is found.

    When possible, the initial CPF solution is theorigin because it is convenient. (Possible when

    all variables are non-negative.) If origin isinfeasible, special procedures are needed,described in section 4.6 of this chapter.

  • 7/27/2019 Chapter4 Or

    12/65

    Solution Concepts, Continued

    At each iteration, we always choose an adjacent

    CPF solution. Steps take place along the edges

    of the feasible region.

    To find the next CPF solution to test, thealgorithm computes the rate of improvement in

    that direction. A positive rate of improvement

    implies that the adjacent CPF solution is better

    than the current one. So we test whether any ofthe edges have a positive rate of improvement.

  • 7/27/2019 Chapter4 Or

    13/65

    Setting up the Simplex Method

    We convert the inequalities to equalities by use

    of slack variables (and artificial variables for

    GE constraints).

    Let X3 be a slack for the first constraint

    X1 4 becomes X1 + X3 = 4

    With X3 0

  • 7/27/2019 Chapter4 Or

    14/65

    Wyndor Glass: Augmented Form

    Maximize Z = 3X1 + 5X2

    Subject to:

    X1 + X3 = 42X2 +X4 = 12

    3X1 + 2X2 +X5 = 18

    all X variables non-negative

  • 7/27/2019 Chapter4 Or

    15/65

    Augmented Solution

    The augmented solution contains values for

    the decision variables AND values for the

    slacks. So if we augment the solution (3, 2)

    in this example by the values of the slacks weget (3, 2, 1, 8, 5).

    A basic solution is an augmented corner-point

    solution.

  • 7/27/2019 Chapter4 Or

    16/65

    Properties of a basic solution

    Each variable is either basic or non-basic

    The number of basic variables equals the number offunctional constraints.

    The number of non-basic variables equals the total

    number of variables minus the number of functionalconstraints.

    The non-basic variables are set equal to zero.

    The values of the basic variables are found by solving

    the simultaneous equation system. If the basic solution satisfies the non-negativity

    consideration, it is called a basic feasible solution.

  • 7/27/2019 Chapter4 Or

    17/65

    Example: BF Solution

    X1 + X3 = 4

    2X2 +X4 = 12

    3X1 + 2X2 +X5 = 18

    Set X1 and X4 = 0 (non-basic). From

    first constraint, X3 =4. From second

    constraint, X2 = 6. From third constraint,

    X5 =6.

    (0, 6, 4, 0, 6)

  • 7/27/2019 Chapter4 Or

    18/65

    Test for adjacent points

    Two BF solutions are adjacent if all but

    one of their non-basic variables are the same.

    All but one of the basic variables would correspond

    in the two points, but perhaps with differentvalues.

    Moving to an adjacent point means we swap one

    basic variable for a non-basic one. One variableenters; the other leaves.

  • 7/27/2019 Chapter4 Or

    19/65

    Algebra of the Simplex

    Initialization: X1 = 0 and X2 = 0

    Yields: X3 = 4, X4 = 12, and X5 = 18

    BFS (0, 0, 4, 12, 18)

    X1(0) + X3 = 4

    2X2(0) + X4 =12

    3X1(0) + 2X2(0) + X5 = 18

    Notice that the BFS can be read immediatelyfrom RHS. The simplex used a procedure

    (Gaussian elimination) to convert the equations

    to the same convenient form with each iteration.

  • 7/27/2019 Chapter4 Or

    20/65

    Geometric Algebraic

    Choose (0,0) as initialCPF solution.

    Optimality test: notoptimal because moving

    along either edgeincreases Z.

    Iteration 1, step 1: Moveup the edge lying on theX2 axis.

    Choose X1and X2 to benon-basic for initial BFS(0,0,4,12,18)

    Not optimal because

    increasing either non-basic variable increasesZ.

    Iteration 1, step 1:Increase X2 while

    adjusting other variablevalues to satisfy thesystem of equations.

  • 7/27/2019 Chapter4 Or

    21/65

  • 7/27/2019 Chapter4 Or

    22/65

    Geometric Algebraic

    Optimality test: Not

    optimal because moving

    along the edge from (0,6)

    to the right increases Z.

    Iteration 2: Move along

    the edge to the right and

    stop when the new

    constraint boundary is

    reached. Optimality test : (optimal)

    Optimality test: Not

    optimal because

    increasing one non-basic

    variable (X1) increases Z.

    Iteration 2: Increase X1,

    while adjusting other

    variables and stop when

    the first basic variable

    reaches 0. Optimality test: (optimal)

  • 7/27/2019 Chapter4 Or

    23/65

    Direction of Movement

    Z = 3X1 + 5X2

    If we increase X1 rate of improvement is 3.

    If we increase X2 rate of improvement is 5.Choose X2.

    X2 is the entering basic variable for iteration 1.

  • 7/27/2019 Chapter4 Or

    24/65

    Where to stop

    Increasing X2 increases Z. We want to go asfar as possible without leaving the feasible

    region.

    Check the constraints.X3 = 4 0 No upper bound on X2

    X4 = 122X2 0 X2 6 to keep X4 non-neg

    X5 = 182X2 0 X2 9 to keep X5 non-neg

    Thus, X2 can be increased to 6, at which point

    X4 drops to zero (non-basic). This is the

    minimum ratio test.

  • 7/27/2019 Chapter4 Or

    25/65

    Minimum Ratio Test

    The objective of the test is to determine which

    currently basic variable will drop to zero

    and become non-basic. We can rule out the

    basic variable in any equation where thecoefficient of the entering variable is zero

    or negative since such a basic feasible variable

    would not decrease as the entering variable

    increases.

  • 7/27/2019 Chapter4 Or

    26/65

    Our Pivot Using Matrix Algebra

    We found the largest entry in the Objective

    row (greatest increase in Z).

    The variable in that column was the

    entering variable.

    We did the minimum ratio test by dividing

    the RHS entries by the positive entries in

    the column. The current basic variable is

    determined by this equation.

  • 7/27/2019 Chapter4 Or

    27/65

    Solving for the new BFS

    Step 3 of the iteration is finding the new BFS.

    We know that X1=0, X2=6, and X4=0.

    We need to solve for X3 and X5.

    Z 3X1 5X2 = 0

    X1 +X3 =4

    2X2 + X4 = 123X1 +2X2 +X5 = 18

    Current coefficients on X4 are (0,0,1,0). We

    want to make this the pattern of coefficients for X2.

  • 7/27/2019 Chapter4 Or

    28/65

    Solving for new BF Solution, Continued

    To get the desired pattern of coefficients for

    X2, we use matrix algebra. Multiple or divide

    by a non-zero constant. Add or subtract

    multiples of one equation from another.

    The current coefficients on X2 are

    (-5,0,2,3) and we want them to be(0,0,1,0)

  • 7/27/2019 Chapter4 Or

    29/65

    Transformed Equations

    Z - 3X1 + 5/2X4 = 30

    X1 +X3 = 4

    X2 + X4 = 6

    3X1 - X4 + X5 = 6

    Since X1 = 0 and X4 = 0, the equations in

    this form give the BFS

    (0, 6, 4, 0, 6)

  • 7/27/2019 Chapter4 Or

    30/65

    Optimality test for new BF solution

    The current objective function gives thevalue of Z in terms of only the current

    nonbasic variables.

    Z = 30 + 3X1 5/2 X4

    If X1 increases, Z will increase.

    In iteration 2, we let X1 enter and find a

    variable to leave. Or minimum ratio testindicates X5 will leave. We repeat the algebraic

    manipulations to reproduce the pattern of coefficients

    for X5 (0,0,0,1) as the new coefficients of X1.

  • 7/27/2019 Chapter4 Or

    31/65

    Tabular form

    We have done the tabular form already

    It provides a summary of important

    information

    The simplex tableau is a compact display

    of the system of equations

  • 7/27/2019 Chapter4 Or

    32/65

    Simplex Tableau

    Z X1 X2 X3 X4 X5 RHS

    obj 1 -3 -5 0 0 0 0

    r1 0 1 0 1 0 0 4r2 0 0 2 0 1 0 12

    r3 0 3 2 0 0 1 18

    Optimality test: The current BFS is optimal ifevery coefficient in Obj row is non-negative.

    Otherwise pivot to obtain a new tableau.

  • 7/27/2019 Chapter4 Or

    33/65

    Pivots

    Z X1 X2 X3 X4 X5 RHS ratioobj 1 -3 -5 0 0 0 0

    r1 0 1 0 1 0 0 4 **

    r2 0 0 2 0 1 0 12 6

    r3 0 3 2 0 0 1 18 9

    Z X1 X2 X3 X4 X5 RHS

    obj 1 -3 0 0 2.5 0 30r1 0 1 0 1 0 0 4 4

    r2 0 0 1 0 0.5 0 6 **

    r3 0 3 0 0 -1 1 6 2

    Z X1 X2 X3 X4 X5 RHS

    obj 1 0 0 0 1.5 1 36

    r1 0 0 0 1 1/3 -1/3 4

    r2 0 0 1 0 0.5 0 6

    r3 0 1 0 0 -1/3 1/3 6

  • 7/27/2019 Chapter4 Or

    34/65

  • 7/27/2019 Chapter4 Or

    35/65

    Degeneracy

    If one of the degenerate basic variables (basic

    variables with a value of zero) retains its zero

    value until it is chosen at a subsequent iteration

    to be the leaving basic variable, thecorresponding entering variable will be stuck

    at zero since it cant be increased without making

    the degenerate leaving variable negative, so

    the value of Z wont change. Simplex maygo around in a loop, repeating the same sequence

    without advancing.

  • 7/27/2019 Chapter4 Or

    36/65

  • 7/27/2019 Chapter4 Or

    37/65

    Unbounded Z

    If Z is unbounded, there will be no candidate

    for the leaving basic variable.

    In these cases, the constraints dont keep thevalue of the objective function from increasing

    indefinitely.

  • 7/27/2019 Chapter4 Or

    38/65

    Multiple Optimal Solutions

    In this case, the objective function has thesame slope as one of the constraints.

    If we change the objective function for the

    Wyndor glass problem to:

    Z = 3X1 + 2X2

    The new objective function has the same

    coefficients as the third constraint. The simplex

    stops after one optimal solution is found.

  • 7/27/2019 Chapter4 Or

    39/65

    How to tell if there are more optimal

    solutions

    It may be desirable to identify other optimal

    solutions. Some programs tell you they exist.

    Whenever a problem has more than one optimalBFS, at least one of the non-basic variables

    will have a coefficient of zero in the final

    objective function. Other solutions can be

    found by pivoting and using the variable with thezero coefficient in the objective row as the

    entering variable.

  • 7/27/2019 Chapter4 Or

    40/65

    Multiple Optimal Solutions

    Z X1 X2 X3 X4 X5 RHS ratio

    obj 1 -3 -2 0 0 0 0

    r1 0 1 0 1 0 0 4 4

    r2 0 0 2 0 1 0 12 **

    r3 0 3 2 0 0 1 18 6

    Z X1 X2 X3 X4 X5 RHS

    obj 1 0 -2 3 0 0 12

    r1 0 1 0 1 0 0 4 4

    r2 0 0 2 0 1 0 12 **

    r3 0 0 2 -3 0 1 6 2

    Z X1 X2 X3 X4 X5 RHS

    obj 1 0 0 0 0 1 18

    r1 0 1 0 1 0 0 4 4

    r2 0 0 0 3 1 -1 6 2

    r3 0 0 1 -1.5 0 0.5 3 **

    Z X1 X2 X3 X4 X5 RHS

    obj 1 0 0 0 0 1 18

    r1 0 1 0 0 -1/3 1/3 2

    r2 0 0 0 1 1/3 -1/3 2

    r3 0 0 1 0 1/2 0 6

  • 7/27/2019 Chapter4 Or

    41/65

  • 7/27/2019 Chapter4 Or

    42/65

    An Equality Constraint

    As we saw in McCarl and Spreen an equality

    constraint is equivalent to two inequality

    constraints. Hillier and Lieberman provide

    another way to handle these constraints, withan artificial variable.

  • 7/27/2019 Chapter4 Or

    43/65

    Modified Problem

    Change the last constraint so that

    3X1 + 2X2 = 18

    Z - 3X1 5X2 = 0X1 + X3 = 4

    2X2 + X4 = 12

    3X1 + 2X2 = 18

    There is no obvious BFS because there is

    no slack in the third constraint.

  • 7/27/2019 Chapter4 Or

    44/65

    Figure 4.3

    4,3

    2, 6

    0

    The BFS is now a

    line between the two

    points.

  • 7/27/2019 Chapter4 Or

    45/65

    Use an artificial variable

    Z - 3X1 5X2 +MX5 = 0X1 + X3 = 4

    2X2 + X4 = 12

    3X1 + 2X2 + X5 = 18

    X5= 18 3x1 2X2

    The large M ensures that the artificial variablewill be driven to zero.

  • 7/27/2019 Chapter4 Or

    46/65

    Negative RHS

    To eliminate the negative value in theRHS, multiply through by -1. This operation

    reverses the sign of the equality.

    In doing simplex by hand, all RHS variablesmust be positive. Not required for computer

    algorithms.

  • 7/27/2019 Chapter4 Or

    47/65

    Functional Constraints as

    We introduce both a surplus variable andan artificial variable so that we can have

    a BFS. (We used this technique in solving

    our minimization problems earlier.)

    Here we will look at an alternative method to

    solving minimization problems, the two phase

    method.

  • 7/27/2019 Chapter4 Or

    48/65

    Minimization

    Minimize Z = jcjXj

    Same as

    Maximize -Z= j (-cj)Xj

  • 7/27/2019 Chapter4 Or

    49/65

    Radiation Example

    Minimize Z = 0.4X1 + 0.5X2 where X1and X2 represent doses of two beams

    0.3X1 + 0.1X2 2.7

    0.5X1 + 0.5X2 = 6 0.6X1 + 0.4X2 6

    2nd and 3rd constraint will require artificial

    variables.1st constraint takes a slack and third takes

    a surplus

  • 7/27/2019 Chapter4 Or

    50/65

    Problem

    -Z + 0.4X1 + 0.5X2 +MX4 + MX6

    0.3X1 + 0.1X2 +X3 = 27

    0.5X1 + 0.5X2 +X4 = 6

    0.6X1 + 0.4X2 -X5 + X6 = 6

    X3 is a slack variable

    X4 and X6 are artificial variablesX5 is a surplus variable

  • 7/27/2019 Chapter4 Or

    51/65

    Two-Phase Method

    Initialization: Add artificial variables to get

    an obvious initial solution for the artificial

    problem.

    The objective of this phase is to find a

    BFS to the real problem.

    We minimize the artificial problem.

  • 7/27/2019 Chapter4 Or

    52/65

    The artificial problem

    Minimize Z = X4 + X6

    0.3X1 + 0.1X2 +X3 = 27

    0.5X1 + 0.5X2 +X4 = 6

    0.6X1 + 0.4X2 -X5 + X6 = 6

  • 7/27/2019 Chapter4 Or

    53/65

    The Real Problem

    Minimize Z = 0.4X1 + 0.5X2

    0.3X1 + 0.1X2 +X3 = 27

    0.5X1 + 0.5X2 = 6

    0.6X1 + 0.4X2 -X5 = 6

  • 7/27/2019 Chapter4 Or

    54/65

  • 7/27/2019 Chapter4 Or

    55/65

    Phase 1: Obtain the starting objective

    Min Z = X4 + X6 becomes Max -Z = X4 X6

    Use elementary row operations to zero these out.

    (E.g. add or subtract multiples of the other rows

    until the coefficients on X4 and X6 are zero.

    That gives us

    Z -1.1X1 - 0.9X2 +X5 = -12

    We perform the usual simplex maximization and

    find a BFS (6,6,0,3,0,0,0)

  • 7/27/2019 Chapter4 Or

    56/65

    Z X1 X2 X3 X4 X5 X6

    -1 -1.1 -0.9 0 0 1 0 -12

    0 0.3 0.1 1 0 0 0 2.7

    0 0.5 0.5 0 1 0 0 6

    0 0.6 0.4 0 0 -1 1 6

    Z X1 X2 X3 X4 X5 X6

    -1 0 -16/30 11/3 0 1 0 -2.10 1 1/3 10/3 0 0 0 9

    0 0 1/3 -5/3 1 0 0 1.5

    0 0 1/5 -2 0 -1 1 0.6

    Z X1 X2 X3 X4 X5 X6

    -1 0 0 -5/3 0 -5/3 8/3 -0.5

    0 1 0 20/3 0 5/3 -5/3 8

    0 0 0 5/3 1 5/3 -5/3 0.5

    0 0 1 -10 0 5 5 3

    Z X1 X2 X3 X4 X5 X6

    -1 0 0 0 1 0 1 0

    0 1 0 0 -4 -5 5 6

    0 0 0 1 3/5 1 -1 0.3

    0 0 1 0 6 5 -5 6

    Phase 1

  • 7/27/2019 Chapter4 Or

    57/65

    Phase 2

    Start from the final tableau of phase 1

    Drop the artificial variables

    Substitute the phase 2 objective function

    Restore proper form by eliminating the

    basic variables X1 and X2 from the

    objective row (use row operations)

    Solve the phase 2 problem

  • 7/27/2019 Chapter4 Or

    58/65

    Phase 2

    Z X1 X2 X3 X5 RHS

    -1 0 0 0 -0.5 -5.4

    0 1 0 0 -5 6

    0 0 0 1 1 0.3

    0 0 1 0 5 6

    Z X1 X2 X3 X5

    -1 0 0 0.5 0 -5.25

    0 1 0 5 0 7.5

    0 0 0 1 1 0.3

    0 0 1 -5 0 4.5

    Optimal Solution: X1 = 7.5, X2 = 4.5, X3 (slack)=0,

    X5 (surplus) = 0.3

  • 7/27/2019 Chapter4 Or

    59/65

  • 7/27/2019 Chapter4 Or

    60/65

    Variables allowed to be negative

    Weve dealt with this in McCarl and Spreen.

    Two types, one is bounded, one unbounded.

    X1 -10 construct X1* = X1 + 10 and substitute

    X1 can take any value. X1 = X1(+) and X1(-)

    adds an extra column to the problem.

  • 7/27/2019 Chapter4 Or

    61/65

    Section 4.7 Post-Optimality Analysis

    Re-optimization

    Shadow prices (weve covered)

    Sensitivity analysis

    Parametric programming

  • 7/27/2019 Chapter4 Or

    62/65

    Re-optimization

    If we have found an optimal solution for oneversion of an LP and then want to run a

    slightly different version, it is inefficient to

    start from scratch. Re-optimization involves

    deducing how changes in the original model

    get carried into the final solution (our original

    optimal solution). The final tableau is then

    revised in light of the new information and theiterations start from there. (If the tableau that

    emerges is not feasible, a dual method can

    be applied. )

  • 7/27/2019 Chapter4 Or

    63/65

    Sensitivity Analysis

    Sensitivity parameters are those that cant be

    changed without changing the optimal solution.

    If a shadow price on a constraint is positive, then

    an increase in the RHS of that constraint willchange the optimal solution. If it is zero, there

    is a range over which it can be changed with

    no change in the optimal solution.

    Also, if a reduced cost is non-zero, there will

    be a range over which the related Cj can be

    changed without affecting the solution.

  • 7/27/2019 Chapter4 Or

    64/65

    Parametric Programming

    Related to sensitivity analysis

    Involves the systematic study of how the

    optimal solution changes as many

    parameters change simultaneously oversome range

    Trade-offs in parameter values can be

    studied, e.g. some resources (bi) can beincreased if others are reduced

  • 7/27/2019 Chapter4 Or

    65/65

    Section 4.9 Interior Point Solution

    Starts from inside the feasible region

    Moves along a path from the interior to the

    boundary

    Large problems can be solved more

    efficiently