TExcelTAD
Home › Linear Programming & Duality for Algorithms › Interior-Point Methods: an Algorithmic Overview

Interior-Point Methods: an Algorithmic Overview

The ellipsoid method proved that linear programming is in P but is hopeless in practice. Five years later Karmarkar (1984) published a polynomial-time method that was also fast, and it started the field of interior-point methods (IPMs): instead of walking along the boundary like simplex, they move through the interior of the polytope along a smooth curve, the central path, that leads to an optimal face. Today they are one of the two main engines of commercial LP solvers, and since 2019 they have been the backbone of the fastest known algorithms for LP and for maximum flow. This lesson gives the algorithm designer's summary: the barrier, the central path, the iteration bound, and the final rounding step that turns an approximate interior point into an exact vertex. The derivations and convergence proofs in full are in Interior-Point Methods.

Barrier and central path

Take the LP in equational form, min⁡{cTx:Ax=b, x≥0}\min \{ c^T x : Ax = b,\ x \ge 0 \}, and its dual max⁡{bTy:ATy+s=c, s≥0}\max \{ b^T y : A^T y + s = c,\ s \ge 0 \}. Replace the hard constraint x≥0x \ge 0 by a logarithmic barrier that grows to infinity at the boundary:

min⁡  cTx−μ∑j=1nln⁡xjs.t.Ax=b,μ>0.\min \; c^T x - \mu \sum_{j=1}^{n} \ln x_j \quad \text{s.t.} \quad Ax = b, \qquad \mu > 0 .

For each μ>0\mu > 0 (if the LP has a strictly feasible point and bounded optimal set) this strictly convex problem has a unique minimizer x(μ)x(\mu). Its optimality conditions, together with the dual, are

Ax=b,ATy+s=c,xjsj=μ  (j=1,…,n),x,s>0.Ax = b, \qquad A^T y + s = c, \qquad x_j s_j = \mu \ \ (j = 1, \ldots, n), \qquad x, s > 0 .

The curve μ↦(x(μ),y(μ),s(μ))\mu \mapsto (x(\mu), y(\mu), s(\mu)) is the central path. Compare with complementary slackness, xjsj=0x_j s_j = 0: the central path is a smoothed version of the optimality conditions, and every point on it has duality gap exactly cTx−bTy=xTs=nμc^T x - b^T y = x^T s = n \mu. As μ→0\mu \to 0, the path converges to an optimal solution (the analytic center of the optimal face).

Path following

A primal-dual path-following method keeps an iterate near the central path and shrinks μ\mu geometrically. Each iteration takes one Newton step for the system above with target σμ\sigma \mu for some σ<1\sigma < 1:

(A000ATIS0X)(ΔxΔyΔs)=(b−Axc−ATy−sσμ1−XS1),\begin{pmatrix} A & 0 & 0 \\ 0 & A^T & I \\ S & 0 & X \end{pmatrix} \begin{pmatrix} \Delta x \\ \Delta y \\ \Delta s \end{pmatrix} = \begin{pmatrix} b - Ax \\ c - A^T y - s \\ \sigma \mu \mathbf{1} - X S \mathbf{1} \end{pmatrix},

where XX and SS are the diagonal matrices of xx and ss. The step length is chosen so that xx and ss stay positive. The program runs this on the workshop LP (as a minimization in equational form with three slacks), from the infeasible starting point x=s=1x = s = \mathbf{1}, y=0y = 0, with σ=0.1\sigma = 0.1 and steps that go 90% of the way to the boundary.

python · try it yourself
import numpy as np

