Corners, walls and prices
In 1938 the laboratory of the Leningrad Plywood Trust brought a question to the university's mathematicians. The Trust peeled logs into veneer on several kinds of machine, and each machine handled each kind of log at its own speed. The plan fixed the mix of products. How should the work be shared out so the machines turned out as much as possible?
The man they asked was Leonid Kantorovich, 26 and already a professor. He saw that the question was easy to state and awkward to answer. The possible plans form a many-sided shape, the best plan sits at one of its corners, and the standard advice was to work out the value at every corner and compare. That advice, he wrote later, "lost its force since the vertices number was enormous even in very simple problems."
So he stopped looking at corners. He looked for one number per resource, an exchange rate between machine time and output, that would prove a plan was best without comparing it to anything else. He called them resolving multipliers. They are the prices this guide keeps coming back to. Soviet officials attacked the work soon after it appeared; Anatoly Vershik, who studied under him, wrote that it threatened to bury its author "in the most direct sense".
Our mill is smaller than his. It makes two kinds of sheet, 3-ply and 5-ply, from 32 hours of lathe time and 20 hours of press time. The figures are ours, chosen so the arithmetic fits in your head; the question is his. Give it thousands of rows instead of two and it is an airline's crew schedule or a refinery's daily blend.
This guide follows the first eight chapters of Craig Tovey's Linear Optimization and Duality, with that one mill almost the whole way through. Every number on the page is computed in exact fractions by the code beside it, and a test fails if the prose and the code disagree.
0What this is

That walk is the simplex method. George Dantzig devised it in 1947 while planning for the US Air Force, knowing nothing of Kantorovich. It starts at a corner of the shape, moves along an edge to a neighbouring corner worth more, and stops when no neighbour is better. Here it takes two steps: from nothing made, to all 5-ply, to 8 batches of 3-ply and 12 of 5-ply.
Stopping there is a claim, not an observation. The walk compares a corner only with its neighbours, never with plans further away. That a corner which beats its neighbours beats every plan is a theorem, proved for this mill in chapter 2 and in general in chapter 14.
Dantzig did not expect it to work. He pictured it as the animation draws it, crawling round the outside of the shape when a path through the middle looked shorter, and he set it aside. He tested it only after other people's methods had done badly. It was fast, and it has been a workhorse of the subject ever since.
Watch the readout under the picture. In step 1 the lathe hours climb to 32 and stop climbing: the dot has hit the lathe wall. In step 2 the lathe stays at 32 while the press hours climb to 20: the dot slides along the lathe wall until it hits the press wall as well. Each step ends when one more resource runs out.
Getting there takes a few ideas, and each chapter adds one:
- Chapters 1 to 7 set the problem up: what the shape is, why the answer sits on a corner, how to turn a story into a problem, where linear programs stop and yes-or-no decisions begin, and Kantorovich's multipliers, the second problem hiding behind every linear program.
- Chapters 8 to 13 are about the shape itself: walls that separate, shadows, the either-or of Farkas, corners by algebra, and what goes wrong when too many walls meet at one point.
- Chapters 14 to 19 are the walks: Dantzig's along the edges, the rule that keeps it from walking in circles, the walk that repairs a plan from the price side, how far its answer can be trusted, ceilings that need no row, and the walk that starts from the prices.
- Chapter 20 comes back to the multipliers: why a best plan always has them, what happens when it does not exist, and which of them fit best. In 1975 Kantorovich shared the Nobel prize in economics with Tjalling Koopmans, not with Dantzig.
Each idea comes as a picture first and a sentence second. The glossary at the end gives the textbook name for every plain word used here.
1A plan inside the walls
By the end of this page you will be able to look at one row of a linear program, such as 1 × t + 2 × f ≤ 32, and see an arrow, a wall at right angles to it, and which side of the wall is allowed.
The mill makes two kinds of sheet in batches. Each batch uses lathe and press hours, and has a fixed value:
| lathe | press | value | |
|---|---|---|---|
| one batch of 3-ply | 1 hour | 1 hour | 3,000 roubles |
| one batch of 5-ply | 2 hours | 1 hour | 5,000 roubles |
| the mill has | 32 hours | 20 hours |
A plan is two numbers: t batches of 3-ply and f batches of 5-ply. So every plan is a point on a sheet of paper, with 3-ply across and 5-ply up.

Each resource draws one straight line. Below the lathe line are the plans that use at most 32 lathe hours; on the line itself the lathe time runs out exactly. The same goes for the press. Making a negative number of batches is not allowed, so the two axes are walls as well. The shaded region is what is left: every plan the mill can actually carry out.
Take 6 batches of 3-ply and 14 of 5-ply. That uses 20 press hours, all the press time there is, which is fine. It also needs 6 + 28 = 34 lathe hours, two more than the mill has. The point lies just past the lathe line, and that is the whole check. The rest of this page explains why the line is straight, why it sits where it does, and why the allowed side is the origin's side.
One row is a dot product
A plan of t batches of 3-ply and f batches of 5-ply uses 1 × t + 2 × f lathe hours. Put the lathe time each sheet needs per batch into an arrow a = (1, 2), and the plan into an arrow x = (t, f). Multiplying matching entries and adding is the dot product, written a·x. Every row of a linear program is one dot product, and its arrow is the row of numbers in front of the variables.
The dot product has a second meaning, and it is the picture behind every wall. If θ is the angle between the two arrows, a·x = |a| |x| cos θ. The part |x| cos θ is the length of x's shadow on a: drop a line from the tip of x at right angles onto the line through a, and measure from the origin to where it lands.

Watch the two readouts under the picture.
- They agree in every frame. Multiply-and-add is the arithmetic, and length × length × cos θ is the same number seen as a picture.
- x never changes length, yet the lathe time it needs runs from 14.0 up to 31.3 and back down to 28.0. Its direction alone decides that.
- The shadow is longest, all 14 of x, when x points straight along a. Then θ = 0 and cos θ = 1.
So a·x = |a| × (the shadow of x on a). Since |a| = √5 never changes, the lathe time a plan uses is its shadow on a, times √5.
Why the two meanings agree

The two meanings are one fact, and the proof is the triangle in the picture. Its sides are a, x, and the arrow x − a from the tip of a to the tip of x.
Proof that a·x = |a| |x| cos θ. The law of cosines for this triangle says
|x − a|² = |a|² + |x|² − 2 |a| |x| cos θ.
The dot product gives the same side another way. Any arrow v has |v|² = v·v, which is Pythagoras: v·v adds up the squares of the entries. A dot product multiplies out like ordinary brackets, so
|x − a|² = (x − a)·(x − a) = x·x − 2 a·x + a·a = |x|² − 2 a·x + |a|².
The two right-hand sides are equal. Cancel |a|² and |x|², divide by −2, and what is left is a·x = |a| |x| cos θ. ∎
The same algebra finds the shadow. The foot of the drop is the point p = s a on the line through a, with s = a·x ÷ |a|². It is the right point because the drop x − p is at right angles to a:
a·(x − p) = a·x − s (a·a) = a·x − (a·x ÷ |a|²) |a|² = 0.
For x = (6, 8), a·x = 22, so p = (22 ÷ 5) × (1, 2) = (4.4, 8.8). The shadow's length is |p| = a·x ÷ |a| = 22 ÷ √5 ≈ 9.8, and that is |x| cos θ = 10 cos θ.
With three sheet types there is still a triangle, lying in the flat sheet through 0, a and x, and the proof is unchanged. With fifty there is no protractor, so the formula is turned round to define the angle: cos θ = a·x ÷ (|a| |x|). That is an honest cosine only if it lies between −1 and 1, and that is the first basic theorem this guide needs.
Theorem (Cauchy–Schwarz). For any two arrows, |a·x| ≤ |a| |x|, with equality exactly when one is a multiple of the other.
Proof. If a = 0 both sides are 0. Otherwise let p = s a be the foot of the drop from x, with s = a·x ÷ |a|² as above. The drop x − p is at right angles to p, so Pythagoras splits x into two perpendicular pieces:
|x|² = |p|² + |x − p|² ≥ |p|² = (a·x)² ÷ |a|².
Multiply by |a|² and take square roots: |a·x| ≤ |a| |x|. Equality needs |x − p| = 0, which means x = s a. ∎
In words: a shadow is never longer than the arrow that casts it. Every time this guide turns a dot product into a distance, this is the step that does it.
A wall is every plan with the same shadow

Watch the moving line and the three dots.
- The line never turns. Every line a·x = b is at right angles to a, whatever b is.
- A dot is on the line exactly when b equals the lathe time that plan uses. Before the line reaches it the dot uses more than b; after the line passes it, less.
- The faint copies are evenly spaced: each extra 8 lathe hours moves the line 8 ÷ √5 ≈ 3.6 further along a.
Why at right angles? Two plans on the same line use the same lathe time, so the move d from one to the other has a·d = 0. A dot product is zero only when cos θ = 0, so d is at right angles to a.
That is half of the claim: moves inside the wall are at right angles to a. The other half is that every such move stays inside the wall, so the wall is the whole line and not some smaller set inside it. Take a plan y on the wall and any move d with a·d = 0. Then a·(y + d) = a·y + a·d = 32 + 0 = 32, so y + d is on the wall too. Together: the wall is exactly y plus every move at right angles to a. In the plane those moves are the multiples of (2, −1), a line. With n sheet types, a·d = 0 is one equation in n unknowns, so its solutions fill a flat of n − 1 dimensions. That is a hyperplane.

Watch the bar and the tick. While the plan stays on the wall the bar does not move, though the plan travels a long way. The bar moves only when the plan moves along a, and the lathe readout moves with it.
So the lathe wall a·x = 32 is every plan whose shadow on a is 32 ÷ √5 ≈ 14.3. It cuts the sheet into two halves: a·x < 32 on the origin's side and a·x > 32 on the far side. The arrow a points towards the side that uses more lathe time: a step s along a changes the lathe hours by a·(s a) = s |a|² = 5s, which is positive for every s > 0.
How far a plan is from a wall
The faint copies in the moving-line animation sit 8 ÷ √5 apart, not 8, and the lathe wall sits 32 ÷ √5 from the origin, not 32. Hours and distances are different units, and |a| converts one into the other.

Theorem (distance to a wall). Let g = a·x − b be how far a plan x is over the wall a·y = b, counted in hours. The point of the wall nearest to x is x − (g ÷ |a|²) a, and the distance is |g| ÷ |a|.
Proof. The point y* = x − (g ÷ |a|²) a is on the wall, since a·y* = a·x − (g ÷ |a|²)(a·a) = a·x − g = b. Its distance from x is |g| |a| ÷ |a|² = |g| ÷ |a|. Any point y of the wall has a·(x − y) = a·x − b = g, so Cauchy–Schwarz gives |g| ≤ |a| |x − y|, that is |x − y| ≥ |g| ÷ |a|. No point of the wall is closer than y*. ∎
For x = (6, 14): g = 34 − 32 = 2 hours, the nearest point of the wall is (6, 14) − (2 ÷ 5) × (1, 2) = (5.6, 13.2), and the distance is 2 ÷ √5 ≈ 0.89.
The proof says more than the formula. A step of length r changes the lathe hours by a·(step), which is at most |a| r by Cauchy–Schwarz, and exactly |a| r when the step points along a. So |a| = √5 is the most lathe time one unit of distance can add, and a is the direction that adds it fastest. That is why 8 extra hours move the line 8 ÷ √5 along a, and why 32 hours put the wall 32 ÷ √5 from the origin.
The press is the same with the arrow (1, 1), and its wall sits where the shadow is 20 ÷ √2 ≈ 14.1. More sheet types change only the number of entries in the arrows. With three products, a·x = 32 is a flat plane at right angles to a; with any number of products it is called a hyperplane, and each side of it a half-space. The region of possible plans is where all the half-spaces overlap.
The walls are flat because of two assumptions. A second batch of 5-ply uses exactly as much lathe time as the first, and the hours used by the two sheet types simply add up. Problems with those two properties are called linear programs. If later 5-ply batches needed less lathe time than earlier ones, the lathe line would bend, and the methods in this guide would no longer apply as they stand.
Dantzig first presented the idea to the Econometric Society in Madison, in September 1948. When he finished, Harold Hotelling, a prominent statistician, stood up: "But we all know the world is nonlinear." John von Neumann answered on Dantzig's behalf. The speaker had called his talk linear programming and carefully stated his axioms. "If you have an application that satisfies the axioms, well use it. If it does not, then don't." The two assumptions above are those axioms. Our mill satisfies them by construction. A real one satisfies them roughly, and much of the craft is knowing when roughly is enough.
Two facts about the whole region
Count the axes as rows too: t ≥ 0 is −t ≤ 0, with arrow (−1, 0), and f ≥ 0 is −f ≤ 0, with arrow (0, −1). Then the region is the set of plans x with a·x ≤ b for each of its four rows. A set cut out by finitely many rows like this is a polyhedron. Two facts about polyhedra carry the next chapter.
Convex: the segment between two plans is made of plans.
Proposition. If x and y are in a polyhedron, so is every point (1 − s) x + s y with 0 ≤ s ≤ 1.
Proof. For each row, a·((1 − s) x + s y) = (1 − s)(a·x) + s (a·y) ≤ (1 − s) b + s b = b. The step that keeps ≤ multiplies a·x ≤ b by 1 − s and a·y ≤ b by s, which is allowed because neither weight is negative. ∎
For example, halfway between 6 batches of 3-ply and 8 of 5-ply, and 8 and 12, is the plan (7, 10). It uses 27 lathe hours and 17 press hours, so it is a plan, as promised.
Closed: the region includes its own edge. A plan on the lathe wall uses exactly 32 hours, which is allowed. The precise way to say "includes its edge" is that the outside is open: every point outside has a small disc around it that lies entirely outside.

Proposition. Every polyhedron is closed.
Proof. Take a point x outside. It breaks at least one row: a·x > b. Let ε = a·x − b > 0 be how far over it is, in hours, and let r = ε ÷ (2 |a|). Every point of the disc of radius r around x is x + r d for some d with |d| ≤ 1. By Cauchy–Schwarz, a·d ≥ −|a| |d| ≥ −|a|, so
a·(x + r d) = a·x + r (a·d) ≥ a·x − r |a| = b + ε − ε ÷ 2 = b + ε ÷ 2 > b.
Every point of the disc breaks the same row, so the whole disc is outside. The outside is open, which is what closed means. ∎
Each piece of r is there for a reason, and the animation shows what goes wrong without it.
- Why divide by |a|. ε is an excess in hours, and a radius is a distance. A step of length r can cut the lathe hours by up to |a| r, and cuts them by exactly that when it points straight back at the wall. So the excess is used up after a distance ε ÷ |a|, the distance to the wall from the theorem above. Using ε itself as the radius treats hours as distance and is too big by the factor |a|. For x = (6, 14), a disc of radius 2 reaches plans using 34 − 2√5 ≈ 29.5 hours, well inside the wall.
- Why the 2. Any radius below ε ÷ |a| works, and halving is the simplest choice that leaves room. At exactly ε ÷ |a| the disc touches the wall at (5.6, 13.2), which is a plan, so the closed disc is no longer outside. The 2 leaves a margin of ε ÷ 2 hours: at radius 1 ÷ √5 the worst point of the disc uses 34 − 1 = 33 hours.
- Why one row is enough. x only has to break one row to be outside, and the disc only has to keep breaking that same row. The other rows play no part.
Closed, together with bounded, is what guarantees in chapter 2 that a best plan exists at all.
The one thing to remember. A row a·x ≤ b measures each plan's shadow on the arrow a; the plans with shadow exactly b ÷ |a| form a wall at right angles to a, and the allowed side is the side a points away from.
2The best plan sits on a corner
By the end of this page you will see why, whenever a best plan exists, a corner is one of them, and you will have a proof that 8 batches of 3-ply and 12 of 5-ply are best which checks no other corner.
A batch of 5-ply is worth 5,000 roubles, more than the 3,000 roubles for 3-ply. The obvious plan is to make as much 5-ply as possible. A batch of 5-ply needs 2 lathe hours, so the lathe is gone after 16 batches of 5-ply. That plan is worth 80,000 roubles and leaves 4 press hours unused.
It is not the best plan. Swap one batch of 5-ply for two batches of 3-ply: the lathe time stays the same, the press time used goes up by one hour, and the value goes up by 1,000 roubles. Keep swapping until the press time runs out, and the mill reaches 8 batches of 3-ply and 12 of 5-ply, worth 84,000 roubles.
Value is a dot product too
Value is 3 × t + 5 × f, which is c·x for the value arrow c = (3, 5). Everything chapter 1 showed for the lathe arrow holds for c. Plans with the same value have the same shadow on c, so they lie on one line at right angles to c, and more value means a longer shadow along c.

Watch the dark part of the region.
- At 80,000 roubles all 5-ply is on the line, but the dark strip beyond the line is still part of the region. Those plans have more value, so all 5-ply is not best.
- The dark part shrinks as the line moves out, and it disappears at the last point the line touches. That point is the best plan.
- The last point is a corner. The picture suggests why: a straight line leaving a region with straight edges leaves at a corner or along an edge. A picture is not a proof, and the next three sections give one.
There is a best plan
The sweep took for granted that there is a last point to stop at. Some regions have none.

The left region is not bounded: 3t + 5f grows without end and every plan is beaten by another. The right region is not closed. With value t + f, which is just the press hours, every plan is worth less than 20,000 roubles and plans come as close to 20,000 as you like, but none is worth 20,000. Chapter 1's proposition that every polyhedron is closed is what rules this out.
The proof needs two lemmas, and one fact about the real numbers that is assumed rather than proved: completeness. Every set of real numbers with an upper bound has a least upper bound, a number with nothing in the set above it and members of the set as close below it as you like. It is what keeps holes such as √2 out of the number line, and it is the only thing taken on trust in this guide.

Lemma (Bolzano–Weierstrass). Every sequence of points in a bounded region has a subsequence that converges.
Proof. Put the region inside a square; for the mill, 0 ≤ t, f ≤ 20. Cut the square into four quarters. The sequence has infinitely many terms and four quarters cannot each hold only finitely many of them, so some quarter holds infinitely many; keep it. Cut that quarter into four and keep a piece holding infinitely many terms, and so on. The k-th kept square has side 20 ÷ 2^k. Now pick one term from each kept square, each later in the sequence than the last pick; this is possible because every kept square holds infinitely many terms. These picks are the subsequence.
Each kept square lies inside the one before, so the left edges never move left, and no left edge passes any right edge. By completeness the left edges have a least upper bound t*, and it lies between the left and right edge of every kept square. The bottom edges give f* the same way. So the point x* = (t*, f*) is in every kept square. Every pick from step k on lies in the k-th square, which also holds x*, so it is within √2 × 20 ÷ 2^k of x*. That shrinks to 0, so the picks converge to x*. In n dimensions, cut a cube into 2ⁿ pieces instead of four; nothing else changes. ∎
Lemma (a closed set keeps its limits). If points of a closed set converge to x*, then x* is in the set.
Proof. Suppose x* is outside. The outside is open, so some disc of radius r > 0 around x* is entirely outside. Convergence means every term from some point on is within r of x*, so inside that disc and outside the set. But every term is in the set. ∎
Theorem (Weierstrass). A continuous function on a closed, bounded set has a largest value on it.
Proof. Let M be the least upper bound of the values, which completeness provides if they are bounded above; otherwise write M = ∞ for now. Pick points x1, x2, x3, … in the set whose values climb towards M: the k-th worth more than M − 1/k, or more than k if M = ∞. The points stay inside a bounded set, so by Bolzano–Weierstrass some subsequence converges to a point x*. The set is closed, so x* is in it, by the second lemma. The function is continuous, so the values along the subsequence converge to the value at x*; they also converge to M. So M is finite and is reached at x*. ∎
For the mill each condition takes one line.
- Closed: the region is a polyhedron (chapter 1).
- Bounded: every plan has t ≥ 0, f ≥ 0 and t + f ≤ 20, so its length √(t² + f²) is at most t + f ≤ 20.
- Continuous: two plans x and y differ in value by |c·x − c·y| = |c·(x − y)| ≤ |c| |x − y| = √34 |x − y|, by Cauchy–Schwarz. Nearby plans have nearby values.
So the mill has a best plan. Weierstrass says nothing about where it is; the next two sections do.
What a corner is
So far "corner" has meant a point that looks pointed. The definition that proofs can use:
Definition. A corner of the region is a plan that is not the midpoint of two different plans.
(4, 14) is not a corner: it is halfway between all 5-ply, (0, 16), and (8, 12), both plans, along the lathe wall. (8, 12) is a corner, because of its two tight walls. Suppose (8, 12) were the midpoint of plans x and y. Both use at most 32 lathe hours and their average uses exactly 32, so both use exactly 32. The same goes for the press: both use exactly 20. But t + 2f = 32 and t + f = 20 have only one solution, (8, 12) itself, so x = y = (8, 12).
That argument works at any plan where two walls with non-parallel arrows are tight: the two equations pin the plan down, so it cannot be the middle of anything. The next proof needs the other direction.
Lemma. If a plan x is not a corner, some move d ≠ 0 keeps every wall that is tight at x tight: a·d = 0 for each such row.
Proof. x is the midpoint of two different plans, x + d and x − d, so d ≠ 0. For a row tight at x, a·x = b, so a·(x + d) ≤ b and a·(x − d) ≤ b say a·d ≤ 0 and −a·d ≤ 0. So a·d = 0. ∎
Some corner is best

