Linear Programming, the Simplex Algorithm, and Sensitivity Analysis

Introduction to Linear Programming and the Simplex Algorithm

  • Scope of Graphical Solution Method:

    • Graphical solution approaches work strictly for linear programming (LP) problems with 22 decision variables.
    • The graphical method illustrates all potential LP solution outcomes: unique optimal solutions, multiple/alternative optimal solutions, unbounded objective values, and infeasible problems.
    • Real-world optimization problems contain hundreds, thousands, or millions of decision variables, making graphical visualization impossible.
  • The Simplex Algorithm:

    • Developed by George Dantzig in the 1940s.
    • Uses a systematic algebraic technique based on linear algebra to iterate through extreme points of a feasible region.
    • Manual implementation utilizes augmented matrices called tableaus.
    • Serves as the underlying computational algorithm for optimization software packages such as Microsoft Excel (via the Solver add-in) and QM for Windows.
  • LP Formulation Standards:

    • Objective functions and constraints must be strictly linear.
    • All decision variables must be placed on the left-hand side (LHS) of constraint inequalities, with constant numerical parameters on the right-hand side (RHS).
  • Base Model Formulation (Beaver Creek Pottery Example):

    • Decision Variables:
      • x1x_1 = Number of bowls produced
      • x2x_2 = Number of mugs produced
    • Objective Function: Maximize total profit         Maximize Z=40x1+50x2\text{Maximize } Z = 40x_1 + 50x_2
    • Resource Constraints:
      • Labor Constraint: 1x1+2x2≤401x_1 + 2x_2 \le 40
      • Clay Constraint: 4x1+3x2≤1204x_1 + 3x_2 \le 120
      • Non-negativity Constraints: x1,x2≥0x_1, x_2 \ge 0

Excel Spreadsheet Implementation and Solver Add-In

  • Spreadsheet Structural Layout & Color Conventions:

    • Decision Variables (Blue Cells): Dedicated cells storing calculated variable values (e.g., Bowls in cell B10, Mugs in cell B11).
    • Input Parameters (Uncolored Cells): Given problem coefficients (e.g., Bowl price in C4 = 4040, Mug price in D4 = 5050; Labor requirements in C6 = 11, D6 = 22; Clay requirements in C7 = 44, D7 = 33; RHS limits in G6 = 4040, G7 = 120120).
    • Calculated LHS Constraints (Yellow Cells): Calculated total resource usage cells (E6 for Labor usage, E7 for Clay usage).
    • Objective Value (Orange Cell): Calculated profit value in cell B12 to be optimized.
  • Spreadsheet Formula Rules:

    • Profit Objective Cell (B12):         =C4×B10+D4×B11=\text{C4} \times \text{B10} + \text{D4} \times \text{B11}         Alternatively implemented using SUMPRODUCT(C4:D4, B10:B11).
    • Labor Usage LHS Cell (E6):         =C6×B10+D6×B11=\text{C6} \times \text{B10} + \text{D6} \times \text{B11}
    • Clay Usage LHS Cell (E7):         =C7×B10+D7×B11=\text{C7} \times \text{B10} + \text{D7} \times \text{B11}
    • Unused Slack Calculation Cells (Optional, Column H):
      • Labor Slack (H6): G6 - E6
      • Clay Slack (H7): G7 - E7
  • Excel Solver Parameter Configuration:

    • Set Objective: $B$12
    • To: Max radio button
    • By Changing Variable Cells: $B$10:$B$11
    • Subject to the Constraints:
      • $E$6 <= $G$6
      • $E$7 <= $G$7
      • Alternatively added as a single block array constraint: $E$6:$E$7 <= $G$6:$G$7
    • Select Option: "Make Unconstrained Variables Non-Negative"
    • Select Solving Method: Simplex LP
  • Solver Solution and Output Reports:

    • Optimal solution: x1=24x_1 = 24 bowls, x2=8x_2 = 8 mugs, yielding an optimal objective profit Z=$1360Z = \$1360.
    • Available diagnostic and analytical output reports: Answer Report, Sensitivity Report, Limits Report.
    • Answer Report: Shows initial vs. final cell values, execution run time, constraint slack values, and binding status.
    • Sensitivity Report: Details variable final values, constraint RHS values, objective coefficient allowable increases/decreases, shadow prices, and reduced costs.

