Interior point methods

Where Simplex crawls the boundary, an interior point method (IPM) cuts straight through the middle: it keeps every iterate strictly inside the constraints and follows a smooth arc to the optimum. lpviz implements a Mehrotra-style primal-dual predictor–corrector method — the algorithm at the core of most modern LP solvers.

A smooth interior point trajectory starting outside a polygon, entering it, and curving through the interior to the optimal vertex.
An infeasible start: the first iterates may sit outside the region, then the path bends inward and converges to the optimal vertex.

The idea

For the LP maximize cᵀx s.t. Ax ≤ b, introduce a slack s = b − Ax ≥ 0 and a dual multiplier yi ≥ 0 for each constraint. A point is optimal exactly when the KKT conditions hold:

Ax + s = b,   Aᵀy = c,   si yi = 0 for all i,   s, y ≥ 0.

The hard part is complementarity (siyi = 0): it forces every constraint to be either exactly tight or carry zero price, which is combinatorial. IPMs relax it to siyi = µ for a positive parameter µ, solve that smooth system approximately with Newton's method, and drive µ → 0. The solutions of the relaxed system, traced over µ, form the central path — the smooth curve the iterates loosely follow. This is what makes IPMs polynomial-time in theory (the line of work started by Karmarkar in 1984) and remarkably consistent in practice: iteration counts barely grow with problem size.

What one iteration does

lpviz's IPM keeps a triple (x, s, y) with s, y > 0 and, at every iteration, measures the average complementarity µ = sᵀy/m, then:

  1. Predictor. Solve the Newton (KKT) system for the affine-scaling direction — the step aiming straight at µ = 0 — via a dense LU factorization of the full (n + 2m)-dimensional system.
  2. Step length. Compute the largest steps that keep s and y strictly positive (the fraction-to-boundary rule), separately for the primal and dual.
  3. Corrector (adaptive). If the predictor can move nearly unimpeded — both step ratios at least the corrector threshold — lpviz just takes the affine step. Otherwise it adds Mehrotra's corrector: a second solve with the same matrix that (a) recenters toward the central path with weight σ = (µaff/µ)³, where µaff is the complementarity the predictor would reach, and (b) compensates for the second-order error ΔsiΔyi the linearization ignores. When the predictor did well, σ is tiny (barely center); when it got blocked, σ approaches 1 (retreat toward the path).
  4. Move. Update (x, s, y) using the fraction-to-boundary steps scaled by the αmax slider.

Convergence is declared when the primal residual, the dual residual, and the relative duality gap are all below 10⁻⁵.

Infeasible start

The method starts at x = 0 (the canvas origin) with s = y = 1 — which typically does not satisfy Ax + s = b. That's deliberate: this is an infeasible-start IPM, and the Newton steps shrink the constraint violation and the duality gap simultaneously. Watch the Infeas column of the log: it decays to zero alongside µ. If your polygon doesn't contain the origin, the first few iterates visibly sit outside the region before the path dives in.

The controls

ControlDefaultWhat it does
Method Predictor–corrector Which interior method runs: Mehrotra's predictor–corrector (this section), HALO-LP, or the primal method that came before them, Karmarkar's method.
αmax (max step size ratio) 0.1 Scales every step. The default is intentionally tiny so you get a long, smooth trajectory to look at. Real solvers use ≈ 0.99; try it to see the algorithm converge in a dozen iterations, cutting corners the small-step arc never would. At exactly 1, iterates may land on the boundary itself.
Corrector threshold 0.9 The step quality above which the corrector is skipped. Raise it toward 0.999 and nearly every iteration is corrected — the path stays well-centered. Lower it and the method degenerates toward pure affine scaling — greedier steps that hug the boundary and can stall near corners.
Maximum iterations 1,000 Iteration cap (log scale, up to 100k). Small αmax values need more iterations to converge.
Homogeneous off Runs the same predictor–corrector on the homogeneous self-dual embedding (see below), so it also certifies empty regions and unbounded objectives.

αmax, and what a step size ratio buys