A = np.array([[2, 1, 1, 0, 0], [1, 3, 0, 1, 0], [1, 0, 0, 0, 1]], dtype=float)
b = np.array([10, 15, 4], dtype=float)
c = -np.array([3, 2, 0, 0, 0], dtype=float)           # maximize 3x + 2y  ==  minimize -3x - 2y
m, n = A.shape
x, s, y = np.ones(n), np.ones(n), np.zeros(m)
sigma = 0.1
print(" k        mu   primal value   dual value   infeasibility   (x, y)")
for k in range(40):
    mu = float(x @ s) / n
    rp, rd = b - A @ x, c - A.T @ y - s
    infeas = float(max(np.abs(rp).max(), np.abs(rd).max()))
    shown = f"{infeas:9.1e}" if infeas > 1e-9 else "   < 1e-9"
    print(f"{k:2}  {mu:9.3e}  {float(-c @ x):12.6f}  {float(-b @ y):11.6f}      {shown}     ({x[0]:.4f}, {x[1]:.4f})")
    if mu < 1e-8 and infeas < 1e-9:
        break
    K = np.block([[A, np.zeros((m, m)), np.zeros((m, n))],
                  [np.zeros((n, n)), A.T, np.eye(n)],
                  [np.diag(s), np.zeros((n, m)), np.diag(x)]])
    d = np.linalg.solve(K, np.concatenate([rp, rd, sigma * mu - x * s]))
    dx, dy, ds = d[:n], d[n:n + m], d[n + m:]
    alpha = 1.0
    for v, dv in ((x, dx), (s, ds)):
        if (dv < 0).any():
            alpha = min(alpha, 0.9 * float(np.min(-v[dv < 0] / dv[dv < 0])))
    x, y, s = x + alpha * dx, y + alpha * dy, s + alpha * ds
 k        mu   primal value   dual value   infeasibility   (x, y)
 0  1.000e+00      5.000000     0.000000        1.0e+01     (1.0000, 1.0000)
 1  5.550e-01      7.927540     0.455079        7.4e+00     (1.5343, 1.6623)
 2  2.784e-01     12.131403     7.713072        4.0e+00     (2.3216, 2.5833)
 3  9.322e-02     15.606718    14.367863        1.2e+00     (2.9285, 3.4105)
 4  2.405e-02     16.725457    16.565214        1.9e-01     (3.0282, 3.8204)
 5  3.617e-03     16.981171    16.988024        7.7e-03     (3.0057, 3.9820)
 6  5.420e-04     16.998259    17.000353        4.2e-04     (3.0005, 3.9983)
 7  7.136e-05     16.999834    17.000169        1.5e-05     (3.0000, 3.9998)
 8  7.988e-06     16.999984    17.000023        2.0e-07     (3.0000, 4.0000)
 9  8.121e-07     16.999998    17.000002         < 1e-9     (3.0000, 4.0000)
10  8.124e-08     17.000000    17.000000         < 1e-9     (3.0000, 4.0000)
11  8.124e-09     17.000000    17.000000         < 1e-9     (3.0000, 4.0000)

The iterates approach (3,4)(3, 4) from the inside, the primal and dual values close in on 17 from both sides once the infeasibility has been driven out, and from then on μ\mu drops by a factor of about 10 per iteration (σ=0.1\sigma = 0.1 with full steps). Eleven Newton steps for an accuracy of 10−810^{-8} is typical: IPMs need a few dozen iterations on almost any LP, large or small.

The iteration bound

Theorem (path following; Renegar, 1988; for primal-dual methods Monteiro and Adler, 1989, and Kojima, Mizuno and Yoshise, 1989). A short-step path-following method that starts near the central path with gap μ0\mu_0 and uses σ=1−δn\sigma = 1 - \frac{\delta}{\sqrt{n}} for a suitable constant δ\delta stays near the path and reaches gap ε\varepsilon after

O ⁣(n log⁡nμ0ε)O\!\left( \sqrt{n} \, \log \frac{n \mu_0}{\varepsilon} \right)

iterations. For an LP with integer data of bit length LL, stopping at ε=2−O(L)\varepsilon = 2^{-O(L)} suffices (next section), so O(n L)O(\sqrt{n}\, L) iterations, each dominated by solving one linear system of size mm (O(n3)O(n^3) arithmetic operations with dense linear algebra). Karmarkar's original projective method needed O(nL)O(nL) iterations and O(n3.5L)O(n^{3.5} L) operations in total; reusing factorizations across iterations brings the total to O(n3L)O(n^3 L) (Vaidya, 1987; Gonzaga, 1989).

Method Iterations Notes
Ellipsoid (Khachiyan, 1979) O(n2L)O(n^2 L) needs only a separation oracle
Karmarkar (1984) O(nL)O(nL) projective transformations and a potential function
Short-step path following O(n L)O(\sqrt{n}\, L) best known worst-case iteration bound in this framework
Long-step / predictor-corrector (Mehrotra, 1992) O(nL)O(nL) for long-step methods; none proved for Mehrotra's heuristic itself what solvers run; a few dozen iterations in practice

