What a constraint is worth
Worth reading first: Two numbers that have to meet · The slope of a single point.
The rung below settled that a linear program and the program built from its transpose reach the same number, and left the second program looking like a device for proving something about the first. It has variables of its own, one for each constraint, and nobody has asked what they are.
The rate, and what “worth” means here
Each dual variable is attached to one constraint of the primal program, and the claim of this essay is that it measures exactly one thing:
The dual variable is the rate at which the optimum changes when the $i$th constraint’s right-hand side is relaxed by one unit.
Relax the first constraint of the program above from to and the optimum rises by . The dual variable on that constraint is . Those are the same number and not by coincidence, and the figure above is that statement checked at thirty of its own intervals rather than asserted.
The word worth in the title carries no more than that. It means worth in units of the objective: the objective is , the right-hand side is a number on the other side of a , and a dual variable is a quantity of the first per unit of the second. It is not a cost, there is no market anywhere in this field, and nothing here is exchanged for anything. The rate is a property of a system of inequalities, in the same sense that a slope is a property of a curve, and the temptation to reach for currency should be resisted the whole way down — a program with the coefficients doubled has all its rates halved, which is a fact about arithmetic and about nothing else.
The consequence worth having is that the dual turns a solution into a list of rates: one number per constraint, saying what each one is doing to the answer. Two things happen to that list which are more interesting than the list itself. It is piecewise constant, so a rate is only a rate over an interval. And most of its entries are usually zero.
The program, and the stupidest possible solver
Everything below is decided on one program in two variables:
The solver is deliberately unimpressive. It forms every pair of constraints, solves each pair as a two-by-two system by Cramer’s rule, and throws away the points that violate something — which is how a corner of a cube gets found when the only tool available is checking all of them. Nobody would use it on a program of any size, and that is the point: no part of any picture here is about a clever procedure. How much work an optimiser does, and how that grows, is a question about cost, and cost belongs to another site in this fleet; this one owns duality as an equality and stops there.
The exactness is not fastidiousness either. A vertex is where two constraints hold with equality, and the question asked of it is whether it satisfies the others — several of which it lies exactly on. is a true statement; the same sum in floating point is a lucky one, and a count of feasible vertices that depends on which of those the machine computed is a rounding wearing a decision’s clothes. Every comparison in this family is on rationals.
Where the second number comes from
The dual of that program is subject to and , with : the same coefficients read down the columns instead of along the rows, which is the transpose doing what a matrix does to a grid seen from the other side.
The dual optimum is and , which is what the primal is worth. The rung below stopped there, and it is worth noticing how little that settles about the two coordinates and individually. They are a certificate: a pair of non-negative multipliers that reproduce the objective out of the constraint rows and so bound the maximum from above. Nothing in that description says they mean anything.
Checked at every sample, not quoted
The hero figure is the claim that they do. One right-hand side is swept over a range of whole numbers, the whole program is re-solved from scratch at each of them, and the optimum is drawn as the function of that it is. Then, on each interval of the sweep, two numbers are computed by routes that share nothing:
- the slope, from the difference of the two optima at the interval’s ends;
- the dual variable , from the certificate at the optimal vertex of the program solved at the interval’s midpoint.
They are asserted equal as exact rationals. Over the default sweep that is thirty intervals, and whole values with a midpoint solve between each consecutive pair, so programs are solved to draw one graph. That is a fact about this sweep and not a bound on anything.
The result is three pieces with slopes , and . The middle piece is where the default program sits, and its algebra is short enough to see: with both inequalities binding, and give an optimum worth , so at the value is and the slope is . The dual variable was . Two derivations that never met agree.
That is the sense in which a dual variable is a derivative — of the optimum with respect to a right-hand side, one-sided at the joints, and constant in between.
Two constraints, two lists
Sweeping the other constraint asks a different question of the same program, and the answer is a different rate.
At , the program’s own value, the second piece is in force and the rate is : this is the of the dual optimum , arrived at from the other direction. The two rates are not comparable as measures of importance. Each is a quantity of objective per unit of its own right-hand side, and the two right-hand sides are numbers in different inequalities; a larger rate does not mean a more important constraint any more than one gradient being steeper makes one axis more important than another.
What is comparable is the shape. Both sweeps break twice, both end flat, and both begin steep. That is not an accident of the coefficients. The optimum as a function of one right-hand side is concave and piecewise linear for every linear program, because relaxing a constraint can only help and each successive unit can only help by less once other constraints begin to bind — convexity arriving as a property of the answer rather than of any drawn shape.
A rate is only a rate over an interval
The breakpoints are the whole of the caution. Below the first constraint is worth per unit; above it is worth nothing at all, because by then the second constraint has taken over entirely and further relaxation of the first buys nothing. Anyone quoting “the value of constraint one” as a single number has quoted a value that is correct on one interval and wrong on two.
That is worth staring at, because both figures are correct and one of them cannot see something. The window decides which breakpoints appear; nothing in the narrow figure hints that the rate eventually stops. A rate read off a graph is a statement about the interval it was read on and about nothing outside it.
The joints themselves have no rate. At the slope arriving is and the slope leaving is , so the optimum has no derivative there in the ordinary sense — the function is continuous, kinked, and perfectly well behaved, but the question “what is the constraint worth at ” has two answers. The right-hand-side axis is cut into intervals by which pair of constraints wins, in the same way the plane is cut into regions by which point is nearest, and the boundary belongs to both sides.
Every product is zero
The second consequence is sharper and it is about which constraints matter at all.
The objective here is tilted to , and that is deliberate. Run the same table on the untilted program and it is a true instance that illustrates nothing: at both constraints bind with zero slack, both dual variables are positive — and — and both variables are in use with zero reduced cost, so all four products are zero for the same reason and there is no second reason on display. Tilted, the optimum moves to and the four rows divide two and two.
Read the table row by row. The first constraint binds — , no room to spare — and carries a dual variable of . The second has slack , since , and its dual variable is exactly . The variable is and its reduced cost is ; the variable is held at and its reduced cost is . Every row multiplies to zero, and the two zeroes are not the same zero:
- a constraint with room to spare has a dual variable of zero, because relaxing something that is not pressing changes nothing;
- a variable sitting at zero has a strictly positive reduced cost, because it is sitting at zero for a reason.
That is complementary slackness, and it is an exact statement with no inequality left in it: for every , either the slack is zero or the dual variable is, and never neither.
The two figures are the same sentence in two grammars, and that is the counting-two-ways of this essay. The table says the second constraint’s dual variable is ; the sweep says the optimum does not move when the second constraint is relaxed. Neither was computed from the other.
The constraints that could be deleted
Complementary slackness is therefore a statement about which constraints are doing work, and it is unusually blunt. A constraint with a dual variable of zero can be deleted from the program without moving the optimum. So can the whole crowd of them.
The optimum did not move, and the table says in advance that it could not have. Two constraints out of three are invisible to the answer: the optimum is determined by one inequality and one non-negativity condition, and everything else in the program is scenery. In two variables at most two constraints can be doing the work at any one vertex, however many are written down, and the dual is the object that says which two.
That is the same move as the invention of throwing things away — the observation that a question has a small skeleton and that the rest of the description can be discarded without changing the answer, provided the discarding is justified rather than guessed. Here the justification is a table of products, checked entry by entry, and it is available before anything is deleted.
What the family refuses to draw
Two cases are refused by name rather than drawn badly, and both refusals say something.
The first is a degenerate optimum: three or more constraints passing through the same point. Add to the original program and it passes exactly through , where the two original constraints already meet. The optimum does not move, but the dual optimum stops being a single point — the certificates and both reproduce the objective, both are non-negative, and both are worth the same, since . There is then no such thing as the dual variable of a constraint, and no honest single-valued table of products. The generator tries every pair of binding rows, finds two certificates that disagree, and refuses. Drawing the case is not possible, because what would have to be drawn is a whole set of prices where the picture has one column.
The second refusal is finer. The sweep visits whole numbers, and a breakpoint need not be at a whole number. Sweeping the third constraint of the three-constraint program above meets one at , where the second constraint begins to bind, and the generator stops rather than drawing a straight segment across it. It can tell, because the optimum is solved at each interval’s midpoint too, and a concave function with a kink inside an interval is strictly above the average of its endpoints there. A hidden breakpoint is the only way this drawing could lie, and it is exactly the thing the extra solve is for.
What the picture cannot show
The theorem is a statement about every linear program with a bounded optimum. The figures are one program, or three, and what they establish is finite: on this program, at these sampled right-hand sides, the slope of the optimum equalled the dual variable computed independently, every time, and every complementary product was exactly zero. That is a genuine exhaustion of a small claim, not a small sample of a large one — but it is a small claim.
A finer sweep would add something real and something else not at all. It would add resolution about where the breakpoints are: a sweep in half-units would locate rather than refusing, and a sweep in tenths would place a breakpoint at any tenth. It would not make the equality of slope and dual variable any more general, because that equality is being checked at points, and no number of points is a proof over a continuum. Nor would it reach the theorem’s actual content, which is a claim about programs in any number of variables — where a region has no drawing at all and the argument is a separating hyperplane with no picture in it.
What the drawing does settle is the part most often taken on trust: that the sentence “the dual variable is the rate of change” is a checkable identity between two computed rationals and not a gloss. It has been checked, on every interval of every sweep here, and it has never once been off.
Where the ladder goes next
Two rungs of this anchor have now produced a number that both sides reach, and a reading of the dual’s coordinates as rates that vanish on everything not doing work. The table has only so many shapes a row can take — a constraint with slack and no rate, or a constraint with a rate and no slack; a variable in use with nothing to spare, or a variable held down with something to spare — and a rigid little list of possibilities like that, exhausted rather than sampled, is the same pleasure as three gap lengths and never a fourth.
The next rung takes the same equality into a setting where the two sides are not a program and its transpose but two cautious parties choosing against each other, and the number they meet at acquires a second name. Nothing new is proved there. What changes is what the two numbers are called, and that is exactly the kind of re-labelling that counting one object twice has been doing to this collection from the beginning.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- Why the list of perfect solids stops at five — both name convexity, duality
Named objects
A dashed tag is an object no other essay names yet.
Complementary slacknessConvexityDerivativeDualityFeasible regionLinear programShadow price