Alternative Software Execution: QM for Windows

  • Software Characteristics:

    • Dedicated optimization program specifically tailored for linear programming, assignment, forecasting, and goal programming.
    • Avoids cell-formula linking required in Excel, requiring only direct tabular numerical inputs.
  • Setup Steps for QM for Windows:

    1. Select module: Linear Programming.
    2. Set title to Beaver Creek Pottery, specify 22 constraints and 22 variables.
    3. Choose objective type: Maximize.
    4. Input objective function row coefficients (4040 for x1x_1, 5050 for x2x_2).
    5. Enter constraint matrix values:
      • Labor row: 1x1+2x2≤401x_1 + 2x_2 \le 40
      • Clay row: 4x1+3x2≤1204x_1 + 3x_2 \le 120
    6. Click Solve.
  • QM Output Features:

    • Displays solution summary directly (x1=24x_1 = 24, x2=8x_2 = 8, Z=1360Z = 1360).
    • Calculates slack values automatically.
    • Provides explicit graphical view plotting feasible regions, extreme points, and iso-profit lines (available for two-variable models).
    • Generates ranging outputs directly listing lower and upper bounds for parameters.

Principles of Sensitivity Analysis

  • Core Definition:

    • Sensitivity analysis determines how the optimal solution and objective function value change when input parameters vary.
    • Examines the stability of the optimal production strategy when model constants fluctuate.
  • Single Parameter Change Constraint:

    • Sensitivity analysis ranges are strictly valid when only one single parameter changes at a time.
    • If multiple input parameters change simultaneously, the sensitivity ranges do not hold; the LP model must be completely re-solved to determine the new optimal solution.

Graphical Analysis of Objective Coefficient Changes

  • Original Objective Function Baseline:

    • Function: Z=40x1+50x2Z = 40x_1 + 50x_2
    • Slope calculation: −c1c2=−4050=−0.8-\frac{c_1}{c_2} = -\frac{40}{50} = -0.8
    • Optimal Extreme Point: Point B(24,8)B(24, 8) with profit Z=$1360Z = \$1360
  • Case 1: Bowl Profit Increase to $100 (c1=100,c2=50c_1 = 100, c_2 = 50):

    • Revised Objective Function: Z=100x1+50x2Z = 100x_1 + 50x_2
    • Slope: −10050=−2.0-\frac{100}{50} = -2.0
    • Gradient direction vector point: (100,50)(100, 50)
    • Pushing iso-profit lines perpendicular to the direction vector hits extreme point C(30,0)C(30, 0).
    • New Optimal Strategy: x1=30x_1 = 30 bowls, x2=0x_2 = 0 mugs.
    • New Optimal Profit: Z=100(30)+50(0)=$3000Z = 100(30) + 50(0) = \$3000
  • Case 2: Mug Profit Increase to $100 (c1=40,c2=100c_1 = 40, c_2 = 100):

    • Revised Objective Function: Z=40x1+100x2Z = 40x_1 + 100x_2
    • Slope: −40100=−0.4-\frac{40}{100} = -0.4
    • Gradient direction vector point: (40,100)(40, 100)
    • Pushing iso-profit lines perpendicular to the direction vector hits extreme point A(0,20)A(0, 20).
    • New Optimal Strategy: x1=0x_1 = 0 bowls, x2=20x_2 = 20 mugs.
    • New Optimal Profit: Z=40(0)+100(20)=$2000Z = 40(0) + 100(20) = \$2000

Mathematical Derivation of Optimal Objective Coefficient Ranges

  • Bounding Constraint Slopes for Point B:

    • Point B(24,8)B(24, 8) is formed by the intersection of the Labor constraint and Clay constraint.
    • Slope of Labor Constraint (Line Segment ABAB):         1x1+2x2=40  ⟹  x2=20−0.5x1  ⟹  Slope=−12=−0.51x_1 + 2x_2 = 40 \implies x_2 = 20 - 0.5x_1 \implies \text{Slope} = -\frac{1}{2} = -0.5
    • Slope of Clay Constraint (Line Segment BCBC):         4x1+3x2=120  ⟹  x2=40−1.333x1  ⟹  Slope=−43≈−1.3334x_1 + 3x_2 = 120 \implies x_2 = 40 - 1.333x_1 \implies \text{Slope} = -\frac{4}{3} \approx -1.333
  • Optimality Condition for Extreme Point B:

    • Point BB remains optimal as long as the objective function slope lies between the slopes of the two intersecting constraints:         −43≤Objective Slope≤−12-\frac{4}{3} \le \text{Objective Slope} \le -\frac{1}{2}−1.333≤Objective Slope≤−0.5-1.333 \le \text{Objective Slope} \le -0.5
  • Algebraic Derivation for Bowl Profit Range (c1c_1):

    • Objective function: Z=c1x1+50x2Z = c_1 x_1 + 50 x_2
    • Slope: −c150-\frac{c_1}{50}
    • Inequality setup:         −43≤−c150≤−12-\frac{4}{3} \le -\frac{c_1}{50} \le -\frac{1}{2}
    • Solving Lower Bound:         −c150≤−12  ⟹  c150≥12  ⟹  c1≥25-\frac{c_1}{50} \le -\frac{1}{2} \implies \frac{c_1}{50} \ge \frac{1}{2} \implies c_1 \ge 25
    • Solving Upper Bound:         −43≤−c150  ⟹  c150≤43  ⟹  c1≤2003=66.67-\frac{4}{3} \le -\frac{c_1}{50} \implies \frac{c_1}{50} \le \frac{4}{3} \implies c_1 \le \frac{200}{3} = 66.67
    • Allowable Range for Bowl Profit (c1c_1): 25≤c1≤66.6725 \le c_1 \le 66.67
  • Algebraic Derivation for Mug Profit Range (c2c_2):

    • Objective function: Z=40x1+c2x2Z = 40 x_1 + c_2 x_2
    • Slope: −40c2-\frac{40}{c_2}
    • Inequality setup:         −43≤−40c2≤−12-\frac{4}{3} \le -\frac{40}{c_2} \le -\frac{1}{2}
    • Solving Lower Bound:         −43≤−40c2  ⟹  43≥40c2  ⟹  43c2≥40  ⟹  c2≥30-\frac{4}{3} \le -\frac{40}{c_2} \implies \frac{4}{3} \ge \frac{40}{c_2} \implies \frac{4}{3}c_2 \ge 40 \implies c_2 \ge 30
    • Solving Upper Bound:         −40c2≤−12  ⟹  40c2≥12  ⟹  c2≤80-\frac{40}{c_2} \le -\frac{1}{2} \implies \frac{40}{c_2} \ge \frac{1}{2} \implies c_2 \le 80
    • Allowable Range for Mug Profit (c2c_2): 30≤c2≤8030 \le c_2 \le 80

