Part I · trunk A · linear programming · branch
Two ways through the middle of the polyhedron: one that settled a theoretical question and is never used, and one that runs in every modern solver.
needs 02feeds 09~2 h slides + 2½ h lab
04 · overview
Why the question stayed open after simplex, and what "polynomial" means for an LP.
Cut an ellipsoid in half, wrap the half in a smaller one, repeat. Polynomial, and impractical.
A barrier keeps you inside, and following the central path reaches the optimum in a few dozen Newton steps.
Words with a dotted underline are glossary terms: click one for its definition. G lists every term in the unit, N shows the notes, where the proofs live. Unit 01's polygon is the running example again: a solid underline like that one shows it on hover. Optional extra: interactive figures, linked from the slides they support by a small ▸ chip; skip them freely.
Then: the pure barrier method breaks down in floating point past $t \approx 10^6$. HiGHS's IPM beats its simplex 7× cold at $n = 3000$, and loses 4× on the warm re-solve.
section 1
Open from 1947 until 1979, even though LPs were being solved every day.
04 · history
Polynomial in the bit size $L$ of the input: the number of bits needed to write $A, b, c$ as integers.
Example: the constraint $x + y \le 4$ needs about 2 bits per coefficient; $1000x + y \le 4096$ needs up to 13. Same shape of problem, more bits, and a polynomial method may take more steps.
Whether there is a strongly polynomial LP algorithm, polynomial in $m$ and $n$ alone, independent of the numbers, is still open. It is one of Smale's problems for the 21st century.
section 2
Binary search in $n$ dimensions, with ellipsoids as the intervals.
04 · ellipsoid
In 2-D the new ellipse has semi-axes $\tfrac23$ and $\tfrac{2}{\sqrt3}$ of the old radius, and $\tfrac23 \cdot \tfrac{2}{\sqrt3} \approx 0.77$ of the area.
Each step shrinks the volume by a fixed factor, so the ellipsoid soon becomes too small to contain the feasible set. The set was therefore empty, or the centre found it.
Step 3 is a central cut: it passes through the centre, so exactly half is kept. The next slide does two steps with numbers.
04 · ellipsoid · example
Find a point of unit 01's polygon with $x + y \ge 3$, written $-x - y \le -3$. Start: ball of radius $R = 5$ at the origin, $P = 25I$.
| $k$ | centre | check the constraints | $P$ |
|---|---|---|---|
| 0 | $(0, 0)$ | $x + y = 0 < 3$ ✗ | $\begin{pmatrix}25 & 0\\0 & 25\end{pmatrix}$ |
| 1 | $(1.18, 1.18)$ | $x + y = 2.36 < 3$ ✗ | $\begin{pmatrix}22.2 & -11.1\\-11.1 & 22.2\end{pmatrix}$ |
| 2 | $(1.96, 1.96)$ | every constraint ✓ | $\begin{pmatrix}24.7 & -19.8\\-19.8 & 24.7\end{pmatrix}$ |
Cut normal $a = (-1, -1)$. $\ Pa = (-25, -25)$, $\ a^\top P a = 50$, so $g = Pa / \sqrt{50} = (-3.54, -3.54)$.
New centre $x' = 0 - g/3 = (1.18, 1.18)$: a third of the radius toward the feasible side. Area kept: $\sqrt{\det P' / \det P} = 0.770$.
Dark strip: the target, the polygon above $x + y = 3$. Dotted: the first cut, $x + y = 0$ through the start centre. Each ellipse holds the half the cut kept.
04 · ellipsoid
The ellipsoid update, for the ellipsoid $E = \{z : (z-x)^\top P^{-1}(z-x) \le 1\}$ and cut normal $a$:
$$g = \frac{P a}{\sqrt{a^\top P a}}, \qquad x' = x - \frac{g}{n+1}$$ $$P' = \frac{n^2}{n^2-1}\left(P - \frac{2}{n+1}\, g g^\top\right)$$An affine map takes $E$ to the unit ball and $a$ to $e_1$, so it suffices to check the unit ball, where the new ellipsoid has the axes on the slide before last.
| $n$ | kept per step | steps to halve |
|---|---|---|
| 2 | 0.770 | 2.6 |
| 10 | 0.951 | 13.8 |
| 100 | 0.995 | 139 |
Why: one axis shrinks by $\tfrac{n}{n+1}$, the other $n - 1$ grow by a little less than that shrinks. The net is a loss, but a small one when $n$ is large.
full proof in the notes (N)
So, with lab step 5: if the feasible set holds a ball of radius $r$ inside the start ball of radius $R$, it can stop after $k \ge 2(n+1)\, n \ln(R/r)$ steps: the iteration bound.
04 · ellipsoid
Three gaps between the lab's version and Khachiyan's theorem, each closed by a fact about bit size ($R$ and $r$ from the data):
details in the notes (N)
LP feasibility is decided in $O(n^2 L)$ ellipsoid iterations, each with polynomially many bits of precision. So LP ∈ P.
Lab then, part 5 (shifted random polytopes, $R = 100$):
| $n$ | mean iterations | bound |
|---|---|---|
| 2 | 7.8 | 61 |
| 5 | 29 | 363 |
| 8 | 74 | 882 |
04 · ellipsoid
Look at step 3 again, or at the example: the method only ever asked "which constraint fails at $(1.18, 1.18)$?". It never reads the constraint matrix. It only asks, of one point: "is this feasible, and if not, give me a violated inequality."
That is a separation oracle. It works even when there are exponentially many constraints, provided violated ones can be found efficiently. This is unit 09.
section 3
Stay away from the boundary until the very end.
04 · interior point
Central path of $\max 2x + y$ on unit 01's polygon, computed by the lab's reference solution ($t = 0.01 \cdot 3^k$).
Replace the constraints by a penalty that is infinite on the boundary, the log barrier:
$$\min_x\; f_t(x) = -t\, c^\top x - \sum_{i=1}^m \log(b_i - a_i^\top x)$$The minimizers $x^*(t)$ form a smooth curve, the central path. Finding one of them is centering, done by Newton's method.
The next slide shows all of this on one variable, where it can be solved by hand.
04 · interior point · example
$\max x$ subject to $0 \le x \le 1$: two constraints, slacks $x$ and $1 - x$, optimum 1.
$$f_t(x) = -t\,x - \log x - \log(1 - x)$$Set the derivative to zero, $-t - \tfrac1x + \tfrac{1}{1-x} = 0$, and solve the quadratic:
$$x^*(t) = \frac{t - 2 + \sqrt{t^2 + 4}}{2t}$$The central path of this LP: from the analytic centre $\tfrac12$ toward the optimum 1, never touching the wall.
| $t$ | $x^*(t)$ | $y = \frac{1}{ts}$ | gap $= y_2 - x$ | $1 - x^*$ |
|---|---|---|---|---|
| →0 | 0.5 | huge | $2/t$ | 0.5 |
| 1 | 0.618 | (1.618, 2.618) | 2 | 0.382 |
| 10 | 0.910 | (0.110, 1.110) | 0.2 | 0.090 |
| 100 | 0.990 | (0.010, 1.010) | 0.02 | 0.0099 |
The centre. At $t \to 0$ the barrier alone is minimized at $\tfrac12$, as far from both walls as possible.
A free dual. Always $-y_1 + y_2 = 1 = c$: dual feasible. The gap $b^\top y - c^\top x = y_2 - x$ is exactly $2/t$, with $m = 2$.
The true error $1 - x^*$ is below the gap, so the gap is a safe stopping test.
04 · interior point
At the minimizer the gradient vanishes, and that equation says $A^\top y = c$ for the dual point $\;y = \dfrac{1}{t\, s} > 0$. So $y$ is dual feasible, and the duality gap is exactly
$$b^\top y - c^\top x = \sum_i y_i s_i = \sum_i \frac{1}{t} = \frac{m}{t}.$$derivation in the notes (N)
Path following: centre at $t$, then set $t \leftarrow \mu t$ and re-centre from there. With $\mu = 10$ the number of centerings is $\lceil \log_{10}(m/(t_0\varepsilon)) \rceil$.
Theory: with $\mu = 1 + 1/\sqrt{m}$, each centering needs $O(1)$ Newton steps, for $O(\sqrt m \log(m/\varepsilon))$ in total.
$x^*(t)$ is within $m/t$ of optimal, with a certificate. To reach accuracy $\varepsilon$, run until $t \ge m/\varepsilon$.
At $t = 7.29$: $x = (2.316, 1.597)$, slacks $s = (2.316, 1.597, 0.087, 0.282)$
$y = 1/(ts) = (0.059, 0.086, 1.573, 0.487)$
$A^\top y$: $\ -0.059 + 1.573 + 0.487 = 2$, $\ -0.086 + 1.573 - 0.487 = 1$ ✓
Gap $4 \cdot 1.573 + 0.487 - 6.228 = 0.549 = 4/7.29$ ✓. True error: $6.5 - 6.228 = 0.272$.
04 · interior point
| $t$ | $m/t$ | $b^\top y - c^\top x$ | Newton steps |
|---|---|---|---|
| 1e4 | 1.40e-3 | 1.40e-3 | 6 |
| 1e5 | 1.40e-4 | 1.40e-4 | 6 |
| 1e6 | 1.40e-5 | 1.42e-5 | 6 |
| 1e7 | 1.40e-6 | 1.31e-3 | 100 |
Lab then, part 2: 3 variables, 14 constraints.
On the polygon at $t = 5314$ the slacks are already $(2.5, 1.5, 0.0001, 0.0004)$: entries of $1/s^2$ range from $0.16$ to about $6 \times 10^7$. Each factor of 10 in $t$ adds a factor of 100 to that spread.
The Hessian $A^\top \mathrm{diag}(1/s^2) A$ has entries of size $1/s_i^2$. Near the optimum some slacks are $\approx 10^{-7}$ and others $\approx 1$, so its condition number reaches $10^{14}$ and beyond, and the Newton direction becomes numerical noise.
This is floating-point breakdown. Production IPMs (primal–dual) solve a better-behaved system with careful factorizations, and hand over to simplex (crossover) for an exact vertex.
section 4
Cold solves favour interior point, and warm solves favour simplex.
04 · practice
HiGHS, random sparse LPs with 4 nonzeros per column and $m = n/2$, presolve off:
| $n$ | simplex s | iterations | IPM s | iterations |
|---|---|---|---|---|
| 300 | 0.006 | 283 | 0.006 | 13 |
| 1 000 | 0.069 | 1 359 | 0.025 | 17 |
| 3 000 | 0.95 | 5 268 | 0.14 | 18 |
| 20 000 | 199 | 66 941 | 12 | 25 |
A cold solve: simplex iterations grew faster than $n$ here. Each IPM iteration is more expensive (a sparse Cholesky factorization), but there are few of them.
Crossover on this family is at $n \approx 300$.
The $n = 20\,000$ row comes from then --big. Structured real LPs vary widely: some favour simplex even at large sizes, which is why solvers offer concurrent solving.
04 · practice
Same LP family, $n = 3000$. Solve, add one constraint that cuts off the optimum, re-solve (a warm solve):
| cold | re-solve | |
|---|---|---|
| HiGHS simplex | 0.832 s | 0.033 s (22 it) |
| HiGHS IPM | 0.131 s | 0.136 s (18 it) |
Simplex re-solves 25× faster than it solves cold. IPM re-solves no faster than cold.
The old optimum sits on the boundary, with some slacks $\approx 0$. That is the worst starting point for a barrier method, which needs to begin well inside and on the central path. The old basis, by contrast, is one dual simplex pivot or so from optimal (unit 03).
04 · lab
uv run co test 04
uv run co then 04 # central path plot · float breakdown · IPM vs simplex cold and warm · ellipsoid
04 · checkpoint
Bertsimas & Tsitsiklis, ch. 8 (§8.1–8.3) and ch. 9 (§9.1–9.5).
Boyd & Vandenberghe, Convex Optimization, §11.1–11.3 (free PDF).
Grötschel, Lovász & Schrijver, ch. 3, if you want the full ellipsoid proof.
05 formulations, where integer programming starts. 09 separation ⇔ optimization, where the ellipsoid method pays off, after 08.