Theorem. If the mill has a best plan, some corner is a best plan.
Proof. Let x* be a best plan. If it is a corner there is nothing to do. If not, the lemma gives a move d ≠ 0 with a·d = 0 for every row tight at x*.
The value does not change along d. The rows that are not tight at x* have hours to spare, so for a small enough step s > 0 both x* + s d and x* − s d are still plans (how small is worked out below). Neither is worth more than x*, so s (c·d) ≤ 0 and −s (c·d) ≤ 0. So c·d = 0: every plan on the line through x* along d is worth exactly as much as x*.
Slide until a new wall is tight. One entry of d is not zero, and moving along d or along −d makes that entry fall. t and f cannot go below 0, so sliding one way or the other some wall is reached. Stop at the first one. The plan there is still best, and it has a new tight wall. Its arrow a′ has a′·d ≠ 0, since sliding along d is what made it tight, while every arrow that was tight before has a·d = 0. So the new arrow is not parallel to any old one.
Repeat. In the plane, two tight walls with non-parallel arrows make a corner, so at most two slides end at a corner worth as much as x*. With n sheet types it takes at most n slides. ∎
How small a step is small enough comes straight from chapter 1. A row with σ hours to spare at x* is σ ÷ |a| from its wall, by the distance theorem, and the step s d covers a distance s |d|. So any s up to σ ÷ (|a| |d|) is safe for that row. That is the closedness proof run the other way, inside instead of outside.
Weierstrass gave the mill a best plan, and this theorem puts one at a corner.
Finding the corners
A corner has two tight walls with non-parallel arrows, so every corner is a crossing point of two of the four walls: lathe, press, t = 0 and f = 0. No two of their arrows are parallel, so each of the 4 × 3 ÷ 2 = 6 pairs crosses exactly once. Not every crossing is a plan.

| walls that cross | t | f | lathe hours | press hours | a plan? |
|---|---|---|---|---|---|
| lathe and press | 8 | 12 | 32 | 20 | yes |
| lathe and f = 0 | 32 | 0 | 32 | 32 | no, too many press hours |
| lathe and t = 0 | 0 | 16 | 32 | 16 | yes |
| press and f = 0 | 20 | 0 | 20 | 20 | yes |
| press and t = 0 | 0 | 20 | 40 | 20 | no, too many lathe hours |
| t = 0 and f = 0 | 0 | 0 | 0 | 0 | yes |
The four crossings that are plans are the four corners, and by the theorem one of them is best:
| corner | 3-ply batches t | 5-ply batches f | value |
|---|---|---|---|
| nothing made | 0 | 0 | 0 roubles |
| all 3-ply | 20 | 0 | 60,000 roubles |
| all 5-ply | 0 | 16 | 80,000 roubles |
| both walls at once | 8 | 12 | 84,000 roubles |
So the question "which of infinitely many plans is best?" becomes "which of four corners is best?". The count grows fast. With 50 sheet types and 100 walls, a crossing point is a choice of 50 walls out of 100, and there are up to C(100, 50) ≈ 1.01 × 10²⁹ of them to try. That is what the simplex method in chapter 14 is for.
How large is too large showed up early. In the autumn of 1947 Jack Laderman at the National Bureau of Standards tried the new method on George Stigler's diet problem: the cheapest mix of 77 foods that meets nine nutritional needs. Nine clerks with hand-operated desk calculators took about 120 working days between them. The answer, $39.69 a year at 1939 prices, beat Stigler's own careful guess by 24 cents.
A proof that checks no other corner
At 8 batches of 3-ply and 12 of 5-ply the lathe and press hours are both used up. Take any other plan x and the move d = x − (8, 12) that gets there. The move cannot use extra lathe time, since there is none, so (1, 2)·d ≤ 0; for the same reason (1, 1)·d ≤ 0. The question is what that says about the value.

Steps 1 to 3 show that c = 2 × (1, 2) + 1 × (1, 1). So for any move d, c·d = 2 × ((1, 2)·d) + 1 × ((1, 1)·d). Watch the readout in step 4.
- The extra lathe and press hours are never positive. Every move that stays in the region uses less of at least one and more of neither.
- The extra value comes from those two numbers alone: twice the extra lathe hours plus the extra press hour.
- Along the lathe wall the lathe change is 0 and the value change equals the press change. Along the press wall it is the other way round, with the lathe change counted twice.
Two times something no bigger than zero, plus one times something no bigger than zero, cannot be positive, so no plan has more value than 84,000 roubles. This works because both multipliers, 2 and 1, are positive: in the picture, c points between the two walls' arrows. Those two numbers come back in chapter 6: 2,000 roubles per lathe hour and 1,000 per press hour.
Why positive matters shows at all 5-ply, (0, 16). The tight walls there are the lathe, arrow (1, 2), and the axis t = 0, arrow (−1, 0). The value arrow still splits along them, c = (3, 5) = 2.5 × (1, 2) − 0.5 × (−1, 0), but one multiplier is negative. A move that stays in the region makes (−1, 0)·d ≤ 0, and −0.5 times a negative number is positive, so the argument fails. It fails for a real reason. The move d = (2, −1), two batches of 3-ply for one of 5-ply, changes the lathe hours by 0 and (−1, 0)·d by −2, and gains 2.5 × 0 − 0.5 × (−2) = 1, that is 1,000 roubles. That is the swap from the start of this chapter. A negative multiplier marks the wall to step away from, and t = 0 is the wall the simplex walk in chapter 0 left on its second step.
This is the move Kantorovich made in 1938. He did not line the Trust's best plan up against the others. He found one multiplier per resource that made every alternative visibly worse, and he called them resolving multipliers. The simplex walk of chapter 0 produces the same two numbers at its last corner, as chapter 14 will show.
Turn the arrow and the corner moves

Read the panels left to right, top to bottom: c turns from steep to flat, and the best corner moves the same way, from all 5-ply to all 3-ply. In between, c = (1, 1) is the press wall's own arrow, so the line of equal value lies flat against the press wall and the whole edge ties. The best plans then fill an edge, but its two ends are still corners, so checking corners still finds the best value.
Change what each sheet is worth →
The one thing to remember. The best plan is the point of the region that reaches furthest along the value arrow c; when a best plan exists, one of the corners is best.
3Writing a problem down
The Trust's real question in 1938 was not how to earn the most roubles. Its veneer had to come out in fixed proportions, and what it wanted to know was how to assign logs to its peeling machines so that as much as possible came out in those proportions. Wanting the most of something is not yet a linear program. This chapter is about the step in between: turning a request in words into rows, and the small tricks that make requests which do not look linear come out linear.
From words to rows
Tovey's advice for this step is concrete. Be the person who decides. Then choose variables as if you could only run the mill by text message: once every variable has a number, nobody on the floor has a choice left to make. For the mill, "t = batches of 3-ply to make this week, f = batches of 5-ply" passes. Three tempting choices fail.
- "t = 3-ply." That is a product, not an instruction. Without a unit, "make 8 3-ply" could mean sheets, batches or tonnes.
- "h = lathe hours to use." Incomplete. Knowing that 32 lathe hours will be used does not say what to make with them.
- t, f, and also h = lathe hours used. Redundant. Once t and f are set, h = t + 2f is set too. It is fine to keep h as a name for a quantity, but it is not a decision.
Each rule then becomes a sentence with units on both sides, and the units have to agree as in physics:
| words | lathe hours used | lathe hours there are | |
|---|---|---|---|
| with units | (1 hour per batch) × (t batches) + (2 hours per batch) × (f batches) | ≤ | 32 hours |
| as a row | t + 2f | ≤ | 32 |
The row is linear because of the two facts chapter 1 took on trust: hours grow in proportion to batches, and the hours of the two products add.
One form for every LP
Rows come out of words in every shape: "at least", "exactly", "can be negative", "as cheap as possible". It pays to rewrite all of them into one form, because the prices of chapter 6 and the simplex method of chapter 14 are defined for that form alone.
Proposition (one form). Every linear program can be rewritten as: maximize c·x subject to Ax ≤ b and x ≥ 0, with the same best plans after a change of names.
Proof. Four rewrites cover every case.
- Minimize c·x. A plan x has c·x ≤ c·y for every plan y exactly when −c·x ≥ −c·y for every y, so minimizing c·x and maximizing (−c)·x pick out the same plans.
- a·x ≥ b. Multiplying by −1 reverses an inequality, so this is the same condition as (−a)·x ≤ −b.
- a·x = b. This holds exactly when a·x ≤ b and a·x ≥ b both hold, and the second becomes a ≤ row by the previous rewrite.
- A variable u that may be negative. Replace it by u⁺ − u⁻ with u⁺, u⁻ ≥ 0. Every number is such a difference, since u = max(u, 0) − max(−u, 0), and every such difference is a number, so the plans reachable before and after are the same. ∎
Two of these have a picture. An equality is a wall with no sides: the plan must sit on it, and the two rows a·x ≤ b and a·x ≥ b are the two half-planes whose overlap is the wall. A free variable is split into two arrows that cancel. The split is not unique, because (u⁺ + s, u⁻ + s) gives the same u for every s ≥ 0. When both parts are positive, the point is the midpoint of the two splits with s moved up and down a little, so by chapter 2's definition it is never a corner. At a corner one of u⁺ and u⁻ is zero, and the split is the honest one.
Complete sets: the largest of the smallest
Say the Trust's order comes in sets of one batch of 3-ply and one of 5-ply. Then t batches of 3-ply and f of 5-ply give min(t, f) complete sets, and the goal is to make that as large as possible. min(t, f) is not linear: it has a crease along t = f, where it switches from following t to following f. The trick is one new variable z, the number of sets, with the rows z ≤ t and z ≤ f, and the objective "maximize z".
Theorem (maximizing a minimum). Let g1, …, gk be linear and P a region of plans. The largest value of min(g1(x), …, gk(x)) over P equals the largest z over all pairs (x, z) with x in P and z ≤ gi(x) for every i, and the best plans x are the same.
Proof. Any pair (x, z) that obeys the rows has z ≤ min gi(x), so the new problem can do no better than the old. For any plan x in P, the pair (x, min gi(x)) obeys every row, so the new problem does at least as well as the old at every plan. The two largest values are therefore equal. At a best pair z = min gi(x), since a smaller z could be raised to min gi(x), so the best x of one problem is a best x of the other. ∎

The plans with at least z complete sets form the quadrant t ≥ z, f ≥ z, an intersection of two half-planes. As z grows the quadrant slides up the diagonal, and the answer is the last z at which it still meets the region. Its tip (z, z) uses 3z lathe hours and 2z press hours, so the press runs out first, at z = 10. The best plan is (10, 10): 10 complete sets, 30 lathe hours with 2 to spare, all 20 press hours, worth 80,000 roubles. The order in sets costs 4,000 roubles against the best plan of chapter 2.
That 10 is best can be shown without the picture, by the move from chapter 2. Add the rows z − t ≤ 0, z − f ≤ 0 and t + f ≤ 20, each with multiplier ½:
½ (z − t) + ½ (z − f) + ½ (t + f) = z ≤ ½ × 20 = 10.
Every plan has z ≤ 10, and (10, 10) reaches it.
The trick has a direction. Minimizing z subject to z ≤ t and z ≤ f is hopeless, because the rows only stop z from going up, and z falls without end. The new variable has to be pushed by the objective against its own rows: maximize a minimum, or minimize a maximum.
Absolute values are a maximum too
|y| = max(y, −y), so minimizing |y| is minimizing a maximum, and by the mirror image of the theorem it is the LP "minimize z subject to z ≥ y and z ≥ −y". Tovey gives a second version that comes up as often: split y = y⁺ − y⁻ with y⁺, y⁻ ≥ 0 and minimize y⁺ + y⁻.
Lemma. Whatever other rows y must obey, a best split has y⁺ = 0 or y⁻ = 0, and then y⁺ + y⁻ = |y|.
Proof. Every split has y⁺ + y⁻ ≥ |y⁺ − y⁻| = |y|, by the triangle inequality. Suppose a best split has both parts positive, and let s be the smaller one. Lowering both by s leaves y⁺ − y⁻, and so y and every other row, unchanged, keeps both parts ≥ 0, and lowers y⁺ + y⁻ by 2s > 0. That contradicts its being best. So one part is 0 and the sum equals |y|. ∎

The same picture shows why maximizing |y| fails. The trick replaces the V by the whole region above it. Minimizing slides down to the V, but maximizing climbs off the top, since nothing in z ≥ y and z ≥ −y stops z from growing. Tovey's example: maximize |y| subject to y = 1. The answer is 1, but the LP "maximize y⁺ + y⁻ subject to y⁺ − y⁻ = 1" allows (1 + s, s) for every s ≥ 0, worth 1 + 2s, and has no best plan. Maximizing |y| over −1 ≤ y ≤ 2 means comparing the two ends; with many such terms the ends multiply, which is why maximizing a maximum is not a linear program.
The largest disc that fits
The same two ideas, one new variable and Cauchy–Schwarz, turn a question of geometry into an LP: what is the largest disc inside the mill's region?
Lemma. The disc of radius r ≥ 0 around x lies in the half-plane a·y ≤ b exactly when a·x + r |a| ≤ b.
Proof. Every point of the disc is x + r d with |d| ≤ 1, and a·(x + r d) = a·x + r (a·d) ≤ a·x + r |a| by Cauchy–Schwarz. So if a·x + r |a| ≤ b, the whole disc obeys the row. Conversely, if a ≠ 0 the point x + r a ÷ |a| is in the disc and gives exactly a·x + r |a|, so if the disc obeys the row this number is at most b. ∎
The factor |a| is the one from chapter 1's closedness proof: the most hours a step of length r can add is r |a|. With the four rows of the mill, the question becomes an LP in t, f and r:
maximize r subject to t + 2f + √5 r ≤ 32, t + f + √2 r ≤ 20, r ≤ t, r ≤ f.
√5 and √2 are only numbers, so every row is linear.

The largest disc has centre (r, r) with r = 20 − 10√2 ≈ 5.86. It touches both axes and the press wall, and misses the lathe wall by 0.59. That this is the largest is proved the chapter 2 way, with multipliers 1, 1, 1 on the press row and the two axis rows:
(t + f + √2 r) + (r − t) + (r − f) = (2 + √2) r ≤ 20,
so every disc that fits has r ≤ 20 ÷ (2 + √2) = 20 − 10√2. Three times now a best answer has been proved by adding rows with multipliers that are not negative. Chapter 6 turns that move from a trick into a method.
The one thing to remember. Write each decision as a number with a unit and each rule as a row whose units agree; a request that maximizes a minimum or minimizes a maximum becomes linear with one new variable that the objective pushes against its rows.
4More rows from words
Chapter 3 had one trick behind several disguises: a new variable, held on one side by rows and pushed against them by the objective. This chapter is the rest of the stock of patterns a working modeller reaches for: costs that get steeper, penalties for falling short, mixtures with a required proportion, stock carried from one week to the next, plans made before the order is known, and one more disc. Each pattern comes with the question that keeps it honest: does the objective really push the new variable where the words say it is?
History. Kantorovich's 1939 booklet, Mathematical Methods of Organizing and Planning Production, grew from a talk he gave at Leningrad State University on 13 May 1939. The plywood problem is only its second appendix. Its chapters work through other kinds of plan, among them the best distribution of arable land between crops. It reached English readers in 1960, in Management Science, because Koopmans pushed for its translation.
Costs that get steeper
Suppose the lathe can run overtime. The first 4 extra hours cost 1,000 roubles each, because the regular crew stays late. The next 4 cost 3,000 each, because a second crew has to be called in. Running u extra hours then costs
h(u) = u for 0 ≤ u ≤ 4, and h(u) = 4 + 3(u − 4) = 3u − 8 for 4 ≤ u ≤ 8.
The two pieces meet at u = 4, where both give 4, and after that the cost rises more steeply. That makes h the larger of the two lines at every u: h(u) = max(u, 3u − 8). A function that is the largest of a few linear ones is called piecewise linear and convex. The smallest of a few linear functions is piecewise linear and concave.
Theorem (convex and concave pieces). If g1, …, gk are linear, then h(x) = max gi(x) is convex: h(λx + (1 − λ)y) ≤ λh(x) + (1 − λ)h(y) for every x, y and 0 ≤ λ ≤ 1. Likewise min gi(x) is concave, with the inequality reversed.
Proof. Fix x, y and λ, and let gj be the piece that attains the maximum at the point λx + (1 − λ)y. Linearity gives gj(λx + (1 − λ)y) = λgj(x) + (1 − λ)gj(y). Each piece is at most the maximum, so gj(x) ≤ h(x) and gj(y) ≤ h(y). Both λ and 1 − λ are nonnegative, which keeps those inequalities pointing the same way after multiplying, so h(λx + (1 − λ)y) ≤ λh(x) + (1 − λ)h(y). For the minimum, apply this to the pieces −gi, because min gi = −max(−gi). ∎
In pictures, the graph of a convex function never rises above the straight segment joining two of its points. It bends up, never down.
The mill now earns 3t + 5f − h(u), with t + 2f ≤ 32 + u, and h is not linear. Chapter 3's trick works again, the other way up. Add one variable z, the overtime bill, with two rows z ≥ u and z ≥ 3u − 8, and subtract z from the objective. The rows only stop z from going down. Maximizing 3t + 5f − z pushes z down, so at any best plan z sits on the higher of the two lines, z = h(u). This is the theorem of chapter 3 with max and min swapped: minimizing a maximum (here, a cost) is a linear program.

How many overtime hours should the lathe run? At the best corner of chapter 2 both walls are tight. Keeping them tight with 32 + u lathe hours means t + 2f = 32 + u and t + f = 20. Subtracting gives f = 12 + u, so t = 8 − u. Each extra hour moves the corner by one batch from 3-ply to 5-ply, which adds 5 − 3 = 2 thousand roubles: the lathe multiplier of chapter 2 again. While t ≥ 0, so for u up to 8, an hour adds 2. The first crew costs 1 an hour, which leaves 1 of gain. The second crew costs 3, which loses 1. So the best plan runs exactly the 4 cheap hours and makes (4, 16): 92,000 roubles of plywood less 4,000 of overtime, 88,000 in all, which is 4,000 more than without overtime.
The overtime can also be written as two variables, u1 ≤ 4 at price 1 and u2 ≤ 4 at price 3, with t + 2f ≤ 32 + u1 + u2. That only works because the cheaper tier comes first. If some plan used dear hours while cheap ones were left, moving one hour from u2 to u1 would leave the lathe exactly as it was and save 3 − 1 = 2, so no best plan does that. Reverse the prices, a dear first crew at 3 and a cheap second crew at 1, and the same argument now runs the wrong way. The LP buys the 4 cheap hours of the second crew without the 4 dear hours that must come before them, reports 88,000 roubles, and describes a plan the mill cannot carry out. The real cost is now concave: discounts for volume. Minimizing a concave cost is not a linear program. Chapter 5 shows what it takes.
Falling short of an order
A buyer orders 14 batches of 5-ply and charges q thousand roubles for every batch short. The shortfall is max(0, 14 − f), the positive part of 14 − f. Write it as a variable u with u ≥ 14 − f and u ≥ 0, and subtract qu from the objective. When q > 0 the objective pushes u down onto the larger of 0 and 14 − f, by the same argument as the overtime bill.
The best plan of chapter 2 makes only 12, so it is 2 batches short. Making another batch of 5-ply means sliding along the lathe wall: one more 5-ply and two fewer 3-ply, which loses 6 − 5 = 1 of value. It saves q of penalty. So the penalty matters only when it is more than 1:
- at q = ½ the mill stays at (8, 12) and pays 1 thousand roubles, keeping 83,000;
- at q = 3 it moves to (4, 14), fills the order, and keeps 82,000.