Software Sensitivity Output Interpretation

  • Excel Sensitivity Report Conversion:

    • Excel reports original values alongside Allowable Increase and Allowable Decrease.
    • Bowl Profit (c1c_1):
      • Original Value = 4040
      • Allowable Increase = 26.6726.67
      • Allowable Decrease = 1515
      • Calculated Range: 40−15=2540 - 15 = 25 to 40+26.67=66.6740 + 26.67 = 66.67
    • Mug Profit (c2c_2):
      • Original Value = 5050
      • Allowable Increase = 3030
      • Allowable Decrease = 2020
      • Calculated Range: 50−20=3050 - 20 = 30 to 50+30=8050 + 30 = 80
  • QM for Windows Output Format:

    • Directly outputs absolute lower and upper bounds:
      • c1c_1 range: [25,66.67][25, 66.67]
      • c2c_2 range: [30,80][30, 80]
  • Decision Protocol for Parameter Change Scenarios:

    • Scenario 1: Bowl price increases from 4040 to 7070 (c2=50c_2 = 50).
      • Evaluation: 70>66.6770 > 66.67 (Outside allowable range).
      • Conclusion: Production mix changes. Excel Solver must be re-run; new profit cannot be determined from sensitivity report.
    • Scenario 2: Mug price increases from 5050 to 7070 (c1=40c_1 = 40).
      • Evaluation: 30≤70≤8030 \le 70 \le 80 (Inside allowable range).
      • Conclusion: Optimal product decision remains x1=24x_1 = 24, x2=8x_2 = 8
      • Recalculated Profit: Z=40(24)+70(8)=960+560=$1520Z = 40(24) + 70(8) = 960 + 560 = \$1520
    • Scenario 3: Bowl price decreases from 4040 to 3030 (c2=50c_2 = 50).
      • Evaluation: 25≤30≤66.6725 \le 30 \le 66.67 (Inside allowable range).
      • Conclusion: Optimal product decision remains x1=24x_1 = 24, x2=8x_2 = 8
      • Recalculated Profit: Z=30(24)+50(8)=720+400=$1120Z = 30(24) + 50(8) = 720 + 400 = \$1120
    • Scenario 4: Mug price decreases from 5050 to 2020 (c1=40c_1 = 40).
      • Evaluation: 20<3020 < 30 (Outside allowable range).
      • Conclusion: Must re-solve model.
    • Scenario 5: Bowl price increases to 6565 and mug price decreases to 3030 simultaneously.
      • Evaluation: Multiple parameter changes occurred.
      • Conclusion: Standard single-parameter sensitivity ranges are invalid. Must re-solve model.

