Sensitivity Analysis

Work in progress. This note is still being written and incomplete.

8 min read Last updated Sun Sep 06 2026 13:01:26 GMT+0000 (Coordinated Universal Time)

Sensitivity analysis studies how the optimal solution reacts to changes in the LP data, without solving the LP again from the start.

The optimal tableau is fixed by the choice of basis BB. A change in the data keeps the same basis optimal as long as 2 conditions still hold:

  • Feasibility
    Every basic variable value stays 0\ge 0.
  • Optimality
    Every objective row entry satisfies the optimality criterion. For a maximization problem this means every reduced cost zjcj0z_j - c_j \ge 0, where cjc_j is the objective coefficient of variable jj and zjz_j is the rate at which zz would drop if xjx_j were forced into the basis.

If both hold, only the affected numbers are recomputed. If one fails, the tableau is repaired with primal or dual simplex.

Notation

  • BB
    The columns of the original constraint matrix belonging to the current basic variables.
  • B1B^{-1}
    The basis inverse. It is read straight off the optimal tableau, in the columns that held the identity matrix in the initial tableau.
  • cBc_B
    The objective coefficients of the basic variables in the original problem, listed in basis order.
  • bb
    The original right hand side vector.
  • AjA_j
    The column of variable jj in the original constraint matrix, before any pivoting.
  • cjc_j
    The objective coefficient of variable jj.
  • zjz_j
    The quantity cBTB1Ajc_B^{T} B^{-1} A_j. It is the amount by which zz changes per unit of xjx_j brought into the basis, through the forced adjustment of the current basic variables.
  • zjcjz_j - c_j
    The reduced cost of variable jj. It is the objective row entry under column jj. Non-negative for every jj means the basis is optimal for a maximization problem.

Two quantities drive every case:

RHS column=B1b\text{RHS column} = B^{-1} b zjcj=cBTB1Ajcjz_j - c_j = c_B^{T} B^{-1} A_j - c_j

The RHS column gives the basic variable values, so feasibility needs B1b0B^{-1} b \ge 0. The reduced cost zjcjz_j - c_j is the objective row entry under column jj, so optimality needs zjcj0z_j - c_j \ge 0 for every jj in a maximization problem.

Change in a Cost Coefficient

Non-basic variable

Only the objective row entry of that one variable changes.

The coefficient cjc_j enters zjcjz_j - c_j with a minus sign and nowhere else, since cjc_j is not part of cBc_B. So

zjcj=(fixed term)cjz_j - c_j = (\text{fixed term}) - c_j

The basis stays optimal while this stays 0\ge 0, which gives an upper bound on cjc_j.

Basic variable

The whole objective row is recomputed.

Now cjc_j sits inside cBc_B, so it appears in the reduced cost of every non-basic variable. Write cj=cjold+Δc_j = c_j^{\text{old}} + \Delta and impose zkck0z_k - c_k \ge 0 for every non-basic kk. Each inequality bounds Δ\Delta. Their intersection is the range over which the basis stays optimal.

Change in the Right Hand Side

Recompute the RHS column with the current basis inverse.

Replace bb by the new vector bnewb_{\text{new}}. The new basic variable values are

B1bnewB^{-1} b_{\text{new}}

The basis stays optimal while every entry is 0\ge 0. This gives the range over which a resource can change without altering the optimal basis. The objective value moves by the shadow price of that resource times the change.

Change in the Coefficient Matrix

  • Non-basic variable’s column Recompute B1AjB^{-1} A_j and then zjcjz_j - c_j from the new column. If it stays 0\ge 0 the basis is still optimal.
  • Basic variable’s column The matrix BB itself changes, so B1B^{-1} changes. The tableau is rebuilt and the LP effectively re-solved.

Addition of a Variable

Treat the new variable as a new column AnewA_{\text{new}} with cost cnewc_{\text{new}}.

Compute its objective row entry with the current basis inverse:

znewcnew=cBTB1Anewcnewz_{\text{new}} - c_{\text{new}} = c_B^{T} B^{-1} A_{\text{new}} - c_{\text{new}}
  • Entry 0\ge 0 The current solution stays optimal. The new variable stays non-basic at value 0.
  • Entry <0< 0 Optimality is violated. The new variable can enter the basis and improve the objective.

Addition of a Constraint

  • Current optimal solution satisfies the new constraint It stays optimal. No further work.
  • Current optimal solution violates the new constraint Add the constraint to the optimal tableau with a slack, surplus, or artificial variable, and row-reduce it 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.

Worked Example

Base LP, the same as the simplex worked example:

maximizez=3x1+5x2subject tox142x2123x1+2x218x1,x20\begin{aligned} \text{maximize} \quad & z = 3x_1 + 5x_2 \\ \text{subject to} \quad & x_1 \le 4 \\ & 2x_2 \le 12 \\ & 3x_1 + 2x_2 \le 18 \\ & x_1, x_2 \ge 0 \end{aligned}

Optimal tableau, basis (s1,x2,x1)(s_1, x_2, x_1), x=(2,6)x^{*} = (2, 6), z=36z^{*} = 36:

Basicx1x_1x2x_2s1s_1s2s_2s3s_3RHS
zz0003/2136
s1s_10011/3-1/32
x2x_20101/206
x1x_1100-1/31/32

The basis inverse sits in the s1,s2,s3s_1, s_2, s_3 columns, since those held the identity in the initial tableau:

B1=(11/31/301/2001/31/3)B^{-1} = \begin{pmatrix} 1 & 1/3 & -1/3 \\ 0 & 1/2 & 0 \\ 0 & -1/3 & 1/3 \end{pmatrix}

Values used below:

  • cB=(cs1,cx2,cx1)=(0,5,3)c_B = (c_{s_1}, c_{x_2}, c_{x_1}) = (0, 5, 3)
  • As2=(0,1,0)TA_{s_2} = (0,1,0)^{T}, the unit column for the second constraint
  • As3=(0,0,1)TA_{s_3} = (0,0,1)^{T}, the unit column for the third constraint
  • original RHS b=(4,12,18)Tb = (4, 12, 18)^{T}

Cost coefficient of a non-basic variable

s2s_2 is non-basic. Its objective row entry:

zs2cs2=cBTB1As2cs2=[(0)13+(5)12+(3)(13)]cs2=32cs2z_{s_2} - c_{s_2} = c_B^{T} B^{-1} A_{s_2} - c_{s_2} = \left[(0)\tfrac13 + (5)\tfrac12 + (3)\left(-\tfrac13\right)\right] - c_{s_2} = \frac32 - c_{s_2}

The bracket equals 3/23/2 and does not depend on cs2c_{s_2}. Optimality needs

32cs20    cs232\frac32 - c_{s_2} \ge 0 \implies c_{s_2} \le \frac32

Currently cs2=0c_{s_2} = 0, which reproduces the stored entry 3/23/2. The basis stays optimal for cs2(,3/2]c_{s_2} \in (-\infty, 3/2].

Cost coefficient of a basic variable

x1x_1 is basic. Set c1=3+Δc_1 = 3 + \Delta, so cB=(0,5,3+Δ)c_B = (0, 5, 3 + \Delta). Every non-basic entry must stay 0\ge 0.

For s2s_2, with B1As2=(1/3,1/2,1/3)TB^{-1} A_{s_2} = (1/3, 1/2, -1/3)^{T} (the second column of B1B^{-1}):

zs2cs2=(0)13+(5)12+(3+Δ)(13)0=32Δ30    Δ92z_{s_2} - c_{s_2} = (0)\tfrac13 + (5)\tfrac12 + (3 + \Delta)\left(-\tfrac13\right) - 0 = \frac32 - \frac{\Delta}{3} \ge 0 \implies \Delta \le \frac92

For s3s_3, with B1As3=(1/3,0,1/3)TB^{-1} A_{s_3} = (-1/3, 0, 1/3)^{T} (the third column of B1B^{-1}):

zs3cs3=(0)(13)+(5)(0)+(3+Δ)130=1+Δ30    Δ3z_{s_3} - c_{s_3} = (0)\left(-\tfrac13\right) + (5)(0) + (3 + \Delta)\tfrac13 - 0 = 1 + \frac{\Delta}{3} \ge 0 \implies \Delta \ge -3

Both together give 3Δ9/2-3 \le \Delta \le 9/2, so c1[0,7.5]c_1 \in [0, 7.5].

Change in the right hand side

Set b1=4+Δb_1 = 4 + \Delta, so the new RHS vector is b+Δe1b + \Delta e_1 with e1=(1,0,0)Te_1 = (1,0,0)^{T}. The new basic values:

B1(b+Δe1)=B1b+ΔB1e1=(262)+Δ(100)=(2+Δ62)B^{-1}(b + \Delta e_1) = B^{-1} b + \Delta\, B^{-1} e_1 = \begin{pmatrix}2\\6\\2\end{pmatrix} + \Delta \begin{pmatrix}1\\0\\0\end{pmatrix} = \begin{pmatrix}2 + \Delta\\6\\2\end{pmatrix}

Here B1b=(2,6,2)TB^{-1} b = (2,6,2)^{T} is the current RHS column and B1e1=(1,0,0)TB^{-1} e_1 = (1,0,0)^{T} is the first column of B1B^{-1}. Feasibility needs every entry 0\ge 0:

2+Δ0    Δ22 + \Delta \ge 0 \implies \Delta \ge -2

Only the s1s_1 row changes, so there is no upper bound. The basis stays optimal for b1[2,)b_1 \in [2, \infty).

Addition of a variable

Add x3x_3 with cost c3=4c_3 = 4 and original column A3=(1,1,1)TA_3 = (1,1,1)^{T}, meaning coefficient 1 in each constraint. First transform the column:

B1A3=(11/20)B^{-1} A_3 = \begin{pmatrix}1\\1/2\\0\end{pmatrix}

Then its objective row entry:

z3c3=cBTB1A3c3=(0)(1)+(5)12+(3)(0)4=32<0z_3 - c_3 = c_B^{T} B^{-1} A_3 - c_3 = (0)(1) + (5)\tfrac12 + (3)(0) - 4 = -\frac32 < 0

Optimality is violated. x3x_3 can enter the basis and improve zz.

Addition of a constraint

Add x1+x25x_1 + x_2 \le 5. The current optimum gives x1+x2=2+6=8>5x_1 + x_2 = 2 + 6 = 8 > 5, so it violates the new constraint. The tableau stays optimal but becomes infeasible. Continued with the dual simplex method in the dual simplex worked example, reaching the new optimum x1=0x_1 = 0, x2=5x_2 = 5, z=25z = 25.

Was this helpful?