At q = 3 the move of chapter 2 proves the claim. Take the lathe row with multiplier 3 and the order row, −f − u ≤ −14, with multiplier 1:
3(t + 2f) + (−f − u) = 3t + 5f − u ≤ 3 × 32 − 14 = 82.
The value is 3t + 5f − 3u, which is at most 3t + 5f − u because u ≥ 0. So no plan keeps more than 82, and (4, 14) keeps exactly that. The multiplier on the order says a batch of the order is worth 1 thousand roubles to the mill: the 1 of value lost per batch on the lathe wall.
The trick needs q > 0. With q = 0 nothing pushes u down, and any u ≥ 14 − f is allowed, so u no longer measures anything. The rows say "u is at least the shortfall", never "u is the shortfall". Only the objective can make it equal.
A required proportion
Say the Trust rules that at least three batches in five must be 3-ply: t ÷ (t + f) ≥ 3/5. A ratio is not linear. When t + f > 0, both sides can be multiplied by t + f without turning the inequality round, because t + f is positive:
5t ≥ 3(t + f), that is 3f − 2t ≤ 0.
This is a wall through the origin, the line f = (2/3)t. That it passes through the origin is no accident. Doubling a plan doubles both t and t + f, so the ratio does not change, and every rule about proportions is a wall through (0, 0). The same rows describe blending in general: if product i has quality qi and the mixture must average at least q̄, then Σ qi xi ÷ Σ xi ≥ q̄ becomes Σ (qi − q̄) xi ≥ 0.

The best plan is now (12, 8), worth 76,000 roubles: the rule costs 8,000. Multipliers 19/5 on the press row and 2/5 on the proportion row prove it, since (19/5)(t + f) + (2/5)(3f − 2t) = 3t + 5f, so 3t + 5f ≤ (19/5) × 20 = 76.
One thing is lost in the multiplication. At (0, 0) the ratio is 0 ÷ 0, which means nothing, but the row 3f − 2t ≤ 0 holds. Here that does no harm, because the mill wants to make something. In a model that minimizes cost it can do harm: the cheapest mixture that satisfies the row is no mixture at all, unless another row demands an amount.
Stock that carries over
Two weeks now. In week 1 the mill has its usual 32 lathe hours and 20 press hours, but buyers will take only 8 batches of 5-ply. In week 2 the press is under repair and has 10 hours, and buyers will take 16 batches of 5-ply. A batch of 5-ply can be stored from week 1 to week 2 for 1 thousand roubles. 3-ply sells without limit.
The new rows are balances. What is made either is sold or goes into store:
made in week 1 = sold in week 1 + stored, stored + made in week 2 = sold in week 2.
Each is an equation, so two walls (chapter 3), and they are the only rows that mention both weeks. The best plan:
| 3-ply made | 5-ply made | 5-ply sold | 5-ply stored | |
|---|---|---|---|---|
| week 1 | 8 | 12 | 8 | 4 |
| week 2 | 0 | 10 | 14 |
It is worth 3 × 8 + 5 × 8 + 5 × 14 − 4 = 130 thousand roubles. Week 2 cannot make enough 5-ply, because its press runs out at 10 batches. So week 1 makes the plan of chapter 2 and stores the 4 batches its own buyers will not take. Why not store more? A 6th or 7th batch for week 2 would have to come from sliding week 1 along its lathe wall: 6 roubles of 3-ply given up, 1 of storage paid, 5 earned in week 2, a loss of 2.
The multipliers that prove this plan best are, in thousands of roubles: 1 for a week-1 lathe hour, 2 for a week-1 press hour, 5 for a week-2 press hour, 4 for a batch of 5-ply in week 1's balance, 5 in week 2's, and 1 for a week-1 buyer. The week-2 lathe gets 0, because 12 of its hours are idle. The two balances differ by exactly the cost of storage, 5 − 4 = 1. This is what the balances are for: a 5-ply batch in week 1 is worth what it will fetch in week 2, less the cost of keeping it. Chapter 7 shows how to read prices like these, and the tests check that they add up to 130.
The same balance governs every network: water through pipes, passengers through airports, money through accounts. In at every node equals out.
Deciding before the order is known
Go back to one week and the order of 5-ply, with a penalty of 3 thousand roubles per missing batch. But now the order will be either 12 or 16 batches, and the mill must fix its plan before it knows which. The plan (t, f) is one choice for both cases. The shortfall is not: if the order is 12 the mill is u12 short, if it is 16 it is u16 short, with u12 ≥ 12 − f, u16 ≥ 16 − f, and both ≥ 0. With probabilities p12 and p16, the mill maximizes its expected earnings,
3t + 5f − 3(p12 u12 + p16 u16).
That is still linear, because the probabilities are numbers known in advance, not variables. The plan has no index for the case; the shortfalls do. That asymmetry is the whole model: a decision made now cannot depend on something learned later.
Between 12 and 16 batches each extra batch of 5-ply costs 1, sliding along the lathe wall. It saves 3 only if the order turns out to be 16, so 3 × p16 on average. It is worth making when 3p16 > 1, that is p16 > 1/3:
- with p16 = ½ the mill makes 16 batches of 5-ply and no 3-ply, and expects 80,000 roubles;
- with p16 = ¼ it makes the plan of chapter 2 and expects 84 − 3 × ¼ × 4 = 81 thousand roubles.
In neither case is it the plan for the average order, which would be 14 batches when p16 = ½ and 13 when p16 = ¼. What decides is the chance of the larger order against the ratio of cost to penalty.
The smallest disc that reaches every wall
Chapter 3 found the largest disc inside the region. The opposite question has a different answer: the smallest disc that meets all four lines, the lathe wall, the press wall and the two axes, wherever its centre is. A disc of radius r centred at x meets the line a·y = b exactly when the distance from x to the line is at most r, and chapter 1 measured that distance:
r ≥ |a·x − b| ÷ |a| for every wall.
This is a minimum of a maximum of absolute values, so each wall gives two rows, r ≥ (a·x − b) ÷ |a| and r ≥ (b − a·x) ÷ |a|, and the objective is "minimize r". Both rows are needed. With the centre at (0, 0) and the lathe wall, a·x − b = −32, and the first row alone would allow r = 0, a disc of no size that is nowhere near the wall. The second row is what says r ≥ 32 ÷ √5.

The best disc touches both axes, so its centre is (r, r), and it just reaches the lathe wall:
(32 − r − 2r) ÷ √5 = r, so r = 32 ÷ (3 + √5) = 24 − 8√5 ≈ 6.11.
To prove nothing smaller works, add three of the rows. For any centre (t, f), r ≥ t, r ≥ f and r ≥ (32 − t − 2f) ÷ √5. Multiply them by 1, 2 and √5, divided by 3 + √5, and add. The t and f terms cancel, the r terms add to r, and what is left is r ≥ 32 ÷ (3 + √5). The multipliers are positive, so the inequalities keep their direction. The press wall plays no part: the disc crosses it, 5.50 from the centre.
The two discs answer opposite questions. The disc inside must keep away from its nearest wall, and the press wall stops it. The disc that reaches must get to its farthest wall, and the lathe wall stops it.
The one thing to remember. A new variable means what the words say only if the objective pushes it against its rows. Before trusting one, ask which way the objective moves it, and what stops it.
5Yes-or-no decisions
Some words do not turn into rows at all. "Either none, or at least 14." "Pay the setup only if the line runs." "One rule or the other." This chapter shows why no linear program can say them. Then it adds the one ingredient that can, a variable allowed only the values 0 and 1, and counts what that ingredient costs.
A rule no wall can make
The 5-ply buyer now takes either nothing or a full contract of at least 14 batches. The plans that obey are those with f = 0 and those with f ≥ 14. Both (20, 0) and (4, 14) are allowed, but their midpoint (12, 7) is not, because 7 is neither 0 nor at least 14.
Chapter 1 proved that every region cut out by walls is convex: the segment between two of its plans stays inside. This set of plans contains two points and not their midpoint, so it is not convex, and no list of walls, however long, has it as its region. The words cannot be written as an LP. Something other than walls is needed.

A variable that is 0 or 1
Add z, which can only be 0 or 1, read as "the contract is taken". Then write
14z ≤ f ≤ 16z.
Check both cases, because that is the only way to trust such a pair of rows. At z = 0 they say 0 ≤ f ≤ 0, so f = 0. At z = 1 they say 14 ≤ f ≤ 16. The 16 is not arbitrary: the lathe alone allows at most 32 ÷ 2 = 16 batches of 5-ply, so f ≤ 16 removes no plan the mill could make anyway.
A problem whose rows and objective are linear but which has some variables restricted to whole numbers is a mixed-integer linear program. It is not a linear program, and none of the theory of chapters 6 to 20 applies to it as it stands. With one yes-or-no variable it can still be solved by trying both values. At z = 1 the best plan is (4, 14), worth 82. At z = 0 it is (20, 0), worth 60. So the mill takes the contract and keeps 82,000 roubles. With k such variables there are 2^k cases to try, which is why problems with them are hard and the methods for them are a subject of their own.
History. The standard method for mixed-integer programs, branch and bound, was published in 1960 by Ailsa Land and Alison Doig at the London School of Economics. It avoids trying all 2^k cases by solving relaxations, described next, and discarding every case whose relaxation already does worse than a plan in hand.
The relaxation, and why it is too hopeful
Allow z anywhere from 0 to 1 instead of only 0 or 1. The result is a linear program again, the relaxation. It answers 84, at (8, 12) with z = ¾: the rows 14z ≤ 12 ≤ 16z hold for any z between ¾ and 6/7. The plan of chapter 2 comes back, with three quarters of a contract.
Theorem. The best value of the relaxation is at least the best value of the mixed-integer program.
Proof. Every pair (x, z) with z equal to 0 or 1 also has 0 ≤ z ≤ 1, so every plan the integer program allows is allowed by the relaxation. The best of a larger set is at least the best of a smaller one. ∎
That is the use of the relaxation: it is a ceiling, 84 here against the true 82, and it is quick to compute. A tighter ceiling is more useful, and how tight it is depends on how the rows are written.
Paying for a setup
Return to the plain mill, without the contract. Running the press for 5-ply needs a change of glue that costs F thousand roubles, once, if any 5-ply is made. With z = 1 meaning "set up for 5-ply":
maximize 3t + 5f − Fz, with f ≤ Uz and z equal to 0 or 1,
where U is any number at least the most 5-ply the mill could make. At z = 0 the row forces f = 0. At z = 1 it says f ≤ U, which removes nothing. And since F > 0, the objective never sets z = 1 without making some 5-ply.
With F = 30 the cases are: set up, make (8, 12), and keep 84 − 30 = 54; or do not set up, make (20, 0), and keep 60. The mill makes no 5-ply.
In the relaxation, z only has to be at least f ÷ U, and z costs money, so it sits exactly there. The setup is then charged by the batch, F ÷ U per batch, instead of all at once. With U = 16, the smallest valid bound, the relaxation's answer is 61.5 at (8, 12) with z = ¾: it pays 22.5 of the 30. With U = 100, also a valid bound but a careless one, it is 80.4, with z = 3/25 and a setup cost of 3.6. Both ceilings are true. Only the first is close.

One rule or the other
The last pattern switches a whole wall on and off. Say a safety rule allows either at most 6 batches of 3-ply, or at most 6 batches of 5-ply. With z choosing which rule binds:
t ≤ 6 + M1 z, f ≤ 6 + M2 (1 − z).
At z = 0 the first row is t ≤ 6, and the second must not cut anything. At z = 1 it is the other way round. A row that is "switched off" has to be switched off for real.
Theorem (a valid M). Let X be the plans allowed by the other rows. The row a·x ≤ b + M removes no plan of X exactly when M ≥ a·x − b for every x in X, that is, M is at least the largest amount by which a plan of X breaks the rule.
Proof. The row holds at x exactly when a·x − b ≤ M. It holds at every x in X exactly when M is at least every one of these numbers. ∎
For the mill, the largest t is 20 and the largest f is 16, so M1 must be at least 20 − 6 = 14 and M2 at least 16 − 6 = 10. If X were unbounded in the direction a, no M would be large enough, and the trick would fail.
With valid bounds the two cases give: rule t ≤ 6, best plan (6, 13) worth 83; rule f ≤ 6, best plan (14, 6) worth 72. So the mill takes the first rule and keeps 83,000 roubles.

Now take M2 = 6, too small by 4. At z = 0 the second row should be switched off, but it still says f ≤ 12. That removes (6, 13), and the model reports (6, 12), worth 78. It is not an error message. It is a wrong answer that looks like every other answer. A small M can cut off the true best plan, and a large M weakens the relaxation, as in the setup. The right M is the smallest valid one, computed from the rows, not guessed.
The steeper-then-cheaper overtime of chapter 4 needs the same tool. Let w = 1 mean the second crew is called. Then u1 ≥ 4w says the first crew's 4 hours are used up before the second crew starts, and u2 ≤ 4w says the second crew works only if called. Both cases tie at 84: no overtime, or all 8 hours at (0, 20), where 16 of extra value pays exactly 3 × 4 + 1 × 4 = 16 of cost. The LP of chapter 4 had reported 88 for a plan that could not be carried out.
Textbooks also have a "big M method", which shares only the name. It puts a large penalty on chapter 14's artificial variables to find a first corner for the simplex method. It has no yes-or-no variables and keeps everything a linear program.
The one thing to remember. Walls only make convex regions. A rule with an "or" in it needs a 0-or-1 variable; check both of its values by hand, and use the smallest M that removes nothing it should not.
6Someone buying the hours
Three times now a best plan has been proved best by the same move: give each row a multiplier that is not negative, add the rows up, and find the value sitting on the left with a number on the right. Each time the multipliers were found by staring at the answer. This chapter asks where they come from, and the answer is a second linear program hiding inside the first.
An offer for the whole stock
Suppose a buyer comes to the Trust and offers to rent every hour the mill has: y₁ roubles (in thousands) for each lathe hour and y₂ for each press hour. The mill would be paid 32y₁ + 20y₂ and make nothing. When should it say yes?
Look at one batch of 3-ply. It takes one lathe hour and one press hour, so renting those hours out instead earns y₁ + y₂. Making the batch earns 3. If y₁ + y₂ < 3, the mill does better keeping the hours and pressing 3-ply. The same goes for 5-ply, which takes two lathe hours and one press hour and is worth 5. The offer is fair, in the sense that no batch the mill could make is worth more than the hours it uses, exactly when
| lathe price | press price | value | ||
|---|---|---|---|---|
| 3-ply's hours | 1 × y₁ | + 1 × y₂ | ≥ | 3 |
| 5-ply's hours | 2 × y₁ | + 1 × y₂ | ≥ | 5 |
with y₁, y₂ ≥ 0, since a negative price would mean the mill pays to give hours away. The buyer wants to pay as little as possible. So the buyer has an LP of their own: minimize the bill 32y₁ + 20y₂ subject to the two rows. It is called the dual of the mill's problem, and the mill's problem is then the primal.
Look at where its numbers came from. The mill's table had a row for each resource and a column for each product. The buyer's table has a row for each product, and that row is the product's column in the mill's table: the hours one batch uses. The stocks 32 and 20, which were the mill's right-hand side, are the buyer's costs, and the values 3 and 5 have become the buyer's right-hand side. Written with the matrix A of chapter 3, the mill's problem is maximize c·x with Ax ≤ b and x ≥ 0, and the buyer's is minimize y·b with yA ≥ c and y ≥ 0. Nothing has been added. The same numbers have been read down the columns instead of across the rows.

The fair offers form a region of their own, cut out by the products' walls in the plane of prices. It has three corners: (0, 5) with a bill of 100,000 roubles, (3, 0) with 96,000, and (2, 1) with 84,000. It is not bounded, which is right: a buyer can always offer more. What it does have is a floor. The cheapest fair offer is 2,000 roubles a lathe hour and 1,000 a press hour, the same 2 and 1 that chapter 2 used to prove (8, 12) best. The buyer's cheapest bill is 84,000 roubles, and that is what the mill's best plan earns.
That those two numbers agree is not a coincidence of this mill. But the first thing to prove is weaker, and it is the half that does the work.
Every fair bill is a ceiling
Theorem (weak duality). If x is any plan (Ax ≤ b, x ≥ 0) and y is any fair offer (yA ≥ c, y ≥ 0), then c·x ≤ y·b.
Proof. Three steps:
c·x ≤ (yA)·x = y·(Ax) ≤ y·b.
- The first ≤. (yA)·x − c·x = (yA − c)·x = Σⱼ ((yA)ⱼ − cⱼ) xⱼ. Every bracket is ≥ 0 because the offer is fair, and every xⱼ is ≥ 0 because batches cannot be negative, so every term of the sum is ≥ 0.
- The equals sign. Both sides are Σᵢ Σⱼ yᵢ Aᵢⱼ xⱼ: one adds each row's contributions first, the other each column's.
- The second ≤. y·b − y·(Ax) = Σᵢ yᵢ (bᵢ − Aᵢx). Every yᵢ is ≥ 0, and every bᵢ − Aᵢx is ≥ 0 because the plan fits the stock. ∎
Each step has a reading in roubles. c·x is what the plan earns. (yA)·x is what the hours the plan uses would fetch from the buyer, priced product by product. y·(Ax) is the same sum priced machine by machine. y·b adds the hours the plan leaves idle, which the buyer pays for too. So the two gaps in the chain are two different kinds of waste:
- the first gap is value lost by making something whose hours are worth more than the product;
- the second gap is money the buyer pays for hours the plan does not use.
Take the best plan (8, 12) against the fair but expensive offer (3, 0). The plan earns 84. Its hours priced product by product, at 3 for a 3-ply batch and 3·2 + 0·1 = 6 for a 5-ply batch, come to 3·8 + 6·12 = 96. Priced machine by machine, all 32 lathe hours at 3 and all 20 press hours at 0, they come to 96 again, and the plan leaves nothing idle, so the bill is 96. The whole gap of 12 sits in the first step: at these prices each 5-ply batch is worth one more in hours than in plywood, and the plan makes 12 of them.
Now the plan that makes only 5-ply, (0, 16), against the cheapest offer (2, 1). Here every product is priced exactly at its value, so the first step is an equality: 80 = 80. But the plan leaves 4 press hours idle, and the buyer pays 1 for each, so the bill is 84. The whole gap of 4 sits in the second step.

The theorem says more than the example. Every plan, not just the four corners, earns at most every fair bill, so a single fair offer is a ceiling on the whole region, and a single plan is a floor under every offer. When a plan and an offer meet, as (8, 12) and (2, 1) meet at 84, neither can be improved: the plan is under a ceiling it touches, and the offer is over a floor it touches. That is the proof of chapter 2 again, now read as a consequence of a theorem rather than an accident of the arithmetic.
Corollary. (i) If a plan x and a fair offer y have c·x = y·b, both are best. (ii) If the mill's values have no upper limit, there is no fair offer. (iii) If fair offers can be made as cheap as you like, there is no plan.
Proof. (i) Every plan x′ has c·x′ ≤ y·b = c·x, and every fair offer y′ has y′·b ≥ c·x = y·b. (ii) A fair offer y would cap every plan's value at y·b. (iii) A plan x would put a floor c·x under every bill. ∎
Case (ii) is easy to meet. Take the mill with only the rule t − f ≤ 4: the 3-ply never runs more than 4 batches ahead of the 5-ply. Plans can grow along t = f without end. The dual has one price y ≥ 0 and the two rows y ≥ 3 and −y ≥ 5, which no number satisfies. The buyer has no fair offer to make because there is nothing finite to pay for.
History. In October 1947 Dantzig met John von Neumann to describe his linear programs. Von Neumann saw the dual, and the duality theorem, as fast as the problem was explained: he cited Farkas's lemma and guessed that it was the same theorem as his own minimax theorem for two-person games, which Dantzig later checked. Dantzig wrote and circulated the first proof within months but never published it, because he thought of it as von Neumann's. The first published proof is Gale, Kuhn and Tucker's, in 1951. (Tovey, §5.5 notes.)
Why the signs are what they are
The proof used two facts about signs: xⱼ ≥ 0 made each term ((yA)ⱼ − cⱼ) xⱼ safe, and yᵢ ≥ 0 made each yᵢ (bᵢ − Aᵢx) safe. Real problems have rows that say ≥ or =, and variables that can be negative (chapter 3 removed them, but removing them is not always convenient). Each such change breaks one term of the proof, and the dual has to change to mend it.

