Part I · trunk A · linear programming · branch

04

Polynomial-time LP: ellipsoid and interior point

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

The route

1 · is LP in P?

Why the question stayed open after simplex, and what "polynomial" means for an LP.

2 · ellipsoid

Cut an ellipsoid in half, wrap the half in a smaller one, repeat. Polynomial, and impractical.

3 · interior point

A barrier keeps you inside, and following the central path reaches the optimum in a few dozen Newton steps.

getting around

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

Is LP in P?

Open from 1947 until 1979, even though LPs were being solved every day.

04 · history

What was known, and what wasn't

  • 1947 Dantzig's simplex method. Fast in practice.
  • 1972 Klee–Minty: exponential on a built family (unit 02).
  • 1970s LP is in NP ∩ coNP: short certificates both ways (units 01, 03). No NP-hardness was expected, but no polynomial algorithm was known.
  • 1979 Khachiyan: the ellipsoid method solves LP in polynomial time.
  • 1984 Karmarkar: a polynomial interior-point method that also looked practical.
  • 1990s– primal–dual IPMs (Mehrotra 1992) in every commercial solver.
"polynomial" for LP

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

The ellipsoid method

Binary search in $n$ dimensions, with ellipsoids as the intervals.

04 · ellipsoid

The idea

old centre new a·z = a·centre discarded: centre violates a·z ≤ β here

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.

  1. Start with a ball $E_0$ of radius $R$ that contains the feasible set, if nonempty.
  2. If the centre is feasible, stop.
  3. Otherwise a violated constraint $a^\top z \le \beta$ separates the centre from every feasible point. Keep the half $\{a^\top z \le a^\top \text{centre}\}$.
  4. Replace $E_k$ by the smallest ellipsoid containing that half, and repeat.

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

Two ellipsoid steps, with numbers

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$centrecheck 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}$
step 1, by the formulas

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$.

k=0 k=1 k=2 E₀ E₁ (dashed) E₂

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 update, and why the volume shrinks

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.

how slowly, in numbers
$n$kept per stepsteps to halve
20.7702.6
100.95113.8
1000.995139
volume ratio $$\begin{aligned} \frac{\mathrm{vol}\,E'}{\mathrm{vol}\,E} &= \frac{n}{n+1}\left(\frac{n}{\sqrt{n^2-1}}\right)^{n-1} \\ &< e^{-1/(2(n+1))} \end{aligned}$$

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

From feasibility to polynomial-time LP

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):

  • How big to start. If any solution exists, one has coordinates at most $2^{O(L)}$, so that is $R$.
  • How small to stop. A feasible set can be flat, holding no ball at all. Loosening every constraint by a tiny $2^{-O(L)}$ gives it one, without changing whether it is empty.
  • Optimizing, not just finding. Ask for $c^\top x \ge \gamma$ and search over $\gamma$: the sliding objective.

details in the notes (N)

Khachiyan, 1979

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 iterationsbound
27.861
529363
874882

04 · ellipsoid

Useless in practice, indispensable in theory

why nobody solves LPs with it
  • The iteration count is close to its worst case on every instance. It never gets lucky the way simplex does.
  • It needs high numerical precision, and double precision breaks the volume argument.
  • Each iteration uses a dense $n \times n$ matrix, so sparsity doesn't help.
what it really needs

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

Interior-point methods

Stay away from the boundary until the very end.

04 · interior point

The log barrier and the central path

t = 0.01 t = 7.3 optimum

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)$$
  • $t \to 0$: the objective hardly matters, and the minimizer is the analytic centre.
  • $t \to \infty$: the objective dominates, and the minimizer tends to an optimal point.

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

The barrier on one variable

$\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}$$
0 1 t→0 t=1 t=10 t=100

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^*$
→00.5huge$2/t$0.5
10.618(1.618, 2.618)20.382
100.910(0.110, 1.110)0.20.090
1000.990(0.010, 1.010)0.020.0099
what to read off

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

Duality comes for free on the path

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.

consequence

$x^*(t)$ is within $m/t$ of optimal, with a certificate. To reach accuracy $\varepsilon$, run until $t \ge m/\varepsilon$.

on the polygon, one point of the path

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

Where floating point ends the pure barrier method

$t$$m/t$$b^\top y - c^\top x$Newton steps
1e41.40e-31.40e-36
1e51.40e-41.40e-46
1e61.40e-51.42e-56
1e71.40e-61.31e-3100

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.

why

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

Choosing between them

Cold solves favour interior point, and warm solves favour simplex.

04 · practice

Cold solves: IPM iterations barely grow

HiGHS, random sparse LPs with 4 nonzeros per column and $m = n/2$, presolve off:

$n$simplex siterationsIPM siterations
3000.0062830.00613
1 0000.0691 3590.02517
3 0000.955 2680.1418
20 00019966 9411225

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

Warm solves: why branch-and-bound wants simplex

Same LP family, $n = 3000$. Solve, add one constraint that cuts off the optimum, re-solve (a warm solve):

coldre-solve
HiGHS simplex0.832 s0.033 s (22 it)
HiGHS IPM0.131 s0.136 s (18 it)

Simplex re-solves 25× faster than it solves cold. IPM re-solves no faster than cold.

why IPMs can't warm-start well

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

Lab 04 — what you build

about 2½ hours · uv run co lab 04 · numpy, floats
  1. The barrier: value, gradient and Hessian, checked by finite differences.
  2. Newton centering with backtracking that also keeps you feasible.
  3. Path following, with the dual point $y = 1/(ts)$ and the gap $m/t$ checked on every point.
  4. The ellipsoid method: the update, and a search for a feasible point.
  5. The iteration bound from the volume argument, which your method must respect.
uv run co test 04
uv run co then 04        # central path plot · float breakdown · IPM vs simplex cold and warm · ellipsoid

04 · checkpoint

Done when

checkpoint
  • All five lab steps are ✓.
  • You can choose between simplex and barrier for a given LP and defend it: size, sparsity, and whether a warm start is available.
  • You can explain why branch-and-bound still wants simplex at every node.

Reading

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.

Next

05 formulations, where integer programming starts. 09 separation ⇔ optimization, where the ellipsoid method pays off, after 08.