The same polygon crossed by two interior point trajectories from one starting point: a dense trail of small steps following a gentle arc, and a path of four long steps cutting straight across to the optimal vertex. αmax = 0.1 a long, readable trail αmax = 0.99 what a real solver does
Same directions, same algorithm — only the fraction of each step that is actually taken differs. The small-step path traces the geometry; the large-step path cuts corners the small one never reaches.

Every iteration computes how far it could move before s or y hits zero, then multiplies that distance by αmax. At the default 0.1 you are watching a deliberately slowed-down solver: the trajectory is dense enough to see its curvature, and it stays well inside the region because it never spends more than a tenth of its available room. At 0.99 — what production solvers use — each step lands within one percent of the boundary, the arc collapses into a few chords, and the run finishes in about a dozen iterations. Nothing about the search direction changed; only the appetite.

The corrector threshold

Two panels. On the left a narrowing corridor blocks a straight affine step, and a second curved step stays centred and travels further. On the right a wide corridor lets a single straight step run almost the whole way. step ratio below threshold affine step blocked; corrector recentres, goes further step ratio above threshold nothing in the way; corrector skipped
The threshold is a test on the predictor's step ratio, not on the objective: it asks whether the affine direction was blocked, and only pays for a second solve when it was.

The corrector costs a second solve with the same factorized matrix, so it is worth skipping when the predictor is already doing well. The threshold is where "well" is drawn: at the default 0.9, any predictor that can move at least 90% of the way to the boundary in both the primal and the dual is taken as-is. Below that, Mehrotra's corrector is added, and its centering weight σ = (µaff/µ)³ scales with how badly the predictor did — barely centering when it was almost free, retreating hard toward the central path when it was blocked at a corner. Raising the threshold toward 0.999 corrects nearly every iteration; lowering it approaches pure affine scaling, which takes the greedy direction and lets the corners deal with the consequences.

The homogeneous embedding

Check Homogeneous and the predictor–corrector solves a slightly larger system, the homogeneous self-dual embedding of Xu, Hung and Ye, instead of the KKT conditions themselves. It adds two scalars: τ scales the whole primal–dual point, and κ measures the duality gap. The KKT equations become

Ax + s = bτ,   Aᵀy = cτ,   bᵀy − cᵀx + κ = 0,   si yi = 0,   τκ = 0,

all with s, y, τ, κ ≥ 0. This system always has a solution, whatever the LP. If τ > 0, the canvas draws x/τ, the optimum. If τ = 0 < κ, there is no optimum, and the iterate is a Farkas certificate instead: proof that the region is empty or that the objective is unbounded. The footer reads Certified primal infeasible or Certified unbounded, and IPM runs on an empty region while the box is checked. On a solvable LP the path is close to the plain method's, and it often takes fewer iterations, because it never has to reach feasibility before making progress on the gap. The log's µ column is µ/τ², so it stays in the plain method's units. In 3D it is lifted on the same log scale as HALO-LP (see below), with the optimum on the floor. This is the form production solvers such as MOSEK use.

HALO-LP: a non-interior-point method

Choosing HALO-LP as the method swaps the predictor–corrector for HALO-LP (Rojas, Aguilar and Bugarin, 2026), a homogeneous all-shifted non-interior-point method. It drops the one rule this page opened with: its iterates need not stay inside anything. The slacks s, the multipliers y, and the homogeneous pair τ, κ may all go negative along the way.

Why it lives under IPM

"Non-interior" describes where the iterates are allowed to go, not how the method works. Everything else is the interior point recipe on this page:

What changes is how positivity is handled. The predictor–corrector keeps s, y > 0 with a fraction-to-boundary step. HALO-LP instead writes each complementarity pair through a smoothed NCP function, φ(a, b; µ) = a + b − √((a − b)² + 4µ). This function is zero exactly when a, b > 0 and ab = µ, and it is defined everywhere else too. A backtracking line search on the size of all the residuals, linear and NCP alike, replaces the step ratio.

Warm starts

Positivity is not required, so any start is a valid start. Drag the start marker outside the region: HALO-LP takes that point's slack b − Ax0 as it is, negative where the point violates a constraint. The predictor–corrector cannot do that. It has to reset the slacks to 1 and loses most of what the start knew. This is the method's main purpose: re-solving a slightly changed LP from the last solution, as in model predictive control.