The picture shows what a broken sign costs. With yA − c = (0, −1), the offer undervalues 5-ply, and the first step fails for every plan that makes some. At (0, 16) the plan earns 80 while the bill is 32 + 40 = 72. A price that is not fair is not a ceiling.
So the rule is: choose each sign so that every term in the proof is ≥ 0 whatever the plan does. For a maximization:
| in the primal (maximize) | the term in the proof | so in the dual |
|---|---|---|
| row i says ≤ | yᵢ × (a slack ≥ 0) | yᵢ ≥ 0 |
| row i says ≥ | yᵢ × (a slack ≤ 0) | yᵢ ≤ 0 |
| row i says = | yᵢ × 0 | yᵢ any sign |
| xⱼ ≥ 0 | ((yA)ⱼ − cⱼ) × (a number ≥ 0) | (yA)ⱼ ≥ cⱼ |
| xⱼ ≤ 0 | ((yA)ⱼ − cⱼ) × (a number ≤ 0) | (yA)ⱼ ≤ cⱼ |
| xⱼ any sign | ((yA)ⱼ − cⱼ) × (any number) | (yA)ⱼ = cⱼ |
Each line is forced. A product of a fixed number with an unknown number of known sign is ≥ 0 every time only if the fixed number has that sign too, and a product with an unknown number of either sign is ≥ 0 every time only if the fixed number is 0. That is the whole table. There is nothing to memorize: rebuild it from the chain whenever you need it.
For a minimization the chain runs the other way, c·x ≥ (yA)·x = y·(Ax) ≥ y·b, so every term must be ≤ 0 instead, and every line flips: a ≥ row gets yᵢ ≥ 0, a ≤ row gets yᵢ ≤ 0, an = row a free yᵢ, xⱼ ≥ 0 gets (yA)ⱼ ≤ cⱼ, xⱼ ≤ 0 gets (yA)ⱼ ≥ cⱼ, and a free xⱼ gets (yA)ⱼ = cⱼ.
An equality row gets a free price, and that has a meaning. With Ax = b the mill must use exactly its stock, so an hour can be worth a negative amount: being forced to use it may cost money. A ≤ row lets the mill leave hours idle, and an idle hour cannot be worth less than nothing.
Proposition (the dual of the dual is the primal). Apply the table to the buyer's problem, minimize y·b with yA ≥ c and y ≥ 0, and the result is the mill's problem.
Proof. The buyer minimizes, has a ≥ row for each product j, and a price yᵢ ≥ 0 for each resource. By the minimization table each ≥ row gets a new variable xⱼ ≥ 0, and each yᵢ ≥ 0 gets a row that says (Ax)ᵢ ≤ bᵢ, where the new problem's objective is to maximize Σⱼ cⱼ xⱼ. That is maximize c·x with Ax ≤ b and x ≥ 0. ∎
So "primal" and "dual" are not two kinds of problem. They are the two ends of one pair, and it does not matter which end you start from. A textbook that writes the pair as minimize c·x with Ax ≥ b, x ≥ 0 and maximize y·b with yA ≤ c, y ≥ 0 is writing the mill and the buyer with the names swapped.
The three certificates, again
Every proof so far was a fair offer in disguise.
- Chapter 2. The multipliers 2 and 1 on the lathe and press rows are the buyer's cheapest offer. Its bill, 84, meets the plan (8, 12).
- Chapter 3, complete sets. The rows were lathe, press, z − t ≤ 0 and z − f ≤ 0, and the multipliers were 0, ½, ½ and ½. They are a fair offer for the problem "maximize z": the column of t gets ½ − ½ = 0 against a value of 0, the column of f the same, and the column of z gets ½ + ½ = 1 against a value of 1. The bill is ½ × 20 = 10, which is where the plan (10, 10, 10) sits.
- Chapter 3, the largest disc. Multipliers 1, 1 and 1 on three rows gave (2 + √2) r ≤ 20. Divide them by 2 + √2 and each becomes 1 − √2 ÷ 2 ≈ 0.29. That is a fair offer for "maximize r", and its bill is 20 − 10√2, the radius.
In each case the buyer's problem was there to be solved. It was solved by eye because it was small. From here on it is solved on purpose.
What weak duality cannot say is that a meeting always happens: that for every LP with a best plan, some fair offer bills exactly its value. That is the strong duality theorem. It is true, and it is proved three times later: from the walk of the simplex method (chapter 15), from Farkas's lemma, which is separation written as algebra (chapter 20), and from the directions at a best plan (also chapter 20). Until then it is a promise, and the chapters in between do not use it.
The one thing to remember. Price every resource so that no product is worth more than the hours it uses; then whatever plan you choose earns at most the bill, so one such price list proves a plan best by meeting it.
7What one more is worth
Kantorovich did not call his multipliers prices. Later he called them objectively determined valuations, and his critics heard prices anyway, a market sneaking into the plan. This chapter shows what the valuations measure: what one more hour of a machine adds to the best plan, and over what range that holds. Then it gives the two rules that link a best plan to its prices without solving anything.
One more lathe hour
Give the lathe b hours instead of 32 and keep the press at 20. While both walls are tight at the best corner, t + 2f = b and t + f = 20. Subtracting gives f = b − 20, so t = 40 − b. The value there is
3(40 − b) + 5(b − 20) = 2b + 20,
which gives 84 at b = 32. Each extra lathe hour adds exactly 2 thousand roubles: one batch moves from 3-ply to 5-ply, and 5 − 3 = 2. That is the lathe multiplier of chapter 2.
The formula holds only while the corner exists. It needs t = 40 − b ≥ 0 and f = b − 20 ≥ 0, so 20 ≤ b ≤ 40. Outside that range a different corner is best:
| lathe hours b | best plan | value | worth of one more hour |
|---|---|---|---|
| 0 to 20 | (b, 0) | 3b | 3 |
| 20 to 40 | (40 − b, b − 20) | 2b + 20 | 2 |
| 40 and more | (0, 20) | 100 | 0 |
Below 20 hours the lathe is so short that the press has hours to spare, and the best use of a lathe hour is a whole batch of 3-ply. Above 40 the press is the limit, and the lathe hours beyond 40 sit idle and add nothing.

The press works the same way. With the lathe at 32 and the press at b hours, the tight corner is t = 2b − 32, f = 32 − b, with value b + 64. That gives 84 at b = 20 and adds 1 per press hour, for 16 ≤ b ≤ 32. Below 16 a press hour is worth 5 (all 5-ply, the lathe idle), and above 32 it is worth 0.
Theorem (the price inside its range). For lathe stock b between 20 and 40, with the press at 20, the best value is exactly 2b + 20, the bill of the offer (2, 1) for the stock (b, 20).
Proof. The fair offers do not depend on the stock: the rows y1 + y2 ≥ 3 and 2y1 + y2 ≥ 5 mention only the products' values and hours. So (2, 1) is fair for every stock, and by weak duality (chapter 6) no plan earns more than its bill, 2b + 20. The plan (40 − b, b − 20) is a plan when 20 ≤ b ≤ 40, and it earns exactly 2b + 20. A plan that reaches a ceiling is best. ∎
The proof uses no picture and no list of corners, and it shows why the price can be trusted only on a range. The ceiling 2b + 20 is valid for every b. What fails outside the range is the plan that reaches it.
The value is the cheapest bill
The three rows of the table are three bills. The offer (3, 0) bills 3b for the stock (b, 20), the offer (2, 1) bills 2b + 20, and the offer (0, 5) bills 100. These are the three corners of the buyer's region from chapter 6. On every range the best value is the smallest of the three:
value(b) = min(3b, 2b + 20, 100).
At b = 10 the bills are 30, 40 and 100, and the value is 30. At b = 32 they are 96, 84 and 100, and it is 84. At b = 50 they are 150, 120 and 100, and it is 100. A minimum of linear functions is concave (chapter 4), so the value bends downwards: each extra lathe hour is worth no more than the one before, 3, then 2, then 0. That the value is the cheapest fair bill for every stock, in every LP, is the strong duality theorem, proved in chapters 15 and 20. For the mill the table has just checked it on every range.

