TExcelTAD
Home › Optimization › Interior-Point Methods

Interior-Point Methods

The simplex method crawls along the boundary of the feasible set. Interior-point methods cut through the middle: they follow a smooth curve, the central path, from the interior of the feasible region to the optimum, taking Newton steps. They have polynomial worst-case complexity, need only a few dozen iterations regardless of problem size, and extend directly to quadratic, conic and general convex problems.

The barrier idea

Replace the inequality constraints fi(x)≤0f_i(\mathbf{x}) \le 0 with a logarithmic barrier that blows up at the boundary:

min⁡ t f0(x)+ϕ(x),ϕ(x)=−∑i=1mlog⁡(−fi(x))\min\ t\,f_0(\mathbf{x}) + \phi(\mathbf{x}), \qquad \phi(\mathbf{x}) = -\sum_{i=1}^m\log(-f_i(\mathbf{x}))

For each t>0t > 0 the minimizer x∗(t)\mathbf{x}^*(t) is strictly feasible; as t→∞t \to \infty it approaches the true optimum. The curve x∗(t)\mathbf{x}^*(t) is the central path. Each point of it gives a dual-feasible point with duality gap exactly m/tm/t, so the barrier method knows how accurate it is:

f0(x∗(t))−p∗≤mtf_0(\mathbf{x}^*(t)) - p^* \le \frac{m}{t}

A barrier method for an LP

Solve min⁡cTx\min \mathbf{c}^T\mathbf{x} s.t. Ax≤bA\mathbf{x} \le \mathbf{b}: for t=1,10,100,…t = 1, 10, 100, \dots minimize tcTx−∑ilog⁡(bi−aiTx)t\mathbf{c}^T\mathbf{x} - \sum_i\log(b_i - \mathbf{a}_i^T\mathbf{x}) with damped Newton, starting from the previous solution.

python · try it yourself
import numpy as np

# max 3a + 5b s.t. a + 2b <= 8, 2a + b <= 10, a >= 0, b >= 0  (as min with A x <= b)
c = np.array([-3.0, -5.0])
A = np.array([[1.0, 2.0], [2.0, 1.0], [-1.0, 0.0], [0.0, -1.0]]); b = np.array([8.0, 10.0, 0.0, 0.0])
m = len(b)
x = np.array([1.0, 1.0])                                     # strictly feasible start
t = 1.0
while m / t > 1e-8:
    for _ in range(50):                                      # centering: Newton on t c^T x + barrier
        s = b - A @ x                                         # slacks, all > 0
        g = t * c + A.T @ (1 / s)
        H = A.T @ np.diag(1 / s**2) @ A
        dx = -np.linalg.solve(H, g)
        lam2 = -g @ dx                                        # Newton decrement squared
        if lam2 / 2 < 1e-10:
            break
        step = 1.0
        while np.any(b - A @ (x + step * dx) <= 0) or \
              t * c @ (x + step * dx) - np.sum(np.log(b - A @ (x + step * dx))) > t * c @ x - np.sum(np.log(s)) - 0.25 * step * lam2:
            step *= 0.5
        x = x + step * dx
    print(f"t = {t:9.0f}: x = {np.round(x, 6)}, objective = {-c @ x:.6f}, gap bound m/t = {m / t:.0e}")
    t *= 10
t =         1: x = [2.652486 2.47193 ], objective = 20.317106, gap bound m/t = 4e+00
t =        10: x = [3.814969 2.0713  ], objective = 21.801408, gap bound m/t = 4e-01
t =       100: x = [3.981428 2.007145], objective = 21.980011, gap bound m/t = 4e-02
t =      1000: x = [3.998143 2.000714], objective = 21.998000, gap bound m/t = 4e-03
t =     10000: x = [3.999814 2.000071], objective = 21.999800, gap bound m/t = 4e-04
t =    100000: x = [3.999981 2.000007], objective = 21.999980, gap bound m/t = 4e-05
t =   1000000: x = [3.999998 2.000001], objective = 21.999998, gap bound m/t = 4e-06
t =  10000000: x = [4. 2.], objective = 22.000000, gap bound m/t = 4e-07
t = 100000000: x = [4. 2.], objective = 22.000000, gap bound m/t = 4e-08

Each outer step multiplies tt by 10 and gains one digit; the centering steps are cheap because Newton starts close to the next point on the path.

Primal-dual interior-point methods

Production solvers use primal-dual methods instead. They apply Newton's method to the KKT conditions with complementary slackness relaxed to λisi=μ\lambda_is_i = \mu:

ATλ=c (stationarity),Ax+s=b,λisi=μ,s,λ>0A^T\boldsymbol{\lambda} = \mathbf{c} \ (\text{stationarity}), \qquad A\mathbf{x} + \mathbf{s} = \mathbf{b}, \qquad \lambda_is_i = \mu, \qquad \mathbf{s}, \boldsymbol{\lambda} > 0

and drive μ→0\mu \to 0 adaptively (Mehrotra's predictor-corrector). They typically need 20 to 60 iterations for LPs of any size; each iteration solves one sparse symmetric linear system, which dominates the cost.

python · try it yourself
import numpy as np
from scipy.optimize import linprog

rng = np.random.default_rng(0)
for n in (50, 200, 800):
    m = 2 * n
    A = rng.uniform(0, 1, size=(m, n)); b = A @ np.ones(n) + rng.uniform(1, 2, size=m)
    c = -rng.uniform(0, 1, size=n)
    ipm = linprog(c, A_ub=A, b_ub=b, bounds=[(0, None)] * n, method="highs-ipm")
    ds = linprog(c, A_ub=A, b_ub=b, bounds=[(0, None)] * n, method="highs-ds")
    print(f"n = {n:4d}: interior point {ipm.nit:3d} iterations, dual simplex {ds.nit:5d} iterations, same optimum: {np.isclose(ipm.fun, ds.fun)}")
n =   50: interior point  11 iterations, dual simplex    39 iterations, same optimum: True
n =  200: interior point  16 iterations, dual simplex   131 iterations, same optimum: True
n =  800: interior point  24 iterations, dual simplex   627 iterations, same optimum: True

The interior-point iteration count barely grows with size; simplex pivots grow roughly with the number of constraints, but each pivot is much cheaper. Which is faster depends on the problem; modern solvers run both concurrently.

Simplex versus interior point

Simplex Interior point
path along edges, vertex to vertex through the interior, along the central path
worst case exponential polynomial
typical iterations grows with problem size 20–60, nearly constant
solution an exact vertex (basis) near-optimal interior point, then crossover
warm start after changes excellent poor
extends to LP (and QP) QP, SOCP, SDP, general convex

In software

  • linprog(method="highs-ipm"), MOSEK, Gurobi's barrier, CPLEX's barrier; for nonlinear problems IPOPT, and for conic problems Clarabel, ECOS and SCS (a first-order alternative).
  • Karmarkar's 1984 algorithm started the field; Nesterov and Nemirovski's theory of self-concordant barriers extended it to all convex cones.

Exercises

Exercise 1: The gap bound

A barrier method with 40 inequality constraints is at t=106t = 10^6 on the central path. How far from optimal is it at most?

Answer

4×10−54 \times 10^{-5}.

Solution

m/t=40/106m/t = 40/10^6.

Exercise 2: One-dimensional central path

For min⁡x\min x s.t. x≥0x \ge 0 (barrier −log⁡x-\log x), find x∗(t)x^*(t).

Answer

x∗(t)=1/tx^*(t) = 1/t.

Solution

Minimize tx−log⁡xtx - \log x: the derivative t−1/x=0t - 1/x = 0 gives x=1/tx = 1/t, which tends to the optimum 0, with gap exactly 1/t=m/t1/t = m/t for m=1m = 1.

Exercise 3: Central path points (code)

For the LP in the barrier example, compute the barrier minimizer at t=0.01t = 0.01 (almost no objective). Where is it?

Answer

Near the analytic centre of the polygon, the point that maximizes the product of the slacks.

Solution
python · try it yourself
import numpy as np
c = np.array([-3.0, -5.0]); A = np.array([[1.0, 2.0], [2.0, 1.0], [-1.0, 0.0], [0.0, -1.0]]); b = np.array([8.0, 10.0, 0.0, 0.0])
x, t = np.array([1.0, 1.0]), 0.01
for _ in range(100):
    s = b - A @ x; g = t * c + A.T @ (1 / s); H = A.T @ np.diag(1 / s**2) @ A
    dx = -np.linalg.solve(H, g); step = 1.0
    while np.any(b - A @ (x + step * dx) <= 0):
        step *= 0.5
    x = x + 0.5 * step * dx
print(np.round(x, 4))
[1.6011 1.4275]

As tt grows the central path leaves this centre and bends toward the optimal vertex (4,2)(4, 2).

Test yourself

On the central path of a barrier method with mm inequalities, the duality gap is…

  1. 0
  2. m/tm/t
  3. t/mt/m
  4. unknown

Interior-point methods take…

  1. Newton steps on a barrier or on relaxed KKT conditions
  2. pivots between bases
  3. random steps
  4. only gradient steps

An advantage of simplex over interior point is…

  1. polynomial worst case
  2. fast warm starts after small changes
  3. fewer iterations on huge problems
  4. it handles SDPs