|q⟩ Bad Qubits

intermediate · Programming · QAOA & Combinatorial Optimization

Approximation Ratios

Every approximation algorithm for a combinatorial optimization problem is judged by a single dimensionless number: the approximation ratio. This ratio measures how close the algorithm's solution comes to the best possible answer.

Definition

Let OPT\text{OPT} be the optimal value of the cost function CC over all 2n2^n bit strings, and let Calg\langle C \rangle_{\text{alg}} be the expected cost value produced by the algorithm (averaged over its randomness or quantum measurements). The approximation ratio is

r=CalgOPT.r = \frac{\langle C \rangle_{\text{alg}}}{\text{OPT}}.

For a maximization problem (like Max-Cut) we have 0r10 \le r \le 1, with r=1r = 1 meaning the algorithm always finds the optimum. A higher rr is better.

Why approximation ratios matter

Exact solvers for NP-hard problems require exponential time in the worst case. Approximation algorithms trade optimality for speed: they run in polynomial time but accept a solution that might be slightly worse than optimal. The approximation ratio quantifies the price of that trade.

Two landmark results frame the landscape:

QAOA's approximation ratio for Max-Cut

Farhi, Goldstone, and Gutmann (2014) showed analytically that a p=1p = 1 QAOA circuit with optimally chosen angles (γ,β)(\gamma^*, \beta^*) achieves an expected cut fraction satisfying

Cp=1/m12+1250.724\langle C \rangle_{p=1} / m \ge \frac{1}{2} + \frac{1}{2\sqrt{5}} \approx 0.724

on ring graphs (simple cycles) in the large-graph limit. This exceeds the random baseline of 0.50.5 and narrows the gap toward the Goemans-Williamson bound of 0.8780.878. On 3-regular graphs the same analysis gives a lower bound of approximately 0.69240.6924, still comfortably above the random-cut baseline.

As pp \to \infty, QAOA converges to the exact optimum: the approximation ratio approaches 11. The open question is how deep pp must be to surpass classical heuristics on practically interesting instances.

Computing the ratio in practice

Suppose you run a one-layer QAOA circuit on a small Max-Cut instance, measure many times, and find that the average number of cut edges is C\langle C \rangle. If you also know (by brute force on a small graph) that the true maximum cut has value OPT\text{OPT}, then

r=COPT.r = \frac{\langle C \rangle}{\text{OPT}}.

For example, on a 4-node ring graph with OPT=4\text{OPT} = 4 cut edges, if p=1p = 1 QAOA achieves C=3\langle C \rangle = 3 on average, the approximation ratio is r=3/4=0.75r = 3/4 = 0.75.

Try it

A Max-Cut instance has an optimal cut value of 55. QAOA with p=1p = 1 finds an expected cut value of 3.753.75. Return the approximation ratio as a decimal number.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.