At the bends the price is not one number. At b = 20 the offers (3, 0) and (2, 1) bill the same 60, and the next hour is worth 2 while the last one was worth 3. Chapter 12 is about what goes wrong there.
Two rules that link a plan to its prices
Chapter 6 split the gap between what a plan earns and what an offer bills into two sums:
- gap 1 = Σ over products of (hours' worth − value) × batches made;
- gap 2 = Σ over resources of price × hours left idle.
Every term of both sums is ≥ 0. A sum of nonnegative terms is zero only if every term is zero, so a plan and a fair offer meet, c·x = y·b, exactly when both of the following hold.
Theorem (complementary slackness). A plan x and a fair offer y have c·x = y·b if and only if
- every resource with hours left idle has price 0: if Aᵢx < bᵢ then yᵢ = 0;
- every product that is made is priced exactly at its value: if xⱼ > 0 then (yA)ⱼ = cⱼ.
Proof. c·x = y·b exactly when gap 1 + gap 2 = 0. Both gaps are sums of terms ≥ 0, so this happens exactly when every term is 0. A term of gap 2 is yᵢ(bᵢ − Aᵢx), and it is zero exactly when yᵢ = 0 or the resource is used up, which is rule 1. A term of gap 1 is ((yA)ⱼ − cⱼ)xⱼ, and it is zero exactly when xⱼ = 0 or the product is priced at its value, which is rule 2. ∎
By chapter 6, a plan and an offer that meet are both best. So the rules certify optimality: find a fair offer that obeys them with your plan, and the plan is best. The converse, that every best plan has such an offer, needs strong duality, and waits for chapter 15.
The rules turn a guess at the plan into equations for the prices. Guess (8, 12). Both products are made, so rule 2 says both are priced exactly: y1 + y2 = 3 and 2y1 + y2 = 5. That gives y = (2, 1). It is ≥ 0, so it is fair, and the plan is best. No corner was compared with any other.
Guess (0, 16) instead. The press has 4 hours idle, so rule 1 sets y2 = 0. The 5-ply is made, so rule 2 says 2y1 + y2 = 5, and y1 = 5/2. The 3-ply is not made, so rule 2 says nothing about it, but the offer must still be fair, and y1 + y2 = 5/2 is less than 3. The only prices the rules allow are not fair, so no fair offer meets this plan, and (0, 16) is not best. This is the split 2.5 and −0.5 from chapter 2, now with a reason: the price that rules allow leaves 3-ply worth more than its hours.
The rules explain the zeros seen so far. In chapter 3 the plan with 10 complete sets left 2 lathe hours idle, and its multiplier on the lathe row was 0. In chapter 4 the second week left 12 lathe hours idle and its lathe price was 0. Spare capacity is worth nothing at the margin, however much it cost to buy.
The one thing to remember. A resource's price is what one more unit adds to the best plan, valid only between the bends where the best corner changes; and a best plan and its prices fit together by two rules: idle resources are free, and whatever is made is worth exactly its resources.
8A wall between a point and a shape
The Trust can always ask for more than the mill can make. Say it asks for 11 batches of 3-ply and 16 of 5-ply. The plan needs 43 lathe hours and 27 press hours, so it is out of reach, and saying so is easy. Proving it to someone who distrusts the arithmetic, with one inequality they can check, is the question of this chapter. The answer is a wall: a line with the order on one side and every possible plan on the other. Chapters 10 and 20 build the theory of linear programming on it.
The nearest plan
Every plan is somewhere, and the order (11, 16) is outside. Among all plans, take the one nearest to it. The candidates are where the region is closest: the two walls and the corner where they meet.
- The press wall t + f = 20: its nearest point to (11, 16) would be the foot of the drop, (7.5, 12.5), which uses 32.5 lathe hours. That is not a plan.
- The lathe wall t + 2f = 32: its foot is (8.8, 11.6), which uses 20.4 press hours. That is not a plan either.
Both feet fall outside the region, so the nearest plan is where the two walls meet, the corner s* = (8, 12), at distance √(3² + 4²) = 5. (Step 2 below gives a test that confirms it without this case analysis.)

Now draw the segment from the order to s*, and the line through its midpoint at right angles to it. The segment points along (8, 12) − (11, 16) = (−3, −4), so the line is 3t + 4f = constant, and the midpoint (9.5, 14) fixes the constant at 3 × 9.5 + 4 × 14 = 84.5. Check the two sides:
- the order: 3 × 11 + 4 × 16 = 97, above 84.5;
- every plan: 3t + 4f is at most 72, the value at (8, 12), because 3t + 4f = 1 × (t + 2f) + 2 × (t + f) ≤ 32 + 2 × 20 = 72.
The second line is a multiplier certificate of the chapter 2 kind, with multipliers 1 and 2. The wall is a proof anyone can check: no plan has 3t + 4f above 72, and the order has 97.
The line is not parallel to either wall of the mill. Its direction (3, 4) is 1 × (1, 2) + 2 × (1, 1), a mixture of the two walls that meet at s*. When the nearest plan is on an edge instead of a corner, the wall comes out parallel to that edge. The order (14, 10), for instance, has its nearest plan at (12, 8), the foot on the press wall, at distance 2√2, and the separating line is t + f = 22.
The theorem
Theorem (separating a point from a closed convex set). Let S be a closed convex set with at least one point, and x a point not in S. Then there is a vector π and a number π0 with π·x < π0 < π·s for every s in S.
The sign convention puts x below the line and S above it. For the mill, π = (−3, −4) and π0 = −84.5, which is the same line as above multiplied by −1.
The proof has three steps, and each one uses something from chapters 1 and 2.
Step 1 (a nearest point exists). Take any s0 in S, and let R = |x − s0|. Points of S further than R from x cannot be nearest, so look only at S ∩ B, where B is the closed disc of radius R around x. That set is closed (an intersection of two closed sets), bounded and not empty, and the distance |x − s| is continuous in s. By Weierstrass (chapter 2) it has a smallest value, at some s*.
Step 2 (the angle at the nearest point is never acute). For every s in S, (x − s*)·(s − s*) ≤ 0.
Proof. S is convex, so for every λ between 0 and 1 the point s* + λ(s − s*) is in S, and it is no nearer x than s* is. Write d = s − s* and u = x − s*. Then
|u − λd|² = |u|² − 2λ u·d + λ²|d|² ≥ |u|².
Cancel |u|² and divide by λ > 0: −2 u·d + λ|d|² ≥ 0. This holds for every small λ, and λ|d|² goes to 0 as λ does, so −2 u·d ≥ 0. ∎
Why the limit is needed: for a fixed λ the inequality only says u·d is at most λ|d|²/2, a small positive number. The point near s* on the segment is what forces u·d itself to be at most 0. In pictures: if the angle at s* between the order and some plan s were less than 90°, walking a short way from s* towards s would bring you closer to the order, and convexity says that walk stays inside S.

Step 3 (the wall). Put π = s* − x and π0 = π·m, where m = (x + s*)/2 is the midpoint. Step 2 says π·(s − s*) ≥ 0, so π·s ≥ π·s* for every s in S. Also π·s* − π·x = π·π = |π|² > 0, because s* ≠ x. The midpoint sits halfway: π·m = π·x + |π|²/2 = π·s* − |π|²/2. So
π·x < π0 < π·s* ≤ π·s. ∎
The midpoint is the ε ÷ 2 of chapter 1 again. Putting the wall at s* would let the plan s* touch it, and putting it at x would let the order touch it. Halfway leaves a margin of |π|²/2 on each side, which makes both inequalities strict. Read with chapter 1's dot product, π·z = |π||z| cos θ is |π| times the length of z's shadow on π. The wall is the set of points whose shadow is π0 ÷ |π| long, and the order's shadow is shorter than every plan's.
What fails without convex or closed
Both assumptions are used, and without either the theorem is false.
- Not convex. Take chapter 5's set of plans with f = 0 or f ≥ 14, and the point (12, 7), the midpoint of the allowed plans (20, 0) and (4, 14). A wall with π·(20, 0) > π0 and π·(4, 14) > π0 would have π·(12, 7) > π0 as well, since π·(12, 7) is the average of the two. No wall separates the midpoint from the set, even though the midpoint is not in it. Step 2 is where this breaks: the walk from s* towards another plan leaves the set.
- Not closed. Take chapter 2's mill with the press edge removed, so t + f < 20, and the point (10, 10) on the missing edge. Any wall π·z = π0 with π·(10, 10) < π0 fails for plans just inside the edge, which are as close to (10, 10) as you like, so π·s comes as close to π·(10, 10) as you like. No π0 sits strictly between them. Step 1 is where this breaks: there is no nearest point, only nearer and nearer ones.

History. The geometry of convex sets, and with it the plane that touches a convex body without cutting it, was Hermann Minkowski's. He developed it for his geometry of numbers, starting in 1896, and his systematic paper on convex bodies appeared in 1911, two years after his death. He is better known for the four-dimensional geometry of special relativity. Linear programming took over his walls whole: every certificate in this guide, from Kantorovich's multipliers on, is a wall between something wanted and what is possible.
The one thing to remember. A point outside a closed convex set is cut off by a wall through the midpoint of its shortest path to the set. The nearest point exists because the set is closed, and the angle there is never acute because the set is convex.
9Shadows: eliminating a variable
Chapter 8 found a wall by geometry: nearest points and angles. This chapter finds walls by algebra alone, with nothing but adding inequalities, and shows that the algebra solves the mill's problem without ever looking at a corner.
What a shadow is
Shine a light along the t axis onto the mill's region. The shadow on the f axis is the set of f for which some t makes (t, f) a plan:
proj_f(P) = { f : there is a t with (t, f) in P }.
Projection asks whether some t exists, not which one. It is not "set t = 0": f = 16 is in the shadow because of the plan (0, 16), and f = 18 is not, because no amount of 3-ply makes 18 batches of 5-ply fit the lathe.
To get the shadow by algebra, read each row as a bound on t:
- lathe t + 2f ≤ 32 says t ≤ 32 − 2f, an upper bound;
- press t + f ≤ 20 says t ≤ 20 − f, an upper bound;
- t ≥ 0 is a lower bound;
- f ≥ 0 does not mention t.
Some t exists exactly when every lower bound is at most every upper bound. That is two pairs plus the row without t:
0 ≤ 32 − 2f, 0 ≤ 20 − f, f ≥ 0,
so the shadow is 0 ≤ f ≤ 16. The middle condition, f ≤ 20, is true but redundant, because no plan gets near it.
Fourier–Motzkin elimination
The general step is the same.
- Pick the variable to eliminate, say t.
- Divide each row by the absolute value of its t coefficient, a positive number, which keeps the direction of the inequality. Each row now has coefficient +1 (an upper bound t ≤ U_i), −1 (a lower bound t ≥ L_j) or 0.
- Replace all rows with t by the pairs L_j ≤ U_i, one for each lower–upper pair. Keep the rows without t.
With k₊ upper bounds, k₋ lower bounds and k₀ rows without t, the new system has k₊k₋ + k₀ rows and one fewer variable.
Theorem (one elimination step). For every z (the other variables), the new system holds at z if and only if some t makes (z, t) satisfy the old one.
Proof. If (z, t) is feasible, then L_j(z) ≤ t ≤ U_i(z) for each pair, so L_j(z) ≤ U_i(z); the rows without t do not involve t. Conversely, suppose every L_j(z) ≤ U_i(z). Then the largest lower bound is at most the smallest upper bound, max L_j(z) ≤ min U_i(z), and any t between them satisfies every row with t. If there are no lower bounds, take t below every U_i; if there are no upper bounds, take t above every L_j. ∎
Each new row is the sum of a positive multiple of an upper row and a positive multiple of a lower row, chosen so that t cancels. So every row the method produces is a nonnegative combination of the original rows, exactly the kind of combination the multiplier certificates of chapters 2 and 6 use. Collect the multipliers in a matrix M ≥ 0. Then the new system is M A x ≤ M b, and the column of M A belonging to t is zero.
Repeating the step on each variable gives the projection onto any set of coordinates:
Corollary. The projection of a polyhedron onto some of its coordinates is a polyhedron.
The only thing to check is that each step produces finitely many linear inequalities, which it does.
Solving the mill by shadows
Add one variable, v, for the value, and one row, v ≤ 3t + 5f. The pairs (t, f, v) that satisfy all the rows are the plans with a value of v or more. The best value is the top of the shadow on the v axis. Eliminate t first. The row v − 3t − 5f ≤ 0, divided by 3, is the lower bound t ≥ (v − 5f) ÷ 3, and the four pairs give
| pair | new row | made from |
|---|---|---|
| lathe with t ≥ 0 | f ≤ 16 | lathe + (t ≥ 0) |
| press with t ≥ 0 | f ≤ 20 | press + (t ≥ 0) |
| lathe with value | v + f ≤ 96 | 3 × lathe + value |
| press with value | v − 2f ≤ 60 | 3 × press + value |
plus f ≥ 0. That system is the shadow of the plans on the (f, v) plane. Its corners are (0, 60), (12, 84) and (16, 80), and its top is at f = 12.

Fix v = 78 and the theorem can be watched. For each f, the bounds on t are
lower: max(0, (78 − 5f) ÷ 3), upper: min(32 − 2f, 20 − f),
and the point (f, 78) is in the shadow exactly when lower ≤ upper.

Eliminate f next. The lower bounds are f ≥ 0 and f ≥ (v − 60) ÷ 2. The upper bounds are 16, 20 and 96 − v. The six pairs give v ≤ 96, v ≤ 92, v ≤ 100, two rows without v (0 ≤ 16 and 0 ≤ 20), and
(v − 60) ÷ 2 ≤ 96 − v, that is, v ≤ 84.
The smallest bound is 84, the best value. Track the multipliers back through the table: this row is 2 × (v + f ≤ 96) + 1 × (v − 2f ≤ 60), which is 6 × lathe + 3 × press + 3 × value. Divided by 3, it is
2 × (t + 2f ≤ 32) + 1 × (t + f ≤ 20) + 1 × (v − 3t − 5f ≤ 0),
which says v ≤ 2 × 32 + 1 × 20 = 84. These are the prices 2 and 1 again. Elimination never looked at a corner and never wrote down the buyer's problem, yet it found the bound and the certificate together. That is no coincidence: every row it produces is a nonnegative combination of the original rows, and the last row has no t and no f left. Chapter 10 makes this into a theorem.
Images of polyhedra
The same idea shows that the set of values the mill can reach is a polyhedron, without solving anything. Write v = 3t + 5f as two rows, v ≤ 3t + 5f and v ≥ 3t + 5f, and eliminate t and f. The result is 0 ≤ v ≤ 84. In general:
Corollary (linear images). If P is a polyhedron and T is any matrix, then T(P) = { Tx : x in P } is a polyhedron.
Proof. The set { (x, z) : x in P, z = Tx } is a polyhedron, since z = Tx is two systems of inequalities, and T(P) is its projection onto z. ∎
T need not be square or invertible; here it is the 1 × 2 matrix (3 5). The pattern is: introduce variables for the choices, write their relations as linear rows, and project onto the quantities you care about. Sums of polyhedra, { s + u : s in S, u in U }, are polyhedra for the same reason.
Why nobody solves LPs this way
Each step replaces k₊ + k₋ rows by k₊k₋, and most of the new rows are redundant. Take the four-dimensional diamond |x₁| + |x₂| + |x₃| + |x₄| ≤ 1, whose 16 rows are the sign patterns ±x₁ ± x₂ ± x₃ ± x₄ ≤ 1. Eliminating x₄, x₃ and x₂ in turn, without removing redundant rows, gives 64, then 288, then 7,856 rows. All of them describe the interval −1 ≤ x₁ ≤ 1, which needs 2. Elimination is the cleanest proof that shadows of polyhedra are polyhedra, and a poor way to compute them. The simplex method (chapter 14) is the practical alternative.
History. Joseph Fourier, better known for heat and his series, described this elimination in 1826 in a short note on "a particular question of the calculus of inequalities". He came to inequalities through mechanics: the equilibrium of a body that can lift off its supports is described by inequalities, not equations. The method was rediscovered by Lloyd Dines in 1919 and by Theodore Motzkin in his 1936 Basel thesis, which is where the second half of its name comes from.
The one thing to remember. To eliminate a variable, pair every lower bound with every upper bound. The new rows are nonnegative combinations of the old ones, so when every variable is gone, what is left is a certificate.
10Either a plan or a proof
Every infeasible request so far has come with a reason anyone can check: the lathe is 6 hours short, or no plan's value tops 84. This chapter proves that this is not luck. For any system of linear inequalities, either it has a solution or there is a short certificate that it has none. Never both, and never neither.
Two impossible orders
Too many batches. The Trust asks for at least 10 batches of 3-ply and 14 of 5-ply. Add the rows with the multipliers shown:
| row | multiplier |
|---|---|
| t + 2f ≤ 32 | 1 |
| −t ≤ −10 | 1 |
| −f ≤ −14 | 2 |
| sum: 0 ≤ −6 |
Every variable cancels and what is left is false. If a plan met all three rows, it would meet any nonnegative combination of them, and this one says 0 ≤ −6. In words: the order needs 38 lathe hours and the mill has 32. The press gives a second certificate, with multipliers 1, 1, 1 on the press row and the two order rows: 0 ≤ −4, the order needs 24 press hours and there are 20. Certificates are not unique.
Too much value. The Trust asks for a plan worth at least 85,000 roubles:
| row | multiplier |
|---|---|
| t + 2f ≤ 32 | 2 |
| t + f ≤ 20 | 1 |
| −3t − 5f ≤ −85 | 1 |
| sum: 0 ≤ −1 |
The multipliers are the prices 2 and 1 of chapter 6, with weight 1 on the value row. The proof that 85 is impossible is the proof that 84 is best.
Farkas's lemma
Theorem (Farkas, inequality form). For a matrix A and vector b, exactly one of these holds:
I. some x has Ax ≤ b;
II. some π ≥ 0 has πA = 0 and π·b < 0.
System II is the table above: π lists the multipliers, πA = 0 says every variable cancels, and π·b < 0 says the right side ends negative.
Proof that not both. If Ax ≤ b and π ≥ 0, multiplying row i by π_i ≥ 0 keeps its direction, and adding gives πAx ≤ π·b. With πA = 0 this reads 0 ≤ π·b, so π·b < 0 is impossible.
That half is weak duality again, the same multiply-and-add move as chapters 2 and 6. The other half, that a certificate always exists, is the real content, and chapter 9 already proved it.
Proof that at least one. Eliminate every variable by Fourier–Motzkin. Each row of the final system is a nonnegative combination πA x ≤ π·b of the original rows (chapter 9) with every coefficient zero, so it reads 0 ≤ π·b. By the elimination theorem, applied once per variable, the final system holds if and only if Ax ≤ b has a solution. So if I fails, some final row is false: π·b < 0, with π ≥ 0 and πA = 0. That is II. ∎
The proof says more than the statement: running elimination either leaves only true rows, and then undoing it step by step builds a solution, or produces a false row whose multipliers are the certificate.
The same lemma as a picture
The mill's columns say what one batch uses: 3-ply uses (1, 1), meaning 1 lathe hour and 1 press hour, and 5-ply uses (2, 1). A plan x ≥ 0 uses Ax = t(1, 1) + f(2, 1). The set of all usage vectors that plans can produce is the cone spanned by the two columns:
C = { t(1, 1) + f(2, 1) : t, f ≥ 0 }.
Can the mill use exactly 32 lathe hours and 20 press hours? Yes, 8(1, 1) + 12(2, 1) = (32, 20). Exactly 32 and 10? Solving gives t = −12, f = 22, which is not a plan. The usage (32, 10) is outside the cone, and a wall says why. Take y = (−1, 2):
- y·(1, 1) = 1 ≥ 0 and y·(2, 1) = 0 ≥ 0, so y·(Ax) ≥ 0 for every plan;
- y·(32, 10) = −12 < 0.
In words: every batch uses at least half as many press hours as lathe hours, 2 × press − lathe ≥ 0, and (32, 10) has far too few press hours.

Theorem (Farkas, cone form). Exactly one of these holds:
I. some x ≥ 0 has Ax = b (b is in the cone of the columns);
II. some y has yA ≥ 0 and y·b < 0 (a wall through the origin with every column on one side and b strictly on the other).
Proof. Not both: if Ax = b with x ≥ 0 and yA ≥ 0, then y·b = (yA)·x ≥ 0.
At least one, by chapter 8. The cone C = { Ax : x ≥ 0 } is the image of the polyhedron { x ≥ 0 } under A, so by chapter 9 it is a polyhedron, and therefore closed and convex. If b is not in C, separation gives y and y0 with y·b < y0 < y·s for every s in C. The origin is in C, so y0 < 0, and y·b < 0. If some s in C had y·s < 0, then λs would also be in C for every λ > 0, and y·(λs) would drop below y0 for large λ, which is impossible. So y·s ≥ 0 on all of C, in particular on every column: yA ≥ 0. ∎
Closedness is where chapter 9 is needed. Separation needs a closed set (chapter 8), and a cone spanned by finitely many vectors is closed because it is a shadow of a polyhedron. For a cone spanned by infinitely many vectors this can fail.
The two forms are one theorem. Write Ax = b, x ≥ 0 as Ax ≤ b, −Ax ≤ −b, −x ≤ 0. The inequality form gives multipliers u, w, s ≥ 0 with (u − w)A − s = 0 and (u − w)·b < 0, and y = u − w is the cone form's y.
Strict inequalities: Gordan's form
Is there a change in the plan, d = (Δt, Δf), that saves lathe hours, saves press hours and raises value, all strictly? The three conditions are a·d < 0 for the rows
(1, 2), (1, 1), (−3, −5),
where the last row is the value with its sign flipped.
Theorem (Gordan). Exactly one of these holds:
I. some d has Ad < 0 in every row;
II. some π ≥ 0, π ≠ 0, has πA = 0.
Proof. Scaling: if Ad < 0, then a large multiple of d has Ad ≤ −1 in every row, and conversely Ad ≤ −1 implies Ad < 0. So I is "Ad ≤ −1 has a solution". By Farkas it fails exactly when some π ≥ 0 has πA = 0 and π·(−1, …, −1) < 0, that is, the entries of π sum to more than 0, that is, π ≠ 0. ∎
For the mill, π = (2, 1, 1): 2(1, 2) + 1(1, 1) + 1(−3, −5) = (0, 0). No change saves both resources and earns more, and the certificate is the price vector once more. In pictures, I says every row fits in one open half-plane, and II says the rows, weighted, add up head to tail to the origin.

The left panel is chapter 2's arrow picture, c = 2(1, 2) + 1(1, 1), moved to one side of the equation.
History. Gyula Farkas was a physicist at Kolozsvár (now Cluj) working on Fourier's inequality principle of mechanics, the same problem that led Fourier to elimination. He published the lemma in several attempts from 1894 on, and his clean proof appeared in 1902. Paul Gordan's form is older, from 1873, written in the middle of his work on invariant theory. In 1947 von Neumann recognised Farkas's lemma at once in Dantzig's linear programs (chapter 6), and the duality theorem of chapter 20 is a corollary of it.
The one thing to remember. Either the system has a solution, or a nonnegative combination of its rows reads 0 ≤ negative. Elimination finds whichever one exists; geometrically, b is either in the cone or cut off from it by a wall through the origin.
11Corners by algebra
Chapter 2 defined a corner by geometry: a plan that is not the midpoint of two other plans. To compute with corners, and in chapter 14 to walk between them, we need a test that uses only the rows. The test is a rank.
Tight rows and the directions they leave free
At a plan x, a row is tight if it holds with equality there. At (8, 12) both the lathe and the press rows are tight. At (4, 14) only the lathe row is tight, and at (4, 6) none is.
The tight rows decide which small moves d keep them tight: a row a stays tight at x + d exactly when a·d = 0. The moves that keep every tight row tight form the nullspace of the tight rows A_T:
Null(A_T) = { d : A_T d = 0 }.
- At (8, 12): (1, 2)·d = 0 and (1, 1)·d = 0 force d = 0. No move keeps both walls.
- At (4, 14): (1, 2)·d = 0 leaves the whole line of moves d = s(2, −1), sliding along the lathe wall.
- At (4, 6): there are no tight rows, and every d is allowed.
How many independent free directions there are is counted by the rank of A_T, the number of independent rows:
Theorem (rank–nullity). For a matrix with n columns and rank r, the nullspace has dimension n − r.
Proof. Row reduction does not change the nullspace, because each step is reversible and keeps the solutions of A d = 0. It brings A to echelon form, with r pivot columns and n − r free columns. For each free column, set that free variable to 1 and the other free variables to 0, and solve for the pivot variables from the bottom up. This gives n − r nullspace vectors. They are independent, since each one is the only one with a 1 in its own free position. They span the nullspace, since any solution d equals the combination of them weighted by its own free entries: the difference between the two has every free entry zero, so its pivot entries are zero as well. ∎
So rank(A_T) = n means no free direction at all, and rank(A_T) < n means at least one.
Basic solutions
Definition. A point x is basic if its tight rows have rank n, the number of variables. A basic point that satisfies every row is a basic feasible solution (BFS).
For the mill, n = 2, and a basic point is where two independent rows cross. These are chapter 2's six crossings of four walls. Four of them, (0, 0), (20, 0), (0, 16) and (8, 12), satisfy every row and are BFSs. (32, 0) and (0, 20) are basic but break a row. With m rows there are at most C(m, n) basic points, one per choice of n independent rows, here C(4, 2) = 6.
Theorem (corner = BFS). A point of a polyhedron P = { x : Ax ≤ b } is a corner if and only if it is a BFS.
Proof, BFS ⇒ corner. Let x be a BFS and suppose x = (u + v)/2 with u, v in P. For each tight row i, A_i u ≤ b_i and A_i v ≤ b_i average to A_i x = b_i, so both are equalities. So A_T(u − x) = 0. The tight rows have rank n, so their nullspace is {0}, and u = x. Likewise v = x. So x is not the midpoint of two other points.
Proof, corner ⇒ BFS. Suppose the tight rows at x have rank below n. By rank–nullity there is d ≠ 0 with A_T d = 0. Moving to x ± εd keeps every tight row tight. Each row j that is not tight has slack s_j = b_j − A_j x > 0, and the move changes its left side by ±ε A_j d. So the row still holds if ε |A_j d| ≤ s_j. Take ε as the smallest s_j ÷ |A_j d| over the slack rows with A_j d ≠ 0, or any positive number if there are none. Then x + εd and x − εd are both in P, they are different, and x is their midpoint. So x is not a corner. ∎
The ε is chapter 1's safe radius again. A slack row with surplus s_j can absorb a move only up to s_j ÷ |A_j d|, its slack measured in units of A_j·d. At (4, 14) with d = (2, −1), the press row has slack 2 and (1, 1)·d = 1, so ε = 2: (8, 12) and (0, 16) are both plans, and (4, 14) is their midpoint.

Directions and lines
The buyer's region of chapter 6 is unbounded:
y₁ + y₂ ≥ 3, 2y₁ + y₂ ≥ 5, y ≥ 0.
Starting from any fair offer, raising either price keeps it fair, so it can run off to infinity in any direction d ≥ 0. In general:
Definition and test. A vector d is a direction of P = { x : Ax ≤ b } if x + θd stays in P for every x in P and every θ ≥ 0. When P is not empty, d is a direction if and only if Ad ≤ 0.
Proof. If Ad ≤ 0, then A(x + θd) = Ax + θAd ≤ Ax ≤ b. Conversely, if some row has A_i d > 0, then A_i(x + θd) = A_i x + θA_i d passes b_i once θ is large. ∎
Written as Ax ≤ b, the buyer's rows are −y₁ − y₂ ≤ −3, −2y₁ − y₂ ≤ −5, −y ≤ 0, and Ad ≤ 0 is exactly d ≥ 0, the raises.
If both d and −d are directions, P contains whole lines x + θd for every real θ, and then Ad = 0. A region with a line has no corners at all: every point y is the midpoint of y + d and y − d, both still in P. The strip 12 ≤ t + f ≤ 20, with no sign limits, is an example. Every point slides both ways along (1, −1), so it has no corner. Maximizing t + f over it gives 20, reached on a whole line but at no corner. Regions without lines are called pointed.

Every pointed region has a corner, and some best plan is one
Chapter 2 proved "a best plan sits on a corner" for bounded regions. The same idea, run with ranks, handles unbounded regions in any dimension.
Procedure (crashing). Start at a point x of P. While the tight rows have rank below n, pick d ≠ 0 in their nullspace with c·d ≤ 0 (for a minimization), and move along d until a new row goes tight. The new row has A_j d > 0, while every old tight row has A_i d = 0, so the new row is independent of them, and the rank goes up by one.
Take the buyer's bill 32y₁ + 20y₂ and start at the fair offer (4, 4), bill 208.
- No row is tight, so any d is free. Take d = (−1, −1), which lowers the bill by 52 per unit. The 5-ply row 2y₁ + y₂ ≥ 5 goes tight first, after 7/3 units, at (5/3, 5/3), with a bill of 260/3 ≈ 86.67.
- One row is tight, of rank 1. Its nullspace is spanned by (1, −2), and the bill changes by 32 − 40 = −8 per unit along it, so move that way. The 3-ply row goes tight after 1/3, at (2, 1), with a bill of 84.
- Two independent tight rows, rank 2: a corner.

Crashing guarantees a corner no worse than the start, not the best one. From (4, 4) with d = (0, −1) and then (−1, 0), it stops at the corner (3, 0) with a bill of 96. Finding the best corner is the simplex method's job (chapter 14). But crashing is enough to prove that a best corner exists:
Theorem (fundamental theorem of linear programming). Let P be a non-empty pointed polyhedron. Then min c·x over P either is unbounded below or is attained at a BFS.
Proof. First, P has a BFS: crash from any point with c = 0. A free direction d with A_T d = 0 cannot have both d and −d as directions of P (that would be a line), so one of them is blocked by some row, and the rank goes up. There are finitely many BFSs, at most C(m, n), so one of them, x*, has the smallest value. Suppose some x in P has c·x < c·x*. Crash from x. The procedure can only fail to find a blocking row along some d with c·d ≤ 0. If c·d < 0, the ray x + θd stays in P while the value goes to −∞: unbounded. If c·d = 0, use −d instead; if that is unblocked too, P contains a line, which it does not. Otherwise crashing ends at a BFS w with c·w ≤ c·x < c·x*, contradicting the choice of x*. ∎
This is chapter 2's theorem with the two assumptions it needed, bounded and two-dimensional, replaced by the one that matters: no lines. The buyer's region is unbounded, but its bill is at least 0 along every direction d ≥ 0, so it is not unbounded below, and its best offer, (2, 1), is a corner.
The one thing to remember. A corner is a point where the tight rows have rank n, so no move keeps them all tight. If the region has no lines, some best plan is a corner, or the value runs off to infinity.
12Too many walls at one corner
Chapter 11 found corners by rank: n independent tight rows. Nothing there said exactly n. When more than n rows are tight at one corner, the corner is degenerate. The region itself looks the same, but the algebra no longer matches the picture one to one. Three things change: the bases, the prices and the value of one more hour.
A row that changes nothing
The mill glues its veneer. A 3-ply batch takes 2 tonnes of glue and a 5-ply batch 3, and the store holds 52 tonnes:
2t + 3f ≤ 52.
This row adds the lathe and press rows, (1, 2) + (1, 1) = (2, 3) and 32 + 20 = 52, so every plan that respects the lathe and the press respects the glue. The region is unchanged. But the glue wall passes through (8, 12), since 16 + 36 = 52, and now three rows are tight there with n = 2.
Definition. A basic point x is degenerate if more than n rows are tight at x.
Degeneracy belongs to the list of rows, not to the shape. The same region and the same corner were not degenerate one row ago. A repeated row, or any combination of tight rows, makes a corner degenerate without moving any wall.
One corner, three bases
A basis at x is a choice of n independent tight rows that pins x down. With five rows (lathe, press, glue, t ≥ 0, f ≥ 0) there are C(5, 2) = 10 pairs. Every pair is independent, and they give only eight points:
| pair | crossing | feasible |
|---|---|---|
| lathe, press | (8, 12) | yes |
| lathe, glue | (8, 12) | yes |
| press, glue | (8, 12) | yes |
| lathe, t ≥ 0 | (0, 16) | yes |
| press, f ≥ 0 | (20, 0) | yes |
| t ≥ 0, f ≥ 0 | (0, 0) | yes |
| lathe, f ≥ 0 | (32, 0) | no: press 32 |
| press, t ≥ 0 | (0, 20) | no: lathe 40 |
| glue, t ≥ 0 | (0, 52/3) | no: lathe 104/3 |
| glue, f ≥ 0 | (26, 0) | no: press 26 |
There are four corners but six feasible bases, three of them at (8, 12). The simplex method of chapter 14 keeps a basis, not a point, so at (8, 12) it can switch from one basis to another without moving and without gaining anything. That is a degenerate pivot. Chapter 15 shows that such pivots can go round in a circle forever, and how to stop it.
The prices stop being unique
With the glue row, a buyer's offer is a price for each of the three resources, y = (y_lathe, y_press, y_glue) ≥ 0. Complementary slackness (chapter 7) at (8, 12) gives:
- every resource is used up, so no price is forced to 0;
- both products are made, so each must be priced at exactly its value:
y_lathe + y_press + 2y_glue = 3, 2y_lathe + y_press + 3y_glue = 5.
Two equations in three unknowns. Subtracting the first from the second gives y_lathe + y_glue = 2. Write y_glue = s. Then
y = (2 − s, 1 − s, s), 0 ≤ s ≤ 1,
where s ≤ 1 keeps the press price at least 0. Every one of these offers bills 32(2 − s) + 20(1 − s) + 52s = 84, so by weak duality (chapter 6) every one proves that 84 is the best value. Raising the glue price by s and lowering the other two by s each costs the same, because the glue is a lathe hour plus a press hour. There is a whole segment of optimal prices. Its endpoints come from the bases. The basis {lathe, press} leaves the glue unpriced, s = 0, which gives (2, 1, 0). The basis {lathe, glue} leaves the press unpriced, s = 1, which gives (1, 0, 1). The third basis, {press, glue}, leaves the lathe unpriced, s = 2, which gives (0, −1, 2). It describes the same corner but pays −1 for a press hour, so it does not certify anything. That is chapter 2's negative multiplier again, at a corner that really is optimal.
One more hour, in which direction?
Chapter 7 priced a lathe hour at 2,000 roubles. That number was the slope of the best value as the lathe stock moves. With the glue store fixed at 52:
- One hour fewer, 31: the best plan is (9, 11), worth 82. The loss is 2.
- One hour more, 33: (7, 13) would need 53 tonnes of glue. The best plan is (5, 14), worth 85. The gain is only 1.
The glue was exactly enough for (8, 12) and for nothing more. The extra lathe hour can only be used by giving up glue elsewhere. The value curve has a kink at 32: slope 2 on the left and slope 1 on the right, and these are the largest and the smallest lathe price in the segment (2 − s, 1 − s, s).
Theorem (one-sided prices). Let V(b) be the best value with stock b, and let y be any optimal price vector at b. Then for every change δ in one resource i, positive or negative,
V(b + δe_i) ≤ V(b) + δ y_i.
Proof. The price vector y is still a fair offer when only the stock changes, since fairness only involves the products' values and uses. So by weak duality, V(b + δe_i) ≤ (b + δe_i)·y = b·y + δy_i = V(b) + δy_i. ∎
For δ > 0, divide by δ: the gain per extra hour is at most y_i, for every optimal y, so it is at most the smallest, 1. For δ < 0, dividing by δ flips the inequality: the loss per hour given up is at least y_i, so at least the largest, 2. The computation above shows that both bounds are reached. At a nondegenerate corner the segment shrinks to the single price of chapter 7, and the two slopes agree.
![The value of the lathe stock with the press at 20 and glue at 52, drawn in rust: slope 3 up to 20 hours, slope 2 from 20 to 32, slope 1 from 32 to 104/3, then flat at 260/3. At b = 32 two tangent segments are drawn, slope 2 from the left and slope 1 from the right, with the readout "prices 2 − s for s in [0, 1]". Faint dashes show chapter 7's curve without the glue, which keeps slope 2 up to 40.](chapters/12-degeneracy/kink.png)
Breaking the tie
In 1952, Abraham Charnes suggested moving the stocks by tiny, unequal amounts, so that no extra row can pass exactly through a corner. Moving the glue store shows what happens:
- Glue above 52: the glue wall leaves the corner and does not touch the region. The corner is nondegenerate, and the prices are (2, 1, 0).
- Glue 52 − δ: the glue wall cuts the corner off. It is replaced by two nondegenerate corners: lathe ∩ glue at (8 − 2δ, 12 + δ), worth 84 − δ, and press ∩ glue at (8 + δ, 12 − δ), worth 84 − 2δ. The best is the first, with prices (1, 0, 1).

A degenerate corner is a limit of nondegenerate ones. It is the moment when two corners, and their two bases, merge into one point. That is why perturbation removes degeneracy and keeps the answer within δ of the true one.
Aside: the first loop. Charnes's 1952 paper was written against a possibility, not an observed failure: could a run of degenerate pivots come back to a basis it had already visited? In a 1953 National Bureau of Standards report, Alan Hoffman showed that it can. He gave an LP with three rows and eleven variables, built from the angles of a regular pentagon, on which the simplex method cycles through the same bases forever. Chapter 15 runs a smaller loop of the same kind and the rule that ends it.
The one thing to remember. A degenerate corner has more tight rows than dimensions. The point is the same, but several bases describe it, the prices form a segment instead of a point, and one more unit is worth the smallest price in that segment, while one fewer costs the largest.
13Corners and escape routes
The buyer's region of chapter 6 has three corners, (0, 5), (2, 1) and (3, 0), and runs off to infinity. Is it the corners plus something, and what exactly? This chapter's answer: every point is a mix of corners plus a move along the region's escape routes, and nothing else is needed. This is the theorem of Minkowski and Weyl. It turns a list of rows into a list of points and directions, and back.
The escape routes
Chapter 11 showed that d is a direction of P = { x : Ax ≤ b } exactly when Ad ≤ 0. That test does not mention any point of P, so every point has the same escape routes. They form the recession cone
rec(P) = { d : Ad ≤ 0 },
which is again a polyhedron, given by the same rows with b replaced by 0. For the buyer, rec(P) is the quadrant d ≥ 0. For the mill, the only solution of Ad ≤ 0 is d = 0, so there is no escape: the region is bounded.
Theorem (bounded = no escape). A non-empty polyhedron is bounded if and only if its recession cone is {0}.
The "only if" is immediate: a direction d ≠ 0 gives the unbounded ray x + θd. The "if" comes out of the representation theorem below.
Every point is corners plus escape
Theorem (Minkowski's half). Let P be a non-empty pointed polyhedron with corners v₁, …, v_k. Every x in P can be written as
x = λ₁v₁ + ⋯ + λ_kv_k + d, λ ≥ 0, Σλ_i = 1, d ∈ rec(P).
Proof. Induct on n − rank, where rank is the rank of the rows tight at x. If the rank is n, x is a corner (chapter 11). Otherwise take e ≠ 0 with A_T e = 0, as in chapter 11. Because P is pointed, e and −e are not both directions. Swap them if needed so that the move along +e is blocked. Let u = x + αe be the point where the first new row goes tight. Then the tight rows at u have higher rank, by chapter 11's crashing step.
- If −e is blocked too, the same construction gives w = x − βe of higher rank. Then x = (β/(α + β))·u + (α/(α + β))·w, a mix of two points that the induction already decomposes. Mixing their decompositions with these weights decomposes x.
- If −e is a direction, then x = u + α(−e), and u is decomposed by induction. Adding α(−e) to its d keeps d in the cone, since a sum of directions is a direction.
In both cases x has the required form. ∎
Run on the buyer's offer (4, 4):
- No row is tight. Take e = (−1, −1): it is blocked after 7/3 by the 5-ply row at u = (5/3, 5/3), while (1, 1) is a direction. So (4, 4) = (5/3, 5/3) + 7/3·(1, 1).
- At (5/3, 5/3) the 5-ply row is tight. Its free direction (1, −2) is blocked both ways: at (2, 1) after 1/3, and at (0, 5) after 5/3 in the opposite direction. So (5/3, 5/3) = 5/6·(2, 1) + 1/6·(0, 5).
Together:
(4, 4) = 5/6·(2, 1) + 1/6·(0, 5) + 7/3·(1, 1).
In the buyer's words, the offer (4, 4) is a blend of two minimal fair offers, plus a raise of 7/3 thousand roubles on both hours. Read through the bill:
208 = 5/6 · 84 + 1/6 · 100 + 7/3 · 52.
The bill of any fair offer is a weighted average of corner bills plus the cost of the raise. Raises cost 32d₁ + 20d₂ ≥ 0, so no offer is cheaper than the cheapest corner. That is chapter 11's fundamental theorem again, now read off a formula.

The theorem also finishes the "if" above. If rec(P) = {0}, every point is a mix of finitely many corners, so every point lies within the largest corner distance of the origin, and P is bounded.
The escape routes have corners too
The cone rec(P) is itself a polyhedron, but its only corner is 0. What lists it are its extreme rays, the edges of the cone. To find them, cut the cone with one hyperplane that every nonzero direction crosses.
For a pointed region the rows span every direction: if A e = 0 for some e ≠ 0, then e and −e would both be directions, and P would contain a line. Take w = −(sum of the rows of A). For d in the cone, Ad ≤ 0, so w·d = −Σ A_i d ≥ 0, and it is 0 only if every A_i d = 0, which forces d = 0. So every nonzero direction has w·d > 0. After scaling, it lands on the slice
S = { d : Ad ≤ 0, w·d = 1 }.
S is a polyhedron whose own escape routes would be directions d of the cone with w·d = 0, and only d = 0 qualifies. So S is bounded. By Minkowski's half it is the set of mixes of its finitely many corners. So every direction is a nonnegative combination of those corners, and those corners are the extreme rays.
For the buyer, the rows written as ≤ are (−1, −1), (−2, −1), (−1, 0) and (0, −1), so w = (4, 3). The slice is the segment from (1/4, 0) to (0, 1/3), and the extreme rays are (1, 0) and (0, 1): raise one price or the other.

And back again
Theorem (Weyl's half). For any finite lists v₁, …, v_k and r₁, …, r_m, the set { Σλ_i v_i + Σμ_j r_j : λ ≥ 0, Σλ_i = 1, μ ≥ 0 } is a polyhedron.
Proof. In the space of (x, λ, μ), the rows x = Σλ_i v_i + Σμ_j r_j, Σλ_i = 1, λ ≥ 0 and μ ≥ 0 define a polyhedron. The set is its shadow on x, and chapter 9 showed that shadows of polyhedra are polyhedra. ∎
So "rows" and "corners plus rays" describe the same objects. Rows are the right form for checking a plan, since each row is one dot product. Corners and rays are the right form for optimizing over the region, since a linear value only needs the corners and the sign of the value along each ray. The translation in either direction can be enormous. The n-dimensional cube has 2n rows and 2ⁿ corners, while the diamond of chapter 9 has 2n corners and 2ⁿ rows.
Aside: three people, forty years. Minkowski proved the bounded case in the 1890s, while building the geometry of numbers out of convex bodies. In 1935 Weyl gave both directions for cones in a short paper, "Elementare Theorie der konvexen Polyeder", with a purely algebraic proof. Motzkin's 1936 Basel thesis, the same work that rediscovered Fourier's elimination, stated the version for regions that are unbounded: corners plus cone. That is why the theorem is sometimes called Minkowski–Weyl and sometimes Motzkin's decomposition.
The one thing to remember. A pointed region is its corners mixed, plus its escape routes, and the escape routes are a cone generated by finitely many extreme rays. A linear value over it is a weighted average of corner values plus the value's change along the routes taken.
14Walking the edges: the simplex method
Chapter 0 walked from (0, 0) to (0, 16) to (8, 12) and stopped. Chapters 11–13 supplied the facts that make the walk an algorithm: corners are bases, and edges are one-dimensional null spaces. Prices certify the stop. This chapter writes the walk out in full.
Equations with slacks
Give each machine a slack, its idle hours: s₁ for the lathe and s₂ for the press.
t + 2f + s₁ = 32, t + f + s₂ = 20, t, f, s₁, s₂ ≥ 0.
There are now four variables and two equations. A basis is a choice of two variables, the basic ones, that the equations solve for. The other two, the nonbasic ones, are set to 0. This is the same object as chapter 11's: setting a nonbasic variable to 0 makes one wall tight. Setting t = f = 0 is the corner (0, 0), where both axes are tight. Setting s₁ = s₂ = 0 is (8, 12).
Write the basic variables and the value in terms of the nonbasic ones. This is a dictionary:
s₁ = 32 − t − 2f s₂ = 20 − t − f z = 0 + 3t + 5f
Everything is visible at once. The current corner sets t = f = 0, so z = 0. The z-row says that raising either nonbasic variable earns money.
One pivot, every number explained
Who enters. The coefficient of a nonbasic variable in the z-row is its reduced cost: the change in value per unit of it, with the basic variables adjusting to keep the equations true. Raising f earns 5 per batch and raising t earns 3. Dantzig's rule takes the larger, so f enters.
How far. As f rises with t held at 0, s₁ = 32 − 2f and s₂ = 20 − f fall. Each slack must stay ≥ 0, so
f ≤ 32/2 = 16 (lathe), f ≤ 20/1 = 20 (press).
This is the ratio test: stock ÷ use per unit, minimized over the rows that the move uses up. It is chapter 11's ε = slack ÷ |A_j d|, with d the edge direction. The lathe runs out first, so s₁ hits 0 and leaves the basis. A row with a non-positive coefficient never limits the move, because that row's slack grows.
Rewriting. Solve the lathe row for the entering f, then substitute it everywhere:
f = 16 − t/2 − s₁/2 s₂ = 4 − t/2 + s₁/2 z = 80 + t/2 − (5/2)s₁
This is the corner (0, 16) with value 80, matching chapter 0. Now read the new z-row in the mill's terms.
- t has reduced cost +1/2. One more 3-ply batch needs a lathe hour, and the lathe is full, so half a 5-ply batch must go. The net is 3 − 5/2 = 1/2. Geometrically, the move is the edge direction d = (1, −1/2) along the lathe wall, and c·d = 1/2.
- s₁ has reduced cost −5/2. Idling a lathe hour costs half a 5-ply batch.
t enters. The ratio test, with s₁ held at 0, gives f = 16 − t/2 ≥ 0, so t ≤ 32; and s₂ = 4 − t/2 ≥ 0, so t ≤ 8. The press binds and s₂ leaves:
t = 8 + s₁ − 2s₂ f = 12 − s₁ + s₂ z = 84 − 2s₁ − s₂
Stop. Both reduced costs are negative. Since s₁, s₂ ≥ 0 for every plan, the last line gives z ≤ 84 for every plan, with equality here. This is chapter 2's proof, printed by the algorithm. The coefficients 2 and 1 are the buyer's prices.

The same pivots as a tableau
Most textbooks and every exam write the dictionaries as a tableau. Each row is an equation with every variable moved to the left, and the last row holds the reduced costs, with −z on the right. The mill's three tableaux, with columns t, f, s₁, s₂ and the right-hand side:
| basis | t | f | s₁ | s₂ | rhs |
|---|---|---|---|---|---|
| s₁ | 1 | 2 | 1 | 0 | 32 |
| s₂ | 1 | 1 | 0 | 1 | 20 |
| z | 3 | 5 | 0 | 0 | 0 |
f enters (largest 5) and s₁ leaves (32/2 < 20/1). Divide the s₁ row by the pivot 2, then subtract multiples of it to clear f's column from the other rows: the s₂ row loses 1 copy and the z row loses 5.
| basis | t | f | s₁ | s₂ | rhs |
|---|---|---|---|---|---|
| f | 1/2 | 1 | 1/2 | 0 | 16 |
| s₂ | 1/2 | 0 | −1/2 | 1 | 4 |
| z | 1/2 | 0 | −5/2 | 0 | −80 |
t enters (1/2 > 0) and s₂ leaves (4 ÷ 1/2 = 8 < 16 ÷ 1/2 = 32). Divide by 1/2, then clear t's column: the f row loses 1/2 copy and the z row loses 1/2.
| basis | t | f | s₁ | s₂ | rhs |
|---|---|---|---|---|---|
| t | 1 | 0 | −1 | 2 | 8 |
| f | 0 | 1 | 1 | −1 | 12 |
| z | 0 | 0 | −2 | −1 | −84 |
Each row is the dictionary with its signs flipped. The row t − s₁ + 2s₂ = 8 is the dictionary row t = 8 + s₁ − 2s₂. The z row is z = 84 − 2s₁ − s₂ with z moved to the left. Two things can be read off without any further work:
- B⁻¹: the slack columns s₁, s₂ of the final tableau, [[−1, 2], [1, −1]]. They started as the identity, and every row operation since has been multiplication by B⁻¹ (chapter 17 uses this).
- The prices: minus the z-row entries under the slacks, (2, 1).
The method in general
For max cx subject to Ax = b and x ≥ 0, with A of size m × n and rank m, let B be the m columns of a feasible basis. Then:
- The point: x_B = B⁻¹b ≥ 0, with x = 0 off the basis.
- The prices: y = c_B B⁻¹, the unique y that makes every basic column's reduced cost 0.
- The reduced costs: c̄_j = c_j − y A_j, one for each nonbasic j.
- The edge for entering j: raise x_j and move the basics along −B⁻¹A_j. This is the null space of the n − 1 tight rows that remain once x_j ≥ 0 is released.
- The ratio test: θ = min { (B⁻¹b)_i / (B⁻¹A_j)_i : (B⁻¹A_j)_i > 0 }.
Theorem (optimality). If c̄ ≤ 0, the basic solution is optimal.
Proof. c̄ ≤ 0 says yA ≥ c, so y is a fair offer for the dual min yb, yA ≥ c (y free, because the rows are equations; chapter 6's sign table). Its bill is yb = c_B B⁻¹b = c_B x_B = cx. A fair offer that bills exactly the plan's value proves the plan optimal, by weak duality. ∎
So a stop is never a guess: it comes with a certificate. Chapter 16 runs this same proof backwards.
Theorem (unbounded). If some c̄_j > 0 and B⁻¹A_j ≤ 0, the value is unbounded.
Proof. The edge d for j has Ad = 0 and d ≥ 0, so it is a direction (chapter 11), and c·d = c̄_j > 0. The ray x + θd stays feasible and gains θc̄_j. ∎
The ray is more than a direction: it is an extreme ray of the recession cone. In the cone { d : Ad = 0, d ≥ 0 } it is tight at the m equations and at the n − m − 1 other nonbasic zeros. Those rows have rank n − 1, so d is a corner of chapter 13's slice.
Example: suppose the planners forget both machines and keep only the rule "at most 4 more 5-ply batches than 3-ply", −t + f ≤ 4. Then f enters, and the rule stops it at (0, 4) with z = 20. The new z-row is z = 20 + 8t − 5s, since one more 3-ply allows one more 5-ply, for 3 + 5 = 8. The column of t is −1 ≤ 0, so no row limits it, and the ray (0, 4) + θ(1, 1) climbs forever. An unbounded LP in practice means a missing row, here the machines.

Theorem (termination without degeneracy). If every basic feasible solution has x_B > 0, the method stops after finitely many pivots.
Proof. Each ratio test then gives θ > 0, so each pivot raises z by θc̄_j > 0. The value strictly increases, so no basis repeats. There are at most C(n, m) bases. ∎
With degeneracy θ can be 0, as at chapter 12's glue corner: the basis changes and the point doesn't. Chapter 15 shows the method can then cycle forever, and the rule that prevents it.
When (0, 0) is not a plan: Phase I
Return to the order of chapter 10: the Trust wants at least 14 batches of 5-ply, f ≥ 14. Now (0, 0) is infeasible and there is no obvious starting basis. Write the order as f − e = 14 with surplus e ≥ 0, and add an artificial a ≥ 0:
f − e + a = 14.
The point t = f = e = 0, a = 14 satisfies every equation, but it is a fake plan. Phase I maximizes −a, which means walking until the fake part is gone:
a = 14 − f + e, −a = −14 + f − e.
f enters. The ratios are lathe 32/2 = 16, press 20/1 = 20 and order 14/1 = 14, so a leaves, at (0, 14). Then −a = 0, which is the largest it can be, and the basis {s₁, s₂, f} is a true corner. If the Phase I optimum were below 0, no plan would exist. Chapter 10 would then hand over the certificate, which is Phase I's own final prices.
Phase II restarts the walk from (0, 14) with the real value:
| step | entering | ratio test (smallest wins) | new corner | z |
|---|---|---|---|---|
| start | (0, 14) | 70 | ||
| 1 | e, +5 per unit: relax the order | lathe 2, press 6 | (0, 16) | 80 |
| 2 | t, +1/2 | e 4, press 8 | (4, 14) | 82 |
The final z-row is z = 82 − 3s₁ − e. The lathe is worth 3 here, more than 2, because the order forbids shifting work to 3-ply. The order costs 1 per batch: raising it to 15 batches gives z = 81. (8, 12) is no longer allowed, and the best plan is to fill the order exactly and spend the rest of the lathe on 3-ply.
Step 1 shows that Dantzig's rule is greedy, not wise. It took the larger reduced cost, e, climbed to (0, 16), and came back down the lathe wall. Taking t first would have gone straight from (0, 14) to (4, 14).

Aside: the walk nobody expected. Dantzig wrote that in 1947 he had considered moving from corner to corner along the edges, and set it aside. In two dimensions it is obviously fine; in many dimensions, he expected, it would wander for a very long time. He was convinced only by picturing the columns, rather than the rows, where each pivot swaps one corner of a simplex. The name came from Motzkin. His doubt was not baseless: in 1972 Klee and Minty built squashed cubes on which Dantzig's rule visits all 2ⁿ corners. In 2001 Spielman and Teng explained why that never shows up in practice: after a small random wiggle of the data, a variant of the method needs only polynomially many pivots on average.
The one thing to remember. A pivot is chapter 11's crash on one edge. The reduced cost is the edge's value per step, and the ratio test is the safe step to the next wall. The last z-row is the price certificate: the method's stop is its proof.
15Walking in circles, and the rule that stops it
Chapter 14's termination proof needed θ > 0 at every pivot. At a degenerate corner, like chapter 12's glue corner, the ratio test can return θ = 0: the basis changes and the point stays put. Nothing then forces the value to rise, so nothing stops the bases from coming back around. This chapter shows that they do, and gives a one-line rule that prevents it.
A six-pivot circle
A cycle needs a corner with many more tight rows than the dimension, so take the standard example from Chvátal's textbook:
max 10x₁ − 57x₂ − 9x₃ − 24x₄
subject to
½x₁ − 11/2·x₂ − 5/2·x₃ + 9x₄ ≤ 0, ½x₁ − 3/2·x₂ − ½x₃ + x₄ ≤ 0, x₁ ≤ 1, x ≥ 0,
with slacks x₅, x₆, x₇. The start x = 0 is a corner where six of the seven rows (the four signs and the two rows with right-hand side 0) are tight in four dimensions, so it is degenerate. Use Dantzig's rule, taking the largest reduced cost to enter. When the ratio test ties, the lowest-index variable leaves.
| pivot | enters | leaves | point | z |
|---|---|---|---|---|
| 1 | x₁ | x₅ | 0 | 0 |
| 2 | x₂ | x₆ | 0 | 0 |
| 3 | x₃ | x₁ | 0 | 0 |
| 4 | x₄ | x₂ | 0 | 0 |
| 5 | x₅ | x₃ | 0 | 0 |
| 6 | x₆ | x₄ | 0 | 0 |
After six pivots the basis is {x₅, x₆, x₇} again. The dictionary is the starting one, so the same six pivots repeat forever. Every ratio test returned θ = 0, and the point never left the origin. The optimum is z = 1, at x = (1, 0, 1, 0).
Geometrically, the origin is one corner with many bases. Each basis is a choice of four of the six tight rows, and each pivot swaps one of them. The method is checking different explanations of the same point, and its rule leads it back to an explanation it has already tried.

Bland's rule
Bland's rule. Among the variables with positive reduced cost, the one with the smallest index enters. Among the rows tied in the ratio test, the one whose basic variable has the smallest index leaves.
On the example the first five pivots are the same. At the sixth, x₁ and x₆ both have positive reduced cost, and Bland takes x₁. One more pivot reaches z = 1, which is optimal.
Theorem (Bland, 1977). The simplex method with Bland's rule never cycles.
Proof. Suppose it cycles. Every pivot in the cycle has θ = 0, so the point and the value v stay fixed throughout. A variable is fickle if it enters or leaves somewhere in the cycle. Then it does both, because the cycle comes back to its start. Every fickle variable is 0 throughout: it is nonbasic at some moment, and the point never moves.
Let t be the largest fickle index. Let D be a dictionary in the cycle where x_t leaves and x_s enters, so s < t. Let D* be one where x_t enters. Write D as
x_i = b_i − Σ_j a_ij x_j (i basic in D), z = v + Σ_j c_j x_j,
and let c*_j be the reduced costs in D*, with c*_j = 0 for the variables basic in D*.
Every dictionary is a rewriting of the same equations, so any solution of one solves all of them. Take the solution of D in which x_s = y, the other nonbasic variables of D are 0, and x_i = b_i − a_is·y. D and D* must give the same z for every y:
v + c_s y = v + c*s y + Σ{i basic in D} c*_i (b_i − a_is y).
Compare the coefficients of y:
c_s − c*_s + Σ_i c*_i a_is = 0.
- c_s > 0, because x_s enters at D.
- c*_s ≤ 0. Otherwise x_s, whose index is below t, would enter at D* instead of x_t.
So Σ_i c*_i a_is < 0, and some r basic in D has c*_r a_rs < 0. Then c*_r ≠ 0, so r is nonbasic in D*. Since r is basic in D, r is fickle, and r ≤ t.
In fact r ≠ t. At D*, x_t enters, so c*_t > 0. At D, x_t leaves, so the ratio test chose a row with a_ts > 0. That makes c*_t a_ts > 0, not < 0. So r < t.
Since r < t was not chosen at D*, c*_r ≤ 0, and so c*_r < 0 and a_rs > 0. Being fickle, x_r is 0 at D, so b_r = 0, and its row ties x_t's row in the ratio test at D, both with ratio 0. Bland would then have sent out x_r, whose index is smaller than t, not x_t. This contradicts the choice at D. ∎
The proof never uses the sizes of the numbers, only signs and indices. Bland's rule is one of several fixes. Charnes's perturbation from chapter 12 is another: replacing b by b + (ε, ε², …, εᵐ) leaves no degenerate corner, so chapter 14's argument applies as it stands. Its exact form, the lexicographic rule, compares rows by their ratios and breaks ties with the coefficients of ε, ε², and so on. Bland's rule is simplest to state. In practice it is slow, because it ignores how much each variable earns.
What termination buys: strong duality
With Bland's rule both phases stop, and each stop has a reason:
- Phase I ends below 0. No plan exists. The Phase I prices are a chapter 10 certificate.
- Phase I ends at 0. If an artificial variable is still basic, it is at level 0. Pivot it out on any nonzero entry of its row, keeping the point fixed. If the row has no nonzero entry outside the artificials, that row is a combination of the others: delete it, as with chapter 12's glue row. Phase II then starts from a true basis.
- Phase II stops with a column B⁻¹A_j ≤ 0 and c̄_j > 0. The value is unbounded along an extreme ray.
- Phase II stops with c̄ ≤ 0. The plan x and the prices y = c_B B⁻¹ satisfy yA ≥ c and yb = cx.
Case 4 is the theorem chapter 6 promised.
Theorem (strong duality). If an LP has an optimal plan, its dual has an optimal offer, and the two values are equal.
Proof. Write the LP in standard form (chapter 3). Run both phases with Bland's rule. They stop, by the theorem above. The plan is feasible, so case 1 is ruled out. It has an optimum, so case 3 is ruled out. Case 4 gives y with yA ≥ c and yb = cx. Weak duality makes both optimal. ∎
The mill's 84 = 84 was never a coincidence of small numbers. For every LP with an optimum, the dual has an offer with the same value, and the simplex method finds it.
Aside: a circle mostly seen on paper. Hoffman built the first cycling example in 1953 at the National Bureau of Standards, and Beale published a simpler one in 1955. On real problems cycling was rarely seen, partly because rounding errors broke the ties. Bland's 1977 rule came from combinatorics, through matroids, not from computation. That is why its proof uses only signs and indices.
The one thing to remember. Degeneracy lets the method change its explanation of a point without moving. Bland's lowest-index rule rules out returning to an old explanation. Once the method always stops, its last dictionary proves strong duality.
16Repairing a plan from the price side: the dual simplex
The mill has found (8, 12), worth 84, and the buyer has priced it at 2 and 1. Then the glue store is cut from 52 to 50 tonnes: 2t + 3f ≤ 50. The plan uses 2·8 + 3·12 = 52, so it is broken. The prices are not: they are still a fair offer for the products, so they still bound every plan's value. Chapter 14's method needs a feasible plan to start from. This chapter's method starts from fair prices instead and repairs the plan.
The broken dictionary
Add the glue slack s₃ = 50 − 2t − 3f and write it in the final dictionary's nonbasic variables. Using t = 8 + s₁ − 2s₂ and f = 12 − s₁ + s₂:
t = 8 + s₁ − 2s₂ f = 12 − s₁ + s₂ s₃ = −2 + s₁ + s₂ z = 84 − 2s₁ − s₂
The z-row is still fine: every coefficient is ≤ 0. The basis is dual feasible: y is a fair offer, so 84 still bounds every plan. The basis is not primal feasible, because s₃ = −2 means 2 tonnes of glue over.
One dual pivot, every number explained
Who leaves. A negative basic variable leaves; here s₃ is the only one.
Who enters. Glue must come down by 2. Raising s₁ (idle lathe hours) or s₂ (idle press hours) frees glue at 1 tonne per hour, read from the s₃ row. Each hour of idling costs its price from the z-row, 2 for the lathe and 1 for the press. The cost per tonne of glue freed is
lathe 2/1 = 2, press 1/1 = 1.
This is the dual ratio test: |z-row coefficient| ÷ (repair per unit), over the variables that help, meaning a positive coefficient in the broken row. The press is cheapest, so s₂ enters. Taking the minimum is what keeps every z-row coefficient ≤ 0, so the prices stay fair after the pivot. A larger ratio would push some other coefficient positive.
Rewriting. s₂ = 2 + s₃ − s₁, and substituting:
t = 4 + 3s₁ − 2s₃ f = 14 − 2s₁ + s₃ s₂ = 2 − s₁ + s₃ z = 82 − s₁ − s₃
Every basic variable is ≥ 0 and every z-row coefficient is ≤ 0, so this is optimal: (4, 14), worth 82, exactly what chapter 12's glue animation showed at g = 50. The new prices are lathe 1, press 0 and glue 1. The bill is 32·1 + 50·1 = 82, and the offer is fair: 1 + 2·1 = 3 for 3-ply and 2 + 3·1 = 5 for 5-ply.
Geometrically, the plan moved from (8, 12) up the lathe wall to (4, 14), idling 2 press hours. In chapter 14 the plan was always feasible and the prices became fair only at the end. Here the prices are fair at every step, and the plan becomes feasible at the end.

The method in general
The dictionary is x_B = b̄ − Σ ā_j x_j, read row by row, with z = v + Σ c̄_j x_j and c̄ ≤ 0 throughout.
- If b̄ ≥ 0, stop: the basis is optimal (chapter 14's theorem).
- Otherwise pick a row r with b̄_r < 0. Its basic variable leaves.
- Among the nonbasic j that raise x_r, that is ā_rj < 0 in this sign convention (in the mill's s₃ row the coefficients appear as +1), choose the one with the smallest |c̄_j| / |ā_rj|.
- If no j raises x_r, stop: no plan exists.
Theorem (infeasibility). If row r has b̄_r < 0 and no nonbasic variable raises x_r, the LP has no plan.
Proof. Every plan satisfies the dictionary's equations. The row reads x_r = b̄_r − Σ ā_rj x_j with b̄_r < 0 and every −ā_rj ≤ 0. For x ≥ 0 the right side is < 0, but x_r ≥ 0. ∎
That row is a Farkas certificate (chapter 10). It is a combination of the original rows, with weights from B⁻¹, that no nonnegative plan can satisfy.
Theorem (the entering variable cannot leave next). After a dual pivot, the variable that entered is strictly positive. So the next pivot cannot choose it to leave.
Proof. Its new value is b̄_r / ā_rj. Both are negative: b̄_r < 0 by the choice of row, ā_rj < 0 by the choice of column. Only negative variables leave. ∎
At the glue pivot, s₂ entered at 2 > 0.
Why it is the simplex method on the dual. Each dual pivot is a primal pivot of the buyer's LP. The z-row coefficients are the buyer's slacks, and they stay feasible. The negative b̄_r is a buyer's reduced cost that still improves the bill, and the dual ratio test is the buyer's ordinary ratio test. Each pivot changes the value by c̄_j·(b̄_r/ā_rj) ≤ 0. Here it was −1 · 2 = −2, from 84 to 82. The bill falls, or stays put when c̄_j = 0, the dual form of degeneracy. The cure is the mirror of chapter 12's: perturb the costs c, not b, so that no c̄_j is 0. Then each pivot lowers the bill strictly, and no basis repeats.
When to use which. Use the primal method when the plan is feasible and the prices are not. Use the dual method when the prices are fair and the plan is not. The second case is what happens after adding a row, as here, or after cutting a stock. Chapter 17 uses it for that reason. The old basis stays dual feasible, and a few dual pivots usually finish the job. Re-solving from scratch would not be needed.
Aside: the method found sideways. Lemke published the dual simplex method in 1954, working from the dual problem but stepping on the primal tableau. It later became the standard way to re-solve, notably inside branch-and-bound codes, where every branch adds one row to an LP that is already optimal. That situation is the glue cut, over and over.
The one thing to remember. The dual simplex keeps the prices fair and repairs the plan. The leaving row is what is broken, and the dual ratio test picks the cheapest repair per unit. A broken row that nothing can repair is a proof that no plan exists.
17Reading the last dictionary: sensitivity
The simplex method stops with more than an answer. Its last dictionary
t = 8 + s₁ − 2s₂ f = 12 − s₁ + s₂ z = 84 − 2s₁ − s₂
says how the answer moves when the data moves. Chapter 7 found the lathe's price range by sliding a wall. This chapter reads the same range, and every other one, off these three lines.
B⁻¹ is printed in the slack columns
The slacks started as the identity: s₁ = 32 − t − 2f and s₂ = 20 − t − f. Each pivot is a row operation, so at the end the slack columns record the product of all of them, which is B⁻¹. Read the coefficients of s₁ and s₂ with their signs flipped, because the dictionary has them on the right-hand side:
B⁻¹ = [ −1 2 ] (row t) [ 1 −1 ] (row f)
Check: B = [ 1 2 ; 1 1 ] has the 3-ply and 5-ply columns, and B⁻¹B = I. B⁻¹(32, 20) = (−32 + 40, 32 − 20) = (8, 12).
Each column of B⁻¹ is the effect of one extra hour on the plan:
- One more lathe hour, column (−1, 1): one batch moves from 3-ply to 5-ply. This was chapter 7's sentence.
- One more press hour, column (2, −1): two more 3-ply and one fewer 5-ply.
How far the stock can move
Give the lathe 32 + δ hours. The basis stays the same, so the plan is
(t, f) = (8, 12) + δ(−1, 1) = (8 − δ, 12 + δ),
which is a plan only while both entries are ≥ 0: −12 ≤ δ ≤ 8, or 20 ≤ lathe ≤ 40. That is chapter 7's range, found here without moving any wall. For the press, (8 + 2δ, 12 − δ) ≥ 0 gives −4 ≤ δ ≤ 12, or 16 ≤ press ≤ 32. Inside both ranges the value is 84 + 2δ₁ + δ₂, so the prices are the slopes.
Geometrically, B⁻¹b ≥ 0 says b = t·(1, 1) + f·(2, 1) with t, f ≥ 0: the stock lies in the cone of the two product columns. That is chapter 10's cone picture. The ranges are where (32 + δ, 20) and (32, 20 + δ) leave the cone. At lathe 40, (40, 20) = 20·(2, 1) lies on the 5-ply edge, and at lathe 20, (20, 20) = 20·(1, 1) lies on the 3-ply edge.
How far the values can move
Now change the value of 3-ply to 3 + δ. The plan stays put while the prices stay fair. With y = c_B B⁻¹:
y = (3 + δ, 5) B⁻¹ = (2 − δ, 1 + 2δ),
which is ≥ 0 while −1/2 ≤ δ ≤ 2, that is 2.5 ≤ value of 3-ply ≤ 5. For 5-ply, y = (2 + δ, 1 − δ) gives 3 ≤ value of 5-ply ≤ 6.
This is chapter 2's picture read backwards. The plan (8, 12) is optimal while c = y₁(1, 2) + y₂(1, 1) with y ≥ 0, that is, while the value arrow stays between the normals of the two tight walls. At 3-ply worth 2.5, c = (2.5, 5) is parallel to the lathe row and the whole lathe edge ties. At 5, c = (5, 5) is parallel to the press row.
The two kinds of range mirror each other:
| change | stays optimal while | cone |
|---|---|---|
| stock b | B⁻¹b ≥ 0 | b in the cone of the basic columns |
| values c | c_B B⁻¹ A ≥ c | c in the cone of the tight rows |

A new product
The Trust proposes birch-faced 5-ply: 2 lathe hours and 2 press hours a batch, worth 7. Is it worth making? Charge the current prices for the hours it uses:
c̄ = 7 − (2·2 + 1·2) = 7 − 6 = 1 > 0.
It earns 1 more than its hours are worth, so the current plan is no longer optimal. This needs no re-solve: one dot product with y answers it, and the product is worth adding exactly when its value is above 6.
To find how much to make, pivot it in. Its column in the current basis is B⁻¹(2, 2) = (−2 + 4, 2 − 2) = (2, 0). Each birch batch takes 2 batches of 3-ply and 0 of 5-ply. In the ratio test only the 3-ply row is positive: 8 ÷ 2 = 4. So 4 birch batches replace all 8 batches of 3-ply. The new plan is (t, f, birch) = (0, 12, 4). It uses 24 + 8 = 32 lathe hours and 12 + 8 = 20 press hours, and its value is 60 + 28 = 88 = 84 + 1·4.
The new prices solve 2y₁ + y₂ = 5 and 2y₁ + 2y₂ = 7: y = (3/2, 2). The press hour is now worth more than the lathe hour, because the new product is press-heavy. The offer is still fair for 3-ply: 3/2 + 2 = 7/2 ≥ 3. The bill is 32·3/2 + 20·2 = 88.
A new row
A new row is chapter 16. Write the row in the current nonbasic variables. If the current plan violates it, the prices are still fair, so the dual simplex repairs the plan in a few pivots.
Aside: the answer as a function. In 1955 Saul Gass and Thomas Saaty published the parametric objective function method. It treats the value as c + λd and follows the optimal basis as λ moves, which turns these ranges into a sweep. Gass wrote the first textbook on linear programming in 1958. Today every LP solver prints a sensitivity report, because the people paying for a plan want to know how firm it is.
The one thing to remember. The last dictionary contains B⁻¹. B⁻¹b ≥ 0 says how far the stocks can move, c_B B⁻¹A ≥ c says how far the values can move, and c̄ = c − yA says in one dot product whether a new product is worth making.
18Ceilings without rows: bounded variables
The Trust's buyer for 5-ply takes at most 10 batches. As a row, that is f ≤ 10: one more slack, one more row, and a 3 × 3 basis where 2 × 2 did the job. A bound is a different kind of wall from a machine. It involves one variable, and the simplex method can handle it without a row.
Nonbasic at a ceiling
In chapter 14 every nonbasic variable sat at 0, its floor. Now let a nonbasic variable sit at either end of its interval l ≤ x ≤ u. With L the nonbasic variables at their floors and U those at their ceilings,
x_B = B⁻¹b − B⁻¹A_L l_L − B⁻¹A_U u_U.
This is the dictionary with the nonbasic variables set to their bounds instead of to 0. The basis is feasible when l_B ≤ x_B ≤ u_B.
Theorem. Such a point is a corner of {x : Ax = b, l ≤ x ≤ u}.
Proof. Its tight rows are the m equations and the n − m bounds on the nonbasic variables. The bound rows fix the nonbasic coordinates, and the equations then fix x_B = B⁻¹(…), because B is invertible. So the only solution of the tight rows is the point itself. Their rank is n, and by chapter 11 the point is a corner. ∎
The reduced costs are unchanged: c̄_j = c_j − yA_j. What changes is which sign helps.
- At a floor: raising the variable helps if c̄_j > 0.
- At a ceiling: lowering it helps if c̄_j < 0.
Three ways a step can end
When x_k moves, its step θ is limited by three kinds of walls:
- a basic variable falling to its floor: (x_Bi − l_Bi) ÷ h_i for h_i > 0;
- a basic variable rising to its ceiling: (u_Bi − x_Bi) ÷ (−h_i) for h_i < 0;
- x_k itself reaching its other bound: u_k − l_k.
Here h is B⁻¹A_k, signed so that x_B moves by −θh. The first two are chapter 14's ratio test with the ceiling added. The third is new. When it is the tightest, x_k just jumps to its other bound, and nothing enters or leaves. This is a bound flip: a pivot that changes no basis.
The mill with a market cap
Start at (0, 0) with the basis {s₁, s₂} and 0 ≤ f ≤ 10. 5-ply has the larger reduced cost, 5, so f moves up. The limits are:
- lathe 32 ÷ 2 = 16;
- press 20 ÷ 1 = 20;
- its own ceiling 10 − 0 = 10.
The ceiling is tightest, so f flips to 10 and the basis stays {s₁, s₂}. The point is now (0, 10), worth 50.
Write f = 10 − f̄, where f̄ ≥ 0 measures how far below its ceiling f is:
s₁ = 12 − t + 2f̄ s₂ = 10 − t + f̄ z = 50 + 3t − 5f̄
The −5 on f̄ says that lowering f costs 5 a batch, so f stays at its ceiling. t enters. The ratios are 12 for the lathe and 10 for the press, so s₂ leaves:
t = 10 − s₂ + f̄ s₁ = 2 + s₂ + f̄ z = 80 − 3s₂ − 2f̄
Every coefficient in z is ≤ 0, so this is optimal: (10, 10), worth 80, with 2 lathe hours idle. The prices are
- press hour: 3;
- the cap: 2 per batch. Allowing one more 5-ply batch swaps one 3-ply batch for one 5-ply batch on the press, and gains 5 − 3.
The bill is 20·3 + 10·2 = 80. With the cap written as a row, the same walk needs a 3 × 3 basis. Here it took one ordinary pivot and one flip, and B stayed 2 × 2.

Geometrically, the bound is a wall like any other. The method treats it as a wall it knows the position of, so it needs no row of B⁻¹ to find it.
Aside: why codes care. Real models are full of bounds: capacities, minimum runs, 0 ≤ x ≤ 1 for every yes-or-no decision once it is relaxed. Dantzig handled upper bounds implicitly in 1955, so that a model with n bounded variables does not grow by n rows. Simplex codes still use the device.
The one thing to remember. A bound is a wall that needs no row. A nonbasic variable may sit at its ceiling, a step may end with a bound flip that changes no basis, and the ceiling gets a price like any other wall.
19Prices first, then plans: the primal–dual method
The Trust's 1938 question to Kantorovich was about machines: which machine should do which job. Take three lathes and three orders, birch, pine and alder sheet. Each lathe does exactly one order. The table gives the hours lathe i needs for order j:
| birch | pine | alder | |
|---|---|---|---|
| lathe 1 | 4 | 2 | 5 |
| lathe 2 | 3 | 6 | 4 |
| lathe 3 | 5 | 4 | 7 |
The LP, with x_ij = 1 if lathe i takes order j, is: minimise Σ c_ij x_ij subject to every row of x summing to 1, every column summing to 1, and x ≥ 0. Its dual has a charge u_i for each lathe and v_j for each order:
maximise Σu_i + Σv_j subject to u_i + v_j ≤ c_ij for every pair.
The charges are free in sign because the constraints are equations. Weak duality in one line: add u_i + v_j ≤ c_ij over the three pairs of any assignment. Each u_i and each v_j appears exactly once, so every assignment takes at least Σu + Σv hours.
The idea: let the prices choose which pairs may be used
Complementary slackness (chapter 7) says that an optimal assignment uses only tight pairs, those with u_i + v_j = c_ij. So keep the charges fair and ask a smaller question, the restricted primal: can the tight pairs alone make a full assignment?
- If yes, it costs exactly Σu + Σv, and weak duality says it is optimal.
- If no, raise the charges to make more pairs tight, keeping them fair, so that the bound Σu + Σv rises.
The method improves the prices and only then looks for a plan, which is the reverse of chapter 14's order.
The run, every number
Round 0. Charge each lathe its fastest job: u = (2, 3, 4), v = (0, 0, 0). The bound is 9. The tight pairs are lathe 1–pine, lathe 2–birch and lathe 3–pine. Lathes 1 and 3 both have only pine. Two lathes with one order between them make a full assignment impossible.
The obstruction says how to move. Raise u₁ and u₃ by θ and lower v_pine by θ:
- Tight pairs: lathe 1–pine and lathe 3–pine change by +θ − θ = 0, so they stay tight. Lathe 2–pine falls by θ, so it stays fair.
- The bound: rises by θ(2 − 1) = θ, two lathes raised against one order lowered.
- How far: θ is limited by the pairs from lathes {1, 3} to the other orders. Their slacks are 4 − 2 = 2, 5 − 2 = 3, 5 − 4 = 1 and 7 − 4 = 3, so θ = 1, and lathe 3–birch goes tight.
Round 1. u = (3, 3, 5), v = (0, −1, 0), and the bound is 10. Lathe 3 now has birch or pine, but birch is lathe 2's only order. Lathes {1, 2, 3} reach only {birch, pine}: three lathes, two orders. Raise all three u by θ and lower v_birch and v_pine by θ. The bound rises by θ(3 − 2). The pairs to alder have slacks 2, 1 and 2, so θ = 1, and lathe 2–alder goes tight.
Round 2. u = (4, 4, 6), v = (−1, −2, 0), and the bound is 11. Now lathe 1–pine, lathe 2–alder and lathe 3–birch are all tight, so they form a full assignment. Its cost is 2 + 4 + 5 = 11 = Σu + Σv, so it is optimal, and the charges prove it.

Why the obstruction always exists
Theorem (Hall–Kőnig, as a Farkas certificate). If the tight pairs contain no full assignment, there is a set S of lathes whose tight orders N(S) are fewer than |S|.
Then λ = +1 on the u of S and −1 on the v of N(S) is exactly chapter 10's alternative for the restricted primal:
- It keeps the tight pairs fair: every tight pair from S lands in N(S), so it changes by +1 − 1 = 0. A tight pair from outside S changes by 0 or −1.
- It raises the bound: by |S| − |N(S)| > 0.
To find S, start from an unassigned lathe and follow tight pairs to orders, then assignments back to lathes. Every lathe reached is in S. Each round makes at least one new pair tight from S to a new order. Either that order is free, and the assignment grows, or its lathe joins S. So at most n rounds pass between growths.
The method in general
For min cx with Ax = b, x ≥ 0 and b ≥ 0, start with dual-feasible prices π, so that A_jπ ≤ c_j for every j. Let I be the set of tight columns.
- Restricted primal. Find x_I ≥ 0 with A_I x_I = b, by Phase I using only the columns in I. If it succeeds, x and π satisfy complementary slackness, so both are optimal.
- Otherwise, Farkas (chapter 10) gives λ with λb > 0 and A_jλ ≤ 0 for every j in I.
- Step. Move π to π + θλ. The tight columns stay fair, the bound rises by θ·λb, and θ is the largest step keeping every column fair: θ = min over j with A_jλ > 0 of (c_j − A_jπ) ÷ A_jλ.
- No limit. If no j has A_jλ > 0, the dual is unbounded, so the primal has no plan (weak duality).
In the assignment case, λ is the ±1 vector above, θ is the smallest slack leaving S, and λb = |S| − |N(S)|.
Aside: a method with three discoverers. In 1955 Harold Kuhn published the "Hungarian method". He named it after Dénes Kőnig and Jenő Egerváry, whose 1931 papers held its two halves: the matching obstruction, and the reweighting. Dantzig, Ford and Fulkerson generalised it to every LP in 1956 as the primal–dual algorithm. Then in 2006 it turned out that Jacobi had described the method for an equivalent problem; his manuscript was published posthumously, in Latin, in 1890. Kuhn told the story in 2012 as "a tale of three eras".
The one thing to remember. The primal–dual method keeps the prices fair, allows only the pairs the prices make tight, and when those pairs can't do the job, the reason (too many lathes chasing too few orders) is itself the direction that raises the prices.
20Four outcomes, and the strictest kind of fit
Chapter 15 proved strong duality by running the simplex method until it stopped. This chapter proves it again from Farkas alone, lists everything that can happen to a primal–dual pair, and ends with a sharper fact than complementary slackness.
Strong duality from Farkas
Theorem. If the mill's LP max{cx : Ax ≤ b, x ≥ 0} has a best plan worth z*, the buyer's LP has a fair offer billing exactly z*.
Proof. For any ε > 0, no plan reaches z* + ε. In other words, the system Ax ≤ b, −cx ≤ −(z* + ε), x ≥ 0 has no solution. By chapter 10's Farkas lemma there are weights (y, μ) ≥ 0 with yA − μc ≥ 0 and yb − μ(z* + ε) < 0.
- μ = 0 is impossible. Then yA ≥ 0 and yb < 0, which is a proof that Ax ≤ b has no plan at all. But a best plan exists.
- So μ > 0. Divide by μ. Then ŷ = y ÷ μ satisfies ŷA ≥ c, so it is a fair offer, and ŷb < z* + ε.
So some fair offer bills less than z* + ε, for every ε, and none bills less than z*, by weak duality. The buyer's LP is therefore feasible and bounded below, and its region y ≥ 0 contains no line, so chapter 11's fundamental theorem gives it a best corner with some bill w*. Then z* ≤ w* < z* + ε for every ε > 0, so w* = z*. ∎
The division by μ is the step that matters. μ is the weight on the value row. Dividing by it rescales the certificate so that it prices one rouble of value at exactly one rouble.
A third form: no better direction nearby
The oldest form of the argument is the one chapter 2 used on the mill: look only at the optimal point and the directions leaving it.
Theorem (local ⇒ global ⇒ dual). For a plan x* of max{cx : Ax ≤ b}, the following are equivalent:
- x* is optimal;
- no direction d with A_I d ≤ 0 has cd > 0, where I is the set of rows tight at x*;
- c = Σ_{i∈I} y_i A_i for some y ≥ 0. Such y, extended by zeros, is a fair offer that bills exactly cx*.
Proof.
- 1 ⇒ 2. If A_I d ≤ 0, the slack rows have room, so x* + εd is a plan for small ε > 0, by chapter 11's safe step. If also cd > 0, that plan beats x*.
- 2 ⇒ 3. This is Farkas (chapter 10), with the rows A_I as the system and c as the target.
- 3 ⇒ 1. yb = Σ_I y_i b_i = Σ_I y_i A_i x* = cx*, because the rows in I are tight. Weak duality then says no plan exceeds cx*.
The step 2 ⇒ 1 is the surprising one. "Nothing better nearby" implies "nothing better anywhere", and the reason is convexity. If some plan x beat x*, then d = x − x* would point from x* into the region and improve, so there would be something better nearby after all. ∎
At the mill, I is {lathe, press} and c = (3, 5) = 2·(1, 2) + 1·(1, 1). That is chapter 2's certificate, now in its general form. The three proofs of strong duality use three tools: pivoting (chapter 15), a Farkas certificate for the value row (above), and a Farkas certificate for the local cone (here). They all produce the same prices.
The four outcomes
Weak duality rules out one combination, a plan worth more than a bill. Strong duality rules out a gap. What is left:
| buyer has a fair offer | buyer has none | |
|---|---|---|
| mill has a plan | both have best points, equal values | mill's value is unbounded |
| mill has none | buyer's bill is unbounded below | possible |
The bottom-right case needs an example. Take max 2x₁ − x₂ with x₁ − x₂ ≤ 1, −x₁ + x₂ ≤ −2 and x ≥ 0.
- No plan: the two rows add to 0 ≤ −1.
- No fair offer: the buyer needs y₁ − y₂ ≥ 2 and −y₁ + y₂ ≥ −1, that is y₁ − y₂ ≤ 1.
Each side is infeasible by its own Farkas certificate, and neither failure causes the other.
Strict complementary slackness
Complementary slackness says that in each pair (a slack and its price, or a batch count and its loss per batch), at least one is zero. Goldman and Tucker proved in 1956 that some optimal pair gets exactly one zero in every pair.
Chapter 12's glue store of 52 shows why that is not automatic. The plan (8, 12) leaves no lathe, press or glue idle, and both products are made, so every primal quantity in sight is positive or tight. The optimal prices are the segment y = (2 − s, 1 − s, s), 0 ≤ s ≤ 1:
| s | prices | strict? |
|---|---|---|
| 0 | (2, 1, 0) | no: glue is tight and priced 0 |
| ½ | (3/2, 1/2, 1/2) | yes: all three tight rows are priced |
| 1 | (1, 0, 1) | no: press is tight and priced 0 |

Every point on the segment bills 84. The two ends are the corners the simplex method returns, and neither is strict. The strict pair lives in the middle of the segment, the face of optimal prices. The central path followed by interior-point methods converges to such a middle point, which is strictly complementary (Güler and Ye, 1993).
Theorem (Goldman–Tucker). Every LP with a best plan has an optimal pair (x, y) in which, for each row, exactly one of the slack and the price is zero, and for each column, exactly one of x_j and the loss yA_j − c_j is zero.
Proof. Take a row i. Ask how slack row i can be while the plan stays optimal: maximise s_i subject to Ax + s = b, cx ≥ z*, x, s ≥ 0.
- If some optimal plan has s_i > 0, keep it as row i's witness.
- If not, this LP has value 0. Strong duality (chapter 15) gives multipliers w ≥ 0 with w_i ≥ 1, and μ ≥ 0 on the value row, such that wA ≥ μc and wb = μz*.
- If μ > 0, then y = w ÷ μ is fair and bills z*, so it is optimal, and y_i ≥ 1 ÷ μ > 0.
- If μ = 0, then wA ≥ 0 and wb = 0, so w can be added to any optimal y* without breaking fairness or changing the bill. The price y* + w is optimal, and its price for row i is at least 1.
Either way, row i has an optimal witness with a positive slack or a positive price. Columns work the same way, with x_j and the loss yA_j − c_j. Now average all the witness plans, and separately all the witness prices. Averages of optimal points are optimal, because the optimal sets are convex, and an entry that is positive in one witness stays positive in the average. So every pair has at least one positive member. Complementary slackness between two optimal points forbids two, so exactly one is positive. ∎
The averaging step is chapter 1's convexity doing real work. The average of optimal plans is optimal, and a positive entry stays positive in the average.
Aside: Tucker's seminar. Alan Goldman and Albert Tucker published this in Linear Inequalities and Related Systems (1956). The same Princeton volume carried Dantzig, Ford and Fulkerson's primal–dual algorithm from chapter 19. Tucker's group was where duality became a theory rather than a trick. Gale, Kuhn and Tucker had proved the duality theorem for LP in 1951, and Kuhn and Tucker's paper on nonlinear programming came the same year.
The one thing to remember. Strong duality is Farkas with the value row's weight divided out. Of the four sign patterns only "both feasible" gives equal values. Among all the optimal prices, the ones in the middle of the face fit strictly, and the corners the simplex method finds usually do not.
Where to go next
The mill ends where the subject's first decade ended, around 1956, with the duality theorem proved and the simplex method working. Three questions were left open, and each became a field.
Is the walk fast? In practice it was, and nobody could say why. In 1972 Klee and Minty built problems on which Dantzig's rule visits every corner. In 1979 Leonid Khachiyan proved that linear programs can be solved in polynomial time, with an ellipsoid method that was hopeless in practice. In 1984 Narendra Karmarkar, at Bell Labs, gave a polynomial method that also worked, and it went through the middle of the shape, the route Dantzig had pictured and rejected. Interior-point methods follow the central path, and chapter 20's strictly complementary pair is where that path ends. The simplex against interior point guide races the two routes, and LP on a GPU takes up first-order methods for problems too big to pivot.
What if the answers must be whole numbers? Chapter 5 showed that the theory breaks. Ralph Gomory's 1958 cutting planes add rows that remove fractional corners. Ailsa Land and Alison Doig's 1960 branch and bound splits the problem and uses the LP value as a ceiling, which is chapter 5's relaxation used systematically. Each branch adds one row to an LP that is already optimal, which is chapter 16's dual simplex at work.
What if there are too many columns to write down? In 1961 Gilmore and Gomory cut paper rolls with millions of possible patterns. They generated only the patterns whose reduced cost was positive, which is chapter 17's new-product test asked over and over. The branch-and-price guide is that idea at full size.
Kantorovich's resolving multipliers run through all three: the prices that prove a plan is best are also what the faster methods compute, what the integer methods bound with, and what decides which column enters next.
Glossary
| here | in Tovey and other textbooks |
|---|---|
| plan | feasible solution |
| the region of possible plans | feasible region |
| wall | constraint, or the hyperplane where it holds with equality |
| hours to spare | slack |
| tight wall | active (binding) constraint |
| line of equal value | level set of the objective |
| corner | extreme point, vertex |
| arrow a of a resource | the constraint's row, its normal vector |
| shadow on a | scalar projection, a·x ÷ |a| |
| the two halves either side of a wall | half-spaces |
| value arrow c | objective vector, gradient of the objective |
| one form: maximize c·x, Ax ≤ b, x ≥ 0 | canonical (standard inequality) form |
| a variable that may be negative | free (unrestricted) variable |
| the new variable z | auxiliary variable; z with z ≥ each gᵢ is an epigraph variable |
| complete sets, the largest of the smallest | max-min (assortment) objective |
| the largest disc that fits | Chebyshev centre |
| a cost that gets steeper | piecewise-linear convex function |
| a cost that gets cheaper | piecewise-linear concave function |
| the overtime bill z, with z ≥ each piece | epigraph variable |
| the shortfall, max(0, 14 − f) | positive part |
| a required proportion | ratio (blending) constraint |
| a balance: in equals out | flow conservation, inventory balance |
| a plan fixed before the order is known | first-stage decision (two-stage stochastic program) |
| a shortfall for each possible order | recourse (second-stage) variable |
| the smallest disc that reaches every wall | minimax-distance ball meeting every hyperplane |
| a variable that is 0 or 1 | binary variable |
| rows and objective linear, some variables whole numbers | mixed-integer linear program (MILP) |
| allowing z anywhere from 0 to 1 | LP relaxation |
| paying for a setup | fixed-charge model |
| f = 0 or f ≥ 14 | semi-continuous variable |
| one rule or the other | disjunctive (either–or) constraint |
| the bound M | big-M constant |
| the buyer's problem, the price problem | dual linear program |
| the mill's problem | primal linear program |
| a fair offer | dual feasible solution |
| every fair bill is a ceiling | weak duality |
| a plan and an offer that meet | strong duality, a primal–dual optimal pair |
| what one more hour is worth | shadow price, marginal value |
| the nearest plan | projection onto a closed convex set |
| a wall between a point and a shape | strictly separating hyperplane |
| the angle at the nearest point is never acute | variational inequality (obtuse-angle) characterisation of the projection |
| shadow | projection onto some coordinates |
| pair every lower bound with every upper bound | Fourier–Motzkin elimination |
| either a plan or a proof | theorem of the alternative (Farkas's lemma) |
| the cone of the columns | finitely generated (polyhedral) cone |
| no strict improvement | Gordan's theorem |
| a corner, found by rows | basic feasible solution (BFS) |
| rows that hold with equality | binding (active) constraints |
| a way to run forever | direction (recession direction) |
| a region with no lines | pointed polyhedron |
| too many tight rows at one corner | degenerate basic solution |
| a step that changes the basis but not the point | degenerate pivot |
| the escape routes | recession cone |
| an edge of the escape cone | extreme ray |
| corners mixed plus escape | Minkowski–Weyl / Motzkin decomposition |
| value per unit along an edge | reduced cost |
| the safe step to the next wall | ratio test |
| the walk to a first real plan | Phase I |
| returning to an old basis without moving | cycling |
| lowest index enters and leaves | Bland's rule |
| fair prices, broken plan | dual feasible, primal infeasible basis |
| cheapest repair per unit | dual ratio test |
| how far the data can move before the basis changes | ranging (sensitivity analysis) |
| jumping to the other bound without changing the basis | bound flip |
| keep prices fair, use only tight pairs | primal–dual method (Hungarian method for assignment) |
| an optimal pair with exactly one zero in every pair | strict complementary slackness (Goldman–Tucker) |
| the range where the price holds | allowable increase and decrease, ranging |
| the best value as stock changes | optimal value function (concave in b) |
| idle resources are free; what is made is priced at its value | complementary slackness |
Further reading
Craig A. Tovey, Linear Optimization and Duality: A Modern Exposition, CRC Press, 2021. Its chapters 1 to 8 cover the ground of this guide, with more examples and exercises.
Vašek Chvátal, Linear Programming, Freeman, 1983. The cycling example of chapter 15 is his, and his dictionaries are the ones used here.
Alexander Schrijver, Theory of Linear and Integer Programming, Wiley, 1986. The history notes at the end of its chapters are the best short account of who proved what, and when.
Running the code
From the repository root, make bootstrap once. Then, in this folder,
make check re-renders every figure, rebuilds the page and runs the tests.