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 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:
- = Number of bowls produced
- = Number of mugs produced
- Objective Function: Maximize total profit
- Resource Constraints:
- Labor Constraint:
- Clay Constraint:
- Non-negativity Constraints:
- Decision Variables:
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 cellB11). - Input Parameters (Uncolored Cells): Given problem coefficients (e.g., Bowl price in
C4= , Mug price inD4= ; Labor requirements inC6= ,D6= ; Clay requirements inC7= ,D7= ; RHS limits inG6= ,G7= ). - Calculated LHS Constraints (Yellow Cells): Calculated total resource usage cells (
E6for Labor usage,E7for Clay usage). - Objective Value (Orange Cell): Calculated profit value in cell
B12to be optimized.
- Decision Variables (Blue Cells): Dedicated cells storing calculated variable values (e.g., Bowls in cell
Spreadsheet Formula Rules:
- Profit Objective Cell (
B12): Alternatively implemented usingSUMPRODUCT(C4:D4, B10:B11). - Labor Usage LHS Cell (
E6): - Clay Usage LHS Cell (
E7): - Unused Slack Calculation Cells (Optional, Column H):
- Labor Slack (
H6):G6 - E6 - Clay Slack (
H7):G7 - E7
- Labor Slack (
- Profit Objective Cell (
Excel Solver Parameter Configuration:
- Set Objective:
$B$12 - To:
Maxradio 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
- Set Objective:
Solver Solution and Output Reports:
- Optimal solution: bowls, mugs, yielding an optimal objective profit .
- 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:
- Select module:
Linear Programming. - Set title to Beaver Creek Pottery, specify constraints and variables.
- Choose objective type:
Maximize. - Input objective function row coefficients ( for , for ).
- Enter constraint matrix values:
- Labor row:
- Clay row:
- Click
Solve.
- Select module:
QM Output Features:
- Displays solution summary directly (, , ).
- 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:
- Slope calculation:
- Optimal Extreme Point: Point with profit
Case 1: Bowl Profit Increase to $100 ():
- Revised Objective Function:
- Slope:
- Gradient direction vector point:
- Pushing iso-profit lines perpendicular to the direction vector hits extreme point .
- New Optimal Strategy: bowls, mugs.
- New Optimal Profit:
Case 2: Mug Profit Increase to $100 ():
- Revised Objective Function:
- Slope:
- Gradient direction vector point:
- Pushing iso-profit lines perpendicular to the direction vector hits extreme point .
- New Optimal Strategy: bowls, mugs.
- New Optimal Profit:
Mathematical Derivation of Optimal Objective Coefficient Ranges
Bounding Constraint Slopes for Point B:
- Point is formed by the intersection of the Labor constraint and Clay constraint.
- Slope of Labor Constraint (Line Segment ):
- Slope of Clay Constraint (Line Segment ):
Optimality Condition for Extreme Point B:
- Point remains optimal as long as the objective function slope lies between the slopes of the two intersecting constraints:
Algebraic Derivation for Bowl Profit Range ():
- Objective function:
- Slope:
- Inequality setup:
- Solving Lower Bound:
- Solving Upper Bound:
- Allowable Range for Bowl Profit ():
Algebraic Derivation for Mug Profit Range ():
- Objective function:
- Slope:
- Inequality setup:
- Solving Lower Bound:
- Solving Upper Bound:
- Allowable Range for Mug Profit ():
Software Sensitivity Output Interpretation
Excel Sensitivity Report Conversion:
- Excel reports original values alongside
Allowable IncreaseandAllowable Decrease. - Bowl Profit ():
- Original Value =
- Allowable Increase =
- Allowable Decrease =
- Calculated Range: to
- Mug Profit ():
- Original Value =
- Allowable Increase =
- Allowable Decrease =
- Calculated Range: to
- Excel reports original values alongside
QM for Windows Output Format:
- Directly outputs absolute lower and upper bounds:
- range:
- range:
- Directly outputs absolute lower and upper bounds:
Decision Protocol for Parameter Change Scenarios:
- Scenario 1: Bowl price increases from to ().
- Evaluation: (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 to ().
- Evaluation: (Inside allowable range).
- Conclusion: Optimal product decision remains ,
- Recalculated Profit:
- Scenario 3: Bowl price decreases from to ().
- Evaluation: (Inside allowable range).
- Conclusion: Optimal product decision remains ,
- Recalculated Profit:
- Scenario 4: Mug price decreases from to ().
- Evaluation: (Outside allowable range).
- Conclusion: Must re-solve model.
- Scenario 5: Bowl price increases to and mug price decreases to simultaneously.
- Evaluation: Multiple parameter changes occurred.
- Conclusion: Standard single-parameter sensitivity ranges are invalid. Must re-solve model.
- Scenario 1: Bowl price increases from to ().
Sensitivity Analysis with Vertical Constraints (Fertilizer Problem)
Problem Formulation:
- Variables: = Bags of SuperGrow, = Bags of CropQuick
- Objective: Minimize total cost
- Constraints:
- Phosphate Constraint:
- Vertical Boundary Constraint:
- Original Optimal Solution: Extreme point , giving total minimum cost
Handling Vertical Constraints:
- The slope of a vertical line () is mathematically undefined.
- For analytical sensitivity modeling, a vertical line approaching from the left/top is assigned a limit slope of
Determining Bounds for Point A:
- Constraint slopes intersecting at Point :
- Vertical Axis (): Slope =
- Phosphate Constraint (): Slope =
- Slope Condition for Point Optimality:
- Constraint slopes intersecting at Point :
SuperGrow Cost Range ():
- Objective function slope:
- Inequality:
- Allowable Range:
CropQuick Cost Range ():
- Objective function slope:
- Inequality:
- Including non-negativity boundary condition:
General Summary Procedure for Objective Ranges
- Step-by-Step Method:
- Identify the two constraints intersecting at the optimal extreme point.
- Calculate the exact numerical slopes of both intersecting constraints.
- If vertical boundary constraints intersect, assign slope as or .
- Set up inequality ordering the smaller slope on the left and larger slope on the right:
- To solve for range: Substitute original constant value for and solve inequality for
- To solve for range: Substitute original constant value for and solve inequality for
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., ) 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 ():
- QM for Windows range output:
- Excel Sensitivity Report output:
- Allowable Increase =
- Allowable Decrease =
- Calculated Range: to
- Clay Resource RHS ():
- QM for Windows range output:
- Excel Sensitivity Report output:
- Allowable Increase =
- Allowable Decrease =
- Calculated Range: to
- Labor Resource RHS ():
RHS Parameter Ranges (Fertilizer Problem Example):
- Nitrogen constraint RHS range ():
- Phosphate constraint RHS range ():
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 () and objective function fluctuate continuously as the RHS changes within the range.