What Is a Shadow Price? How to Find the Shadow Price of a Constraint in Linear Programming
Publié le October 16, 2026 · par Simplex Method Calculator Editorial Team
The shadow price of a constraint tells you how much the optimal value of the objective would change if the right-hand side of that constraint increased by one unit. In a profit problem, it is the most you should be willing to pay for one more unit of a scarce resource. It is one of the most useful numbers a linear programming model produces, and it comes almost for free from the final simplex tableau.
This guide explains what a shadow price means, three ways to find it, when it is zero or negative, and over what range it stays valid, using one fully worked example.
Definition
For a constraint with right-hand side b, the shadow price is:
shadow price = change in the optimal objective value ÷ change in b, for a one-unit increase in b, with everything else unchanged.
Other names for the same number are dual price, dual value and marginal value of the resource. In economics, “shadow price” is also used more broadly for the value of goods that have no market price; this guide covers the linear programming meaning.
The Example
A workshop makes two products:
- Maximize Z = 12x1 + 16x2 (profit)
- 10x1 + 20x2 ≤ 120 (machine hours)
- 8x1 + 8x2 ≤ 80 (labour hours)
- x1, x2 ≥ 0
The optimal solution is x1 = 8, x2 = 2, Z = 128, with both constraints fully used. It is solved step by step in how to solve an LPP by the simplex method.
Method 1: Read It From the Final Simplex Tableau
In the optimal tableau, the shadow price of a ≤ constraint is the Zj value under its slack column (equivalently, minus its Cj − Zj value, because a slack has Cj = 0).
| Basis | Cb | x1 | x2 | s1 | s2 | RHS |
|---|---|---|---|---|---|---|
| x2 | 16 | 0 | 1 | 1/10 | −1/8 | 2 |
| x1 | 12 | 1 | 0 | −1/10 | 1/4 | 8 |
| Zj | 12 | 16 | 2/5 | 1 | 128 | |
| Cj − Zj | 0 | 0 | −2/5 | −1 |
- Shadow price of machine hours (s1): 2/5 = 0.4
- Shadow price of labour hours (s2): 1
So one extra machine hour is worth 0.4 in profit, and one extra labour hour is worth 1. If the workshop can buy extra labour for less than 1 per hour, it should; paying more than 1 would reduce profit. How the Zj row is calculated is explained in how to calculate Zj and Cj − Zj.
Method 2: Solve the Dual Problem
The shadow prices are exactly the optimal values of the dual variables. The dual of this problem is:
- Minimize W = 120y1 + 80y2
- 10y1 + 8y2 ≥ 12 and 20y1 + 8y2 ≥ 16, with y1, y2 ≥ 0
Its optimum is y1 = 2/5 and y2 = 1, the same two numbers, and W = 120(2/5) + 80(1) = 128, equal to the primal optimum. Writing and solving the dual is covered in duality in linear programming.
Method 3: Re-Solve With the Right-Hand Side Increased
The most direct check is to change the constraint and solve again:
| Change | New optimum | Change in Z |
|---|---|---|
| Machine hours 120 → 121 | x1 = 7.9, x2 = 2.1, Z = 128.4 | +0.4 |
| Labour hours 80 → 81 | x1 = 8.25, x2 = 1.875, Z = 129 | +1 |
Both match the tableau. This method is slow by hand, but it is a reliable way to confirm a shadow price, and it shows clearly what the number means.
The Shadow Price Only Holds Within a Range
A shadow price stays the same only while the same constraints remain binding, that is, while the optimal basis does not change. The range of right-hand-side values where it holds is called the allowable increase and decrease.
For a ≤ constraint, use the slack column of the final tableau. If b increases by Δ, the basic variables change by Δ times that column, and they must stay ≥ 0:
- Machine hours (s1 column 1/10, −1/10): x2 = 2 + Δ/10 ≥ 0 and x1 = 8 − Δ/10 ≥ 0, so −20 ≤ Δ ≤ 80. The shadow price 0.4 holds for 100 ≤ machine hours ≤ 200.
- Labour hours (s2 column −1/8, 1/4): x2 = 2 − Δ/8 ≥ 0 and x1 = 8 + Δ/4 ≥ 0, so −32 ≤ Δ ≤ 16. The shadow price 1 holds for 48 ≤ labour hours ≤ 96.
Outside the range, the shadow price changes. For example, above 200 machine hours the labour constraint alone limits production, so extra machine hours are worth 0: the maximum profit stays at 160 whether there are 200 or 201 machine hours. Below 100 machine hours, a different basis becomes optimal and each machine hour is worth more, 1.2 instead of 0.4: cutting from 100 to 99 hours lowers the maximum profit from 120 to 118.8.
Zero Shadow Prices: Non-Binding Constraints
If a constraint is not binding at the optimum, it has spare capacity, so one more unit of that resource changes nothing. Its shadow price is 0.
In the simplex tableau explained example (maximize 3x1 + 2x2 with three constraints), the third constraint has a slack of 3 in the optimal solution. Its shadow price is 0, and the maximum Z stays 33 whether that right-hand side is 24, 25 or 21. Reducing it by more than its slack of 3 would make it binding and change the answer. This is complementary slackness: a constraint with positive slack always has a zero shadow price.
Negative Shadow Prices
Shadow prices of ≤ constraints in a maximization problem are always zero or positive, because more capacity can never hurt. A shadow price is negative when increasing the right-hand side makes the constraint tighter, which happens with ≥ constraints in a maximization problem.
Example. Maximize Z = x1 + 2x2 subject to x1 + x2 ≤ 4 and x1 ≥ 1.
The optimum is x1 = 1, x2 = 3, Z = 7: the model would like x1 = 0, but the minimum requirement forces x1 = 1.
- Raise the requirement to x1 ≥ 2: the optimum becomes x1 = 2, x2 = 2, Z = 6. Shadow price −1.
- Raise the capacity to x1 + x2 ≤ 5: the optimum becomes x1 = 1, x2 = 4, Z = 9. Shadow price +2.
A negative shadow price means the requirement is costing you: each extra unit you are forced to produce lowers the objective. In minimization problems the signs follow the same logic: a binding ≥ requirement raises the minimum cost, so its shadow price increases cost.
Shadow Price vs Reduced Cost
| Shadow price | Reduced cost | |
|---|---|---|
| Belongs to | A constraint | A decision variable |
| Meaning | Change in optimal Z per extra unit of the right-hand side | Change in Z if a non-basic variable is forced up by one unit |
| Zero when | The constraint is not binding | The variable is basic (positive in the solution) |
| In the tableau | Zj under the slack column | Cj − Zj under the variable’s column |
Shadow Prices in Excel Solver
When you solve a model with Excel Solver’s Simplex LP engine and request the Sensitivity Report, the Constraints section lists a Shadow Price for each constraint, together with its Allowable Increase and Allowable Decrease. These are the same quantities calculated above: for this example Excel would show 0.4 with allowable increase 80 and decrease 20 for machine hours, and 1 with allowable increase 16 and decrease 32 for labour hours.
Common Mistakes
- Reading the wrong row. The shadow price is the Zj value under the slack column, not the RHS or the Cj value.
- Using a shadow price outside its range. It is only valid for the allowable increase and decrease.
- Mixing up signs in minimization. If you solved a minimization as maximize −Z, flip the sign of the values read from the tableau to express them in terms of Z.
- Expecting a non-zero value for a slack constraint. Unused capacity always has a shadow price of 0.
Find Shadow Prices With the Calculator
Enter your model in the simplex method calculator with steps and look at the Zj row of the final tableau under each slack column: those numbers are the shadow prices. For the example above, enter 12x1 + 16x2 with the two constraints and you will see 2/5 under s1 and 1 under s2.