lpviz documentation

lpviz is a free, interactive web app for visualizing how linear programming solvers work. You draw a feasible region, aim an objective, and watch four different algorithms find the optimum — one iteration at a time, entirely in your browser.

A convex polygon with four solver trajectories: Simplex hops along vertices, the interior point method curves through the interior, PDHG spirals inward, and the central path bends smoothly toward the optimum.
Four ways to the same optimum. Simplex IPM PDHG Central path

The problem lpviz solves

Everything in lpviz is a linear program (LP): maximize a linear objective over a region cut out by linear inequalities,

maximize  cx   subject to  Axb,

where x ∈ ℝⁿ is the decision variable (n = 2 in the main app, n = 3 in 3-variable mode), each row aixbi of Axb is a half-plane, and c is the objective vector you aim with the arrow.

When you draw a polygon, each edge becomes one inequality constraint; the panel at the top of the sidebar shows the resulting system (the H-representation of your region). Because the feasible region is the intersection of half-planes it is always convex, and if an optimum exists, some vertex of the region attains it — the geometric fact underlying the Simplex method.

The four solvers

lpviz implements four algorithms that reach the same answer in very different ways. Each has its own page explaining the math, the exact implementation, and what to watch for on screen.

SolverFamilyIterates look likeKey controls
SimplexActive-set / pivotingHops between vertices along edgesDual simplex mode
IPMPrimal-dual interior pointA smooth arc through the interiorαmax, corrector threshold, max iterations
PDHGFirst-order primal-dualA spiral tightening around the optimumη, τ, Halpern, inequality mode, color by basis
Central pathLog-barrier / NewtonA smooth curve from the analytic centerN (number of steps)

Quick start

  1. Draw the region. Click empty space to add vertices. Close the polygon by clicking the first vertex or pressing Enter. Every edge becomes a constraint you can drag; right-click a vertex to delete it, double-click an edge to insert one.
  2. Aim the objective. Click inside the region to place the objective vector c, then drag the arrow to point it where the objective should increase.
  3. Pick a solver. Choose IPM, PDHG, Simplex, or Central Path in the sidebar. The iterates appear immediately; tune the solver's sliders and the path re-solves live.
  4. Inspect. The bottom terminal lists every iterate (hover a row to highlight the point); the top panel lists constraints (hover to highlight the line). Click Animate to replay the iterations, or enable Trace to keep old paths on screen while you experiment.

A gallery of preset regions (Pentagon, Corridor, Needle, Tight Corner, Many Facets, and more) is available at the top of the screen — each is chosen to stress the solvers in a different way.

3D view and 3-variable mode

lpviz has two distinct "3D" features:

Sharing and reproducibility

The share button encodes your entire setup — region, objective, solver, and settings — into the URL, so a link reproduces the exact visualization. This makes lpviz handy for teaching: build a scenario, share the link, and everyone sees the same iterations. All computation runs client-side; nothing you draw ever leaves your browser.

FAQ

What is linear programming?
Optimizing a linear objective subject to linear inequality constraints. It is the workhorse of mathematical optimization, used in logistics, scheduling, finance, energy markets, and as a subroutine inside integer programming and machine learning methods.
Why do some iterates leave the feasible region?
That's real solver behavior, not a bug. lpviz's IPM is an infeasible-start method (it starts at the origin and gains feasibility as it converges), PDHG iterates only satisfy the constraints in the limit, and dual simplex hops between constraint intersections outside the region until optimality.
Which solver is "best"?
It depends on the problem. Simplex pivots are cheap and finite; interior point methods take few, expensive iterations regardless of geometry; PDHG uses only matrix–vector products, which is why it scales to enormous LPs on GPUs. Watching them on the same region is the point of lpviz.
Does lpviz need a server?
No. lpviz is a static site; all four solvers are implemented in TypeScript and run in a Web Worker in your browser. It is open source on GitHub.
How do I cite lpviz?
@article{lpviz,
  title={{lpviz: Interactive Linear Programming Visualization}},
  author={Grand, Evan and Klamkin, Michael},
  journal={arXiv preprint arXiv:2604.27518},
  year={2026}
}