In theory, the long-step methods that work best have the worse worst-case bound; the short-step method with the best bound is slow in practice. This gap between theory and practice is the mirror image of the simplex method's.

From an approximate point to an exact vertex

An IPM produces an interior point, not a vertex, and its accuracy is limited by floating point. For LPs with rational data this is no obstacle: two different vertices of a polytope with bit length LL have objective values differing by at least 2−2L2^{-2L} (their coordinates are ratios of determinants bounded by 2L2^L, by Cramer's rule). So once the duality gap is below that, the optimal face is identified, and a purification or crossover step recovers an exact optimal vertex: guess the basis from the largest coordinates and solve ABxB=bA_B x_B = b exactly.

python · try it yourself
from fractions import Fraction as F

# the last iterate of the interior-point run above, rounded to 6 digits
x_ipm = [2.999999, 3.999999, 1e-06, 1e-06, 1.000001]
names = ["x", "y", "s1", "s2", "s3"]
A = [[2, 1, 1, 0, 0], [1, 3, 0, 1, 0], [1, 0, 0, 0, 1]]
b = [10, 15, 4]
basis = sorted(sorted(range(5), key=lambda j: -x_ipm[j])[:3])          # the 3 largest coordinates
print("guessed basis:", [names[j] for j in basis])

M = [[F(A[i][j]) for j in basis] + [F(b[i])] for i in range(3)]          # solve A_B x_B = b exactly
for col in range(3):
    piv = next(r for r in range(col, 3) if M[r][col] != 0)
    M[col], M[piv] = M[piv], M[col]
    for r in range(3):
        if r != col:
            f = M[r][col] / M[col][col]
            M[r] = [a - f * p for a, p in zip(M[r], M[col])]
xB = {names[j]: M[i][3] / M[i][i] for i, j in enumerate(basis)}
print("exact vertex:", {k: str(v) for k, v in xB.items()}, " value", 3 * xB["x"] + 2 * xB["y"])
guessed basis: ['x', 'y', 's3']
exact vertex: {'x': '3', 'y': '4', 's3': '1'}  value 17

The exact vertex (3,4)(3, 4) with slack s3=1s_3 = 1 and value 17 can then be certified with a dual solution, as in Complementary Slackness. Production solvers do the same in their crossover phase, which hands the IPM's answer to the simplex method for a final clean-up.

IPMs in algorithm design

Interior-point methods are now a tool for combinatorial problems, not only a solver:

  • General LP: Cohen, Lee and Song (2019) solve LPs in about the time of matrix multiplication, O~(nωlog⁡(1/ε))\tilde O(n^{\omega} \log(1/\varepsilon)), by maintaining the Newton systems with randomized data structures.
  • Flows: an IPM on the min-cost flow LP has Newton systems that are Laplacian linear systems, solvable in nearly linear time (Spielman and Teng, 2004). This led to O~(mn)\tilde O(m \sqrt{n}) algorithms (Lee and Sidford, 2014) and finally to an almost-linear-time m1+o(1)m^{1 + o(1)} algorithm for maximum flow and min-cost flow (Chen, Kyng, Liu, Peng, Probst Gutenberg and Sachdeva, 2022), combining an IPM with dynamic graph data structures.

The multiplicative weights section describes the other route to fast approximate flows, through electrical flows.

Test yourself

What is the duality gap at the point of the central path with parameter μ\mu, for an LP with nn variables?

  1. 00
  2. μ\mu
  3. nμn \mu
  4. μ2\mu^2

How many iterations does a short-step path-following method need for an LP of bit length LL?

  1. O(2n)O(2^n)
  2. O(n L)O(\sqrt{n}\, L)
  3. O(n2L)O(n^2 L)
  4. O(1)O(1)

Why can an IPM's approximate solution be turned into an exact optimal vertex?

  1. Because IPMs work in exact arithmetic
  2. Because distinct vertex values differ by at least 2−2L2^{-2L}, so a small enough gap identifies the optimal face, and the basis can then be solved exactly
  3. Because every interior point is a vertex
  4. It cannot