Sensitivity analysis studies how the optimal solution reacts to changes in the LP data, without solving the LP again from the start.
Current Cost
The current cost of a variable is its coefficient in the original objective function, before any pivoting.
- Slack and surplus variables
Cost 0 always, since they track unused capacity or excess, not a produced quantity. becomes , and . - Artificial variables
Added only to satisfy a or constraint, and carry a penalty cost so the simplex method drives them out of the basis. becomes , with in the Big-M method for a maximization problem, or in phase 1 of the two-phase method.
Reduced Cost
The reduced cost of a variable is its entry in the objective row of the current tableau. It is the amount would change per unit of brought into the basis.
A basic variable always has reduced cost 0 in its own column. Only non-basic variables have a reduced cost worth tracking.
Shadow Price
The shadow price of constraint is ‘s own entry in the objective row, the amount changes per unit increase in .
Example
Take the LP solved in the simplex worked example:
Converting to standard form adds a slack to each constraint, one per row, with cost 0 in the objective, since a slack represents unused capacity rather than a produced quantity: .
Its optimal tableau has basis , solution , , :
| Basic | RHS | |||||
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 3/2 | 1 | 36 | |
| 0 | 0 | 1 | 1/3 | -1/3 | 2 | |
| 0 | 1 | 0 | 1/2 | 0 | 6 | |
| 1 | 0 | 0 | -1/3 | 1/3 | 2 |
The current costs are , , and , read straight off the objective function above. The reduced costs are the objective row of the tableau: 0 for the basic variables () and for and for .
Every case below reuses this tableau. A change to the LP keeps the basis optimal as long as 2 conditions still hold:
- Feasibility
Every basic variable’s value in the RHS column stays . - Optimality
Every reduced cost, the objective row entry of every non-basic variable, stays .
and already satisfy optimality ( and ), and all 3 basic values already satisfy feasibility (). If a change breaks either condition, the tableau is repaired with primal or dual simplex instead of restarting.
Change in the Right Hand Side
Changing constraint ‘s RHS by shifts every basic variable’s value by times that variable’s entry in ‘s column of the tableau. ’s column is the right thing to use here because started as the only variable with a coefficient in row , before any pivoting.
Underutilized Constraint
Constraint 1 is . Its slack is basic at value 2, so constraint 1 has 2 units of unused capacity.
’s column is for rows . Only the row has a non-zero entry there, so only moves when changes by :
and do not move, because constraint 1 was not binding to begin with. Feasibility only fails once the spare capacity runs out, at :
There is no upper bound, since only the row changes. So , originally 4, can range over without disturbing , , or . Drag below to see the basis break down:
The objective moves by ‘s own objective row entry, its shadow price, times . That entry is 0, confirming constraint 1 is non-binding: changing its unused capacity, within the range above, does not change at all.
Fully Utilized Constraint
Constraint 3 is . At , it reads , exactly the limit, so its slack is non-basic at 0 with no spare capacity to give.
has no row of its own in the tableau, since it is non-basic, but its column is still read straight off the tableau: for rows . Both and have non-zero entries there, so both move when changes by :
Unlike the underutilized case, itself moves this time, because constraint 3 was binding. Feasibility needs both altered rows to stay :
So , originally 18, can range over . Drag past either edge to see the basis break down:
The objective moves by ‘s own objective row entry, its shadow price, times . That entry is 1, so changes 1-for-1 with inside the range above, confirming constraint 3 is binding: its capacity is worth exactly 1 unit of per unit.
Change in a Cost Coefficient
Non-Basic Variable
is non-basic, with reduced cost and current cost , its coefficient in .
Changing only changes ‘s own reduced cost, by the same amount in the opposite direction. If increases by , the reduced cost drops to , needing
So can range over before becomes attractive enough to enter the basis. Drag past to see the basis break down:
Basic Variable
is basic with . ’s row runs through every column of the tableau, so changing changes every non-basic reduced cost, not just its own.
Set . ’s row gives entry under and under , so each reduced cost changes by times that entry:
Both together give , so can range over .
On paper this is the row operation : scale ‘s row by and add it into the objective row, the same mechanical step a pivot uses. The highlighted row below is the one being scaled, the highlighted cells are where it lands. Drag past either edge to see which reduced cost breaks first:
| Basic | RHS | |||||
|---|---|---|---|---|---|---|
| 3/2 | 1 | 36 | ||||
Addition of a Variable
Suppose a new activity becomes available, with cost and column , one unit of each resource per unit produced.
Transform its column with the basis inverse read off the columns above:
Its reduced cost, using for the current basis :
- Reduced cost
The current solution stays optimal. The new variable stays non-basic at value 0. - Reduced cost
Optimality is violated, as it is here. can enter the basis and improve beyond 36.
Drag past to see the reduced cost flip sign:
Addition of a Constraint
Suppose a new limit is imposed. The current optimum gives .
If current optimal solution satisfies the new constraint, the solution stays optimal.
Otherwise, the constraint is added to the optimal tableau with a slack, surplus, or artificial variable, and row-reduced against the current basis. The new basic variable gets a negative value, so the tableau is optimal but infeasible. Continue with the dual simplex method.
At , violates it, falling into the second case. Drag below 8 to see the constraint start to bind:
Continued with the dual simplex method in the dual simplex worked example, reaching the new optimum , , for .