Sensitivity Analysis with Vertical Constraints (Fertilizer Problem)

  • Problem Formulation:

    • Variables: x1x_1 = Bags of SuperGrow, x2x_2 = Bags of CropQuick
    • Objective: Minimize total cost Z=6x1+3x2Z = 6x_1 + 3x_2
    • Constraints:
      • Phosphate Constraint: 4x1+3x2≥244x_1 + 3x_2 \ge 24
      • Vertical Boundary Constraint: x1≥0x_1 \ge 0
    • Original Optimal Solution: Extreme point A(0,8)A(0, 8), giving total minimum cost Z=6(0)+3(8)=$24Z = 6(0) + 3(8) = \$24
  • Handling Vertical Constraints:

    • The slope of a vertical line (x1=0x_1 = 0) is mathematically undefined.
    • For analytical sensitivity modeling, a vertical line approaching from the left/top is assigned a limit slope of −∞-\infty
  • Determining Bounds for Point A:

    • Constraint slopes intersecting at Point A(0,8)A(0, 8):
      • Vertical Axis (x1=0x_1 = 0): Slope = −∞-\infty
      • Phosphate Constraint (4x1+3x2=244x_1 + 3x_2 = 24): Slope = −43≈−1.333-\frac{4}{3} \approx -1.333
    • Slope Condition for Point AA Optimality:         −∞≤Objective Slope≤−43-\infty \le \text{Objective Slope} \le -\frac{4}{3}
  • SuperGrow Cost Range (c1c_1):

    • Objective function slope: −c13-\frac{c_1}{3}
    • Inequality:         −∞≤−c13≤−43  ⟹  c13≥43  ⟹  c1≥4-\infty \le -\frac{c_1}{3} \le -\frac{4}{3} \implies \frac{c_1}{3} \ge \frac{4}{3} \implies c_1 \ge 4
    • Allowable Range: 4≤c1≤∞4 \le c_1 \le \infty
  • CropQuick Cost Range (c2c_2):

    • Objective function slope: −6c2-\frac{6}{c_2}
    • Inequality:         −∞≤−6c2≤−43  ⟹  6c2≥43  ⟹  4c2≤18  ⟹  c2≤4.5-\infty \le -\frac{6}{c_2} \le -\frac{4}{3} \implies \frac{6}{c_2} \ge \frac{4}{3} \implies 4c_2 \le 18 \implies c_2 \le 4.5
    • Including non-negativity boundary condition: 0≤c2≤4.50 \le c_2 \le 4.5

General Summary Procedure for Objective Ranges

  • Step-by-Step Method:
    1. Identify the two constraints intersecting at the optimal extreme point.
    2. Calculate the exact numerical slopes of both intersecting constraints.
    3. If vertical boundary constraints intersect, assign slope as −∞-\infty or +∞+\infty.
    4. Set up inequality ordering the smaller slope on the left and larger slope on the right:         Slopelower≤−c1c2≤Slopeupper\text{Slope}_{\text{lower}} \le -\frac{c_1}{c_2} \le \text{Slope}_{\text{upper}}
    5. To solve for c1c_1 range: Substitute original constant value for c2c_2 and solve inequality for c1c_1
    6. To solve for c2c_2 range: Substitute original constant value for c1c_1 and solve inequality for c2c_2

Right-Hand Side (RHS) Sensitivity Analysis

  • Structural Mechanics of RHS Changes:

    • Changing the RHS value of a constraint shifts the constraint line parallel to itself (slope remains unchanged, intercept changes).
    • Parallel shifts alter the geometry and extreme corner points of the feasible region.
    • Because extreme point coordinates move, RHS ranges do not keep specific variable value pairs (e.g., x1=24,x2=8x_1 = 24, x_2 = 8) constant.
    • RHS ranges maintain the optimality of the same solution mix / same binding constraint intersection.
  • RHS Parameter Ranges (Beaver Creek Pottery Example):

    • Labor Resource RHS (RHS1=40RHS_1 = 40):
      • QM for Windows range output: [30,80][30, 80]
      • Excel Sensitivity Report output:
        • Allowable Increase = 4040
        • Allowable Decrease = 1010
        • Calculated Range: 40−10=3040 - 10 = 30 to 40+40=8040 + 40 = 80
    • Clay Resource RHS (RHS2=120RHS_2 = 120):
      • QM for Windows range output: [60,160][60, 160]
      • Excel Sensitivity Report output:
        • Allowable Increase = 4040
        • Allowable Decrease = 6060
        • Calculated Range: 120−60=60120 - 60 = 60 to 120+40=160120 + 40 = 160
  • RHS Parameter Ranges (Fertilizer Problem Example):

    • Nitrogen constraint RHS range (RHS1=16RHS_1 = 16): [−∞,32][-\infty, 32]
    • Phosphate constraint RHS range (RHS2=24RHS_2 = 24): [12,∞][12, \infty]
  • Interpretation Rules for RHS Sensitivity:

    • Graphical determination of RHS bounds is too complex for manual calculation; values are extracted directly from computer software reports.
    • As long as a constraint RHS stays within its allowable range, the optimal solution remains at the intersection of the identical binding constraints.
    • Actual values of decision variables (x1,x2x_1, x_2) and objective function ZZ fluctuate continuously as the RHS changes within the range.