Definition · Complementary slacknessA primal-feasible x and a dual-feasible y satisfy complementary slackness when, for every row i, either yᵢ = 0 or row i holds with equality; and for every column j, either xⱼ = 0 or dual constraint j holds with equality.
The two halves have names worth keeping apart. A row with slack must be priced at zero; an activity that is used must be exactly worth its ingredients.
Theorem · Complementary slackness characterises optimalityA feasible pair (x, y) is optimal for both programmes if and only if it satisfies complementary slackness.
Weak duality gave cᵀx ≤ yᵀAx ≤ bᵀy. Write the two gaps out: the right one is bᵀy − yᵀAx = yᵀ(b − Ax), a sum of products of a price and its row's slack, and the left one is yᵀAx − cᵀx = (Aᵀy − c)ᵀx, a sum of products of a dual gap and its activity. Feasibility makes every factor in both sums non-negative.
So cᵀx = bᵀy exactly when both sums are zero, which for non-negative terms means every individual product is zero — which is complementary slackness. And by weak duality, cᵀx = bᵀy at a feasible pair is precisely optimality of both.
□
That is the theorem. The use is what makes it worth a lesson: somebody hands you a plan and says it is optimal, and you would like to find out without running the algorithm. The conditions tell you which prices are forced to be zero and which dual constraints are forced to be equalities, and that is usually enough equations to determine y outright.
claim x = (2, 6) is optimal for the workshop
rows cutting 2 ≤ 4 slack 2 ⟹ y1 = 0
glazing 12 ≤ 12 tight ⟹ no condition on y2
assembly 18 ≤ 18 tight ⟹ no condition on y3
columns x1 = 2 > 0 ⟹ y1 + 3y3 = 3
x2 = 6 > 0 ⟹ 2y2 + 2y3 = 5
solve y1 = 0, so 3y3 = 3 y3 = 1
2y2 + 2 = 5 y2 = 3/2
test y = (0, 3/2, 1) ≥ 0 ✓
b'y = 4(0) + 12(3/2) + 18(1) = 36 = c'x ✓
verdict certified
Example · A claim that turns out to be rightThe system above has three equations — one from the slack row, two from the positive activities — and three unknowns, and it produces the same y the final tableau holds, reached without a single pivot. The lab prints each equation with the sentence that produced it, so that the system is visibly derived rather than assembled.
The three-activity preset is the same exercise with one activity not made. Claim (2, 6, 0): the contract row has 2 spare, so its price is 0; the two positive activities give 2y1 + y2 + y3 = 8 and y1 + y2 = 5; solving gives y = (3, 2, 0), and bᵀy = 46 = cᵀx. The unused third activity contributes no equation at all, and its dual constraint is left to be checked as an inequality: y1 + 2y2 = 7 ≥ 3, which holds with 4 to spare.
A refutation, and the trap inside it
Example · A feasible claim that is not optimalClaim x = (4, 3) for the workshop. It is feasible: 4 ≤ 4, 6 ≤ 12, 18 ≤ 18. Glazing now has 6 spare, so y2 = 0; both activities are positive, so y1 + 3y3 = 3 and 2y2 + 2y3 = 5. The second gives y3 = 5/2, and then y1 = 3 − 15/2 = −9/2.
The cutting row is a ≤ row in a maximisation, so its price may not be negative. The claim is refuted, and the reason is a specific one that can be stated: no set of prices consistent with this plan is dual feasible, so this plan cannot be optimal.
Now the trap. At that refuted claim, cᵀx = 27 and bᵀy = 27 as well — the two numbers agree. Equal values prove optimality only for a feasible pair, and y = (−9/2, 0, 5/2) is not feasible, so the agreement establishes nothing. The lab prints both numbers side by side on this preset for exactly that reason: the coincidence is what makes the feasibility test look skippable, and it is not.
Where the converse fails
It is tempting to read the conditions in both directions and conclude that a tight row must carry a positive price. That is false, and it fails precisely at a degenerate optimum. The conditions say that a positive price forces tightness; they say nothing at all about a tight row, and at a corner where more rows are tight than there are variables they cannot.
Example · A corner where three rows are tight and only two mattermax x + y subject to x ≤ 2 (kiln), y ≤ 2 (wheel) and x + y ≤ 4 (firing). The optimum is (2, 2) with z* = 4, and all three rows are tight there. No row has slack, so the conditions give only two equations — y1 + y3 = 1 and y2 + y3 = 1 — for three unknowns.
The lab solves that underdetermined system, reports y = (1, 1, 0), and says in as many words that y3 was never pinned down: the conditions left it free and a choice was made. So here is a row that is tight and priced at exactly nothing, and a second set of prices (0, 0, 1) that is equally optimal. Degeneracy in the primal is multiple optima in the dual, and this is the smallest instance of it.
The system can also be contradictory, which is a refutation of a different shape. Claim (1, 1) on the same programme: every row has slack, so all three prices are forced to zero, and both activities are positive, so y1 + y3 = 1 — 0 = 1. There are no prices to test at all, and the lab reports the verdict as such rather than inventing one. An infeasible claim, by contrast, is refused before any of this begins.