How hard is a random LP?

Created by Zikai Xiong · Based on Xiong [1, 2]

Restarted PDHG (rPDHG): a first-order method for linear programs.
Pick a size and watch it solve random LPs, one dot per LP.

The defaults take a few seconds.

More options
The random LPs

Standard form $\min\, c^\top x$ s.t. $Ax=b,\ x\ge 0$, from the model in the experiments of [1, 2]: $A\in\mathbb{R}^{m\times n}$ has i.i.d. $N(0,1)$ entries (or $\pm1$ entries); $\hat x=(|u_1|,\dots,|u_m|,0,\dots,0)$ and $\hat s=(0,\dots,0,|u_{m+1}|,\dots,|u_n|)$ with $u\sim N(0,I)$; $b=A\hat x$ and $c=\hat s+A^\top\hat y$, with $\hat y$ chosen so that $Ac=0$. Then $x^\star=\hat x$ and $s^\star=\hat s$ are known, so $\Phi$ follows from its closed form.

Each dot is one random LP

rPDHG, the stopping rule and what [1] proves

Each LP is solved by rPDHG (Algorithm 1 of [1, 2], as on the one-LP page) from $0$ until $\|(x,s)-(x^\star,s^\star)\|_2\le 10^{-4}$, as in the experiments of [2]. A run stops after $\min\{10^6,\max\{10^5,\ 4\cdot10^9/(mn)\}\}$ iterations; such LPs are hollow dots.

With probability at least $1-\delta$, rPDHG finds the optimal basis within $\widetilde O(n^{2.5}m^{0.5}/\delta)$ iterations ($\widetilde O(n^{2.5}/\delta)$ for Gaussian $A$), and then an $\varepsilon$-optimal solution within $O\big(\frac{\sqrt{nm}}{\delta}\ln\frac1\varepsilon\big)$ more [1]. This holds for sub-Gaussian $A$ with $n/(n-m+1)$ bounded and $\delta$ not exponentially small.

References

  1. [1] Z. Xiong. High-probability polynomial-time complexity of restarted primal-dual hybrid gradient method for linear programming. Mathematics of Operations Research, 2026. doi:10.1287/moor.2024.0853
  2. [2] Z. Xiong. Accessible complexity bounds for restarted PDHG on linear programs with a unique optimizer. Mathematics of Operations Research, 2026. doi:10.1287/moor.2024.0738
© 2026 Zikai Xiong · All interactive demos