Infeasible and unbounded problems

HALO-LP solves the homogeneous self-dual embedding of the LP, which adds the pair τ, κ. A solution with τ > 0 gives the optimum x/τ, and that point is what the canvas draws. A solution with τ = 0 and κ > 0 is a Farkas certificate: either the constraints are infeasible, or the objective is unbounded. The footer then reads Certified primal infeasible or Certified unbounded. For this reason IPM still runs on an empty region while HALO-LP is the method.

In 3D

The µ column is µ/τ², the complementarity of the drawn point x/τ, so it is in the same units as the predictor–corrector's sᵀy/m. HALO-LP shrinks it by orders of magnitude per step, so the 3D view lifts each iterate by its order of magnitude above the run's smallest µ: the optimum sits on the floor, a cold start (µ = 1) as high as a PDHG start, and every power of ten in between is an equal step. The staircase you see is the superlinear convergence.

Without the embedding: ODYN

HALO-LP borrows its non-interior machinery from ODYN (Rojas et al., 2026), a QP solver with the same shifted NCP functions and proximal terms but no homogeneous embedding. With HALO-LP chosen, the same Homogeneous box controls its embedding, and it starts checked, since the embedding is HALO-LP's method. Uncheck it to run ODYN on your LP: τ stays 1, κ disappears, and the Newton step is the same condensed solve without its Δτ part. On a solvable LP the two paths look nearly alike. They part ways on an empty region or an unbounded objective. HALO-LP certifies those from the iterate, once κ outgrows τ. ODYN has no τ to watch, so it reads the certificate off the Newton direction instead: as the iterates run away, the step points along a Farkas ray, and the footer reports it the same way.

Controls

αmax and the corrector threshold are hidden, since the line search replaces both. HALO-LP has one control of its own:

Before primal-dual: Karmarkar's method

The last entry in the Method menu is the primal interior method the predictor–corrector grew out of. It keeps only x strictly inside the region, with slacks s = b − Ax > 0, and measures every step in the Dikin metric ‖S−1Ad‖, whose unit ball, the Dikin ellipsoid, always fits inside the region. The canvas draws that ellipse at each iterate, so you can watch it flatten against the faces it approaches.

Karmarkar's 1984 projective algorithm, the paper that started the interior-point era, is implemented in the form Gonzaga and Todd and Burrell showed it takes on this inequality form: minimize Karmarkar's potential

q log(z − cᵀx) − Σi log si,   q = m + √m,

where z is an upper bound on the optimum, by a step in the Dikin metric and a line search on the potential. Each step yields dual estimates with Aᵀy = c; whenever they are all nonnegative, bᵀy is a certified bound and z drops to it. Karmarkar's projective transformation is what turns his original method into this one, so the iterates are his, without his simplex-shaped canonical form. Until the first bound is known the potential has nothing to push against, and the method steps toward the best point of the Dikin ellipsoid, d = H−1c with H = AᵀS−2A, a fraction αmax of the way to the boundary. Once it has a bound, the potential's barrier term keeps the iterates off the faces, and the step length comes from the line search, not αmax.

Start, stopping and the 3D view

Karmarkar's method needs a strictly interior start: the dragged start point if it is one, otherwise the Chebyshev center (the center of the largest ball that fits in the region). So it refuses an empty region. A direction no constraint limits along which the objective improves, or iterates that run off far beyond the region while the objective grows, ends the run as unbounded. It stops when the dual estimates are nonnegative and the gap sᵀy is below tolerance. The log's last column is that gap, and its Infeas column is how far the dual estimates are from feasible. In 3D the gap is lifted on HALO-LP's log scale, so the optimum sits on the floor.

The corrector threshold and the Homogeneous box are hidden for this method: there is no corrector and no embedding.

Reading the log

 Iter        x        y        Obj     Infeas          µ
    1     0.00     0.00    0.0e+0    2.4e+1    1.0e+0
    2     1.13     0.62    1.4e+1    1.1e+1    4.2e-1

Behavior to watch for