Part V · where the trunks converge · spine

24

LP rounding and the primal–dual method

One lower bound for everything: the LP relaxation. Round its solution, or grow its dual and buy what the dual pays for. Either way, its integrality gap is the limit.

needs 23, 03~1½ h slides + 2½–3 h lablab: uv run co lab 24

24 · overview

The route

1 · rounding

Vertex cover at ½; half-integrality; randomized rounding for set cover and its union bound.

2 · primal–dual

Raise duals, buy tight sets: set cover; Jain–Vazirani facility location; Steiner forest.

3 · integrality gaps

Kn and GF(2)k: instances that bound every LP-based proof.

4 · measured

LP, optimum, algorithm on the same instances, and where greedy wins.

getting around

Words with a dotted underline are glossary terms: click one for its definition. G lists every term in the unit, N shows the notes. Optional extra: interactive figures, linked from the slides they support by a small ▸ chip; skip them freely.

section 1

Rounding

Solve the relaxation, then make it integral.

24 · rounding

Vertex cover at ½

$$\begin{aligned}\min\ & \textstyle\sum_v w_v x_v \\ \text{s.t. } & x_u + x_v \ge 1 \quad \forall uv \in E \\ & 0 \le x \le 1\end{aligned}$$
why it works (Hochbaum 1982)

Threshold rounding: take $v$ iff $x_v \ge \tfrac12$. Feasible: $x_u + x_v \ge 1$ forces one of them to $\ge \tfrac12$. Cost: every chosen $v$ has $w_v \le 2 w_v x_v$, so the cost is $\le 2\,\mathrm{LP} \le 2\,\mathrm{OPT}$.

half-integrality (Nemhauser & Trotter 1975)

Every vertex of this polytope has all $x_v \in \{0, \tfrac12, 1\}$.

½½½ ½½

C5: LP 2.5, OPT 3, rounding takes all 5.

Lab then, 24 weighted random graphs (weights 1–20):

LP / OPTrounding / OPTprimal–dual / OPThalf-integral
0.891.74–1.751.38–1.4024 / 24

24 · rounding · example

Rounding a weighted 5-cycle

322 34 v0v1v2 v3v4

Vertex weights inside the circles. The LP puts ½ on every vertex.

methodtakesweight/ OPT
LP relaxationall at ½70.875
optimum (brute force)$v_0, v_1, v_3$81
threshold at ½all five141.75
primal–dual (section 2)$v_0, v_1, v_2, v_3$101.25
reading it

Every $x_v = \tfrac12$ meets the threshold, so rounding pays the full weight 14, exactly $2 \times \mathrm{LP}$: the guarantee is met with equality. The integrality gap of this instance is $8 / 7$, so no rounding of this LP can prove better than 1.14 here.

24 · rounding

Randomized rounding for set cover

Randomized rounding: repeat $t$ times, picking each set $j$ independently with probability $x_j$. Take the union.

why it works

Miss. The LP makes each element's sets add up to at least 1, so one round misses it with probability

$$\textstyle\prod_{j \ni e}(1 - x_j) \le e^{-\sum_{j \ni e} x_j} \le e^{-1}$$

and $t$ rounds with probability $\le e^{-t}$. The union bound over $n$ elements: $\Pr[\text{not a cover}] \le n e^{-t}$.

Cost. $\mathbb{E}[\text{cost}] \le t \cdot \mathrm{LP}$, by linearity of expectation. Take $t \approx \ln n$.

combining both: notes (N)

Lab then: failure rate of the whole cover, 4 000 draws over 10 instances (150 elements):

tmeasuredbound $150e^{-t}$
10.896≥ 1
20.728≥ 1
40.123≥ 1
70.00330.137

The union bound is loose by 40× at $t = 7$. Tests check the per-element probabilities exactly, against simulation.

Raghavan & Thompson (1987) introduced randomized rounding for routing, where Chernoff bounds are needed because loads add up. For set cover the union bound alone gives $O(\log n)$.

24 · rounding · example

Randomized rounding, on three elements

Elements $\{0, 1, 2\}$, unit-cost sets $\{0,1\}$, $\{1,2\}$, $\{0,2\}$. Any two sets cover; one doesn't. OPT $= 2$.

The LP puts $x = \tfrac12$ on each set: every element is in two sets, $\tfrac12 + \tfrac12 = 1$. LP $= 1.5$.

element 0, one round

It is missed only if neither $\{0,1\}$ nor $\{0,2\}$ is picked: $(1 - \tfrac12)(1 - \tfrac12) = \tfrac14$. The general bound says $\le e^{-1} = 0.37$.

$t$miss, one elementunion bound $3e^{-t}$expected cost
10.251.101.50
20.06250.412.25
30.01560.152.63
50.000980.0202.91

Misses fall like $4^{-t}$, faster than the bound's $e^{-t}$. The cost rises towards 3, all sets, as $t$ grows: more rounds buy coverage with money.

section 2

Primal–dual

Raise duals, buy primals, pay for what you bought.

24 · primal–dual

The schema, on set cover

$$\begin{aligned}\textbf{primal}\quad \min\ & \textstyle\sum_j c_j x_j \ \ \text{s.t.}\ \textstyle\sum_{j \ni e} x_j \ge 1 \\ \textbf{dual}\quad \max\ & \textstyle\sum_e y_e \ \ \text{s.t.}\ \textstyle\sum_{e \in S_j} y_e \le c_j\end{aligned}$$
  1. Start with $y = 0$, nothing bought.
  2. For each uncovered $e$: raise $y_e$ until some set containing $e$ is tight.
  3. Buy every tight set containing $e$.

Primal–dual set cover, Bar-Yehuda & Even (1981).

why the factor is f, the largest frequency

Each bought set is paid for by its elements' $y$, and an element sits in at most $f$ sets, so it pays at most $f$ times:

$$\begin{aligned}\text{cost} &= \textstyle\sum_{j \text{ bought}} c_j = \sum_{j \text{ bought}} \sum_{e \in S_j} y_e \\ &\le f \textstyle\sum_e y_e \le f \cdot \mathrm{LP} \le f \cdot \mathrm{OPT}\end{aligned}$$
complementary slackness, relaxed

Primal CS exact: $x_j > 0 \Rightarrow$ set $j$ tight. Dual CS relaxed: $y_e > 0 \Rightarrow$ $e$ covered at most $f$ times, not exactly once. The approximation ratio is exactly the relaxation factor.

Never solves an LP. Vertex cover is $f = 2$: a 2-approximation in linear time.

24 · primal–dual · example

Primal–dual set cover, traced

Four elements on a cycle. Sets $S_0 = \{0,1\}$ cost 3, $S_1 = \{1,2\}$ cost 2, $S_2 = \{2,3\}$ cost 3, $S_3 = \{3,0\}$ cost 2. Each element is in 2 sets: $f = 2$.

elementsets, still unpaidraise $y$ bytight, buy
0S0: 3, S3: 22S3 (covers 3, 0)
1S0: 1, S1: 21S0 (covers 0, 1)
2S1: 1, S2: 31S1 (covers 1, 2)
3already covered
the bill

Bought S3, S0, S1: cost $2 + 3 + 2 = 7$.

Dual $y = (2, 1, 1, 0)$, sum 4, feasible: each set's elements pay at most its cost. So $\mathrm{OPT} \ge 4$.

Guarantee $7 \le f \cdot 4 = 8$ ✓. Optimum: S1 $+$ S3 covers everything for 4.

S0 was bought and turned out redundant: S3 and S1 already cover 0 and 1. Primal–dual has no clean-up step here; Steiner forest's reverse delete is exactly such a step.

24 · primal–dual

Facility location: Jain & Vazirani (2001)

$$\begin{aligned}\max\ & \textstyle\sum_j \alpha_j \\ \text{s.t. } & \textstyle\sum_j \beta_{ij} \le f_i \\ & \alpha_j - \beta_{ij} \le d_{ij},\ \beta \ge 0\end{aligned}$$

The dual of the facility location LP. Phase 1. All $\alpha_j$ grow at rate 1. Once $\alpha_j \ge d_{ij}$, client $j$ pays $\beta_{ij} = \alpha_j - d_{ij}$ toward $i$. When $i$ is fully paid, it opens temporarily. A client stops growing (freeze) once it's tight with an open facility.

Phase 2. Temporarily open facilities conflict if a client pays both. Keep a maximal non-conflicting set, in opening order. Clients go to the nearest kept facility.

why 3 (metric), in words

Each client's $\alpha_j$ is a lower bound on what it must cost. If the facility it froze with was kept, it is within $\alpha_j$. If not, a kept facility is reachable by a three-hop detour, each hop at most $\alpha_j$ long: at most $3\alpha_j$.

full proof in the notes (N)

Jain–Vazirani, lab then:

F × CLP integralJV / OPTΣα / OPT
10 × 4010/101.031 (1.119)0.990
20 × 8010/101.057 (1.140)0.995
30 × 12010/101.054 (1.103)0.992

24 · primal–dual · example

Jain–Vazirani on a line

A: 0B: 10 c₀: 1c₁: 2c₂: 9

Facilities A and B (squares, opening cost 4 each), clients at positions 1, 2, 9. Distance is the gap on the line.

timeevent
1c0 reaches A, c2 reaches B: both start paying
2c1 reaches A; A now collects $(t-1) + (t-2)$
3.5A has collected $2.5 + 1.5 = 4$: opens; c0, c1 freeze at $\alpha = 3.5$
5B has collected $5 - 1 = 4$ from c2: opens; $c_2$ freezes at $\alpha = 5$
the result

No client pays both, so both are kept. Cost: opening $4 + 4$, serving $1 + 2 + 1$: 12. The dual $\sum\alpha = 3.5 + 3.5 + 5 = 12$ is a lower bound, so this is optimal, and the certificate proves it.

24 · beyond

Steiner forest, and iterative rounding

Steiner forest

Pairs $(s_i, t_i)$ in a weighted graph: the cheapest edge set connecting every pair. The LP has one covering constraint per cut separating some pair, exponentially many.

Primal–dual (Agrawal, Klein & Ravi 1995; Goemans & Williamson 1995): grow duals on all active components at once, buy tight edges, then reverse delete unnecessary ones. Ratio 2, by showing active components touch at most twice as many bought edges as there are components, on average.

iterative rounding (Jain 2001)

Steiner network: each pair needs $r_{ij}$ edge-disjoint paths. Theorem: every extreme point of the LP has some edge with $x_e \ge \tfrac12$. Algorithm: solve, fix that edge to 1, update the residual requirements, re-solve. Ratio 2.

The proof is a counting argument on tight constraints forming a laminar family, the same structure as the matroid intersection polytope (unit 13). It set off a line of results on degree-bounded spanning trees (Singh & Lau 2007: optimal cost, degrees exceeded by at most 1).

section 3

Integrality gaps

The limit of every LP-based proof.

24 · gaps

Instances that realise the gap

integrality gap

$\sup_I \mathrm{OPT}(I) / \mathrm{LP}(I)$ for minimisation. An algorithm proved via $\mathrm{ALG} \le \rho\,\mathrm{LP}$ has $\rho \ge$ the gap, since it can't beat OPT on the worst instance.

Gap instances. Vertex cover, $K_n$. All ½ gives $n/2$. Two uncovered vertices leave their edge uncovered, so $\mathrm{OPT} = n - 1$. Gap $2 - 2/n$.

Set cover, GF(2)k. The smallest case, $k = 2$: three sets on three elements, each set missing one element; LP 1.5, OPT 2: the three-element example of section 1. Elements and sets are the nonzero vectors; set $v$ holds $\{u : u \cdot v = 1\}$. Every set has $2^{k-1}$ elements, so $x = 2^{1-k}$ gives LP $< 2$. Sets $v_1, \dots, v_r$ miss every nonzero $u$ orthogonal to all of them, so $\mathrm{OPT} = k$.

ksetsLPOPTOPT/LPgreedyprimal–dual
371.75031.7134
4151.87542.1348
5311.93852.58516
6631.96963.05632
71271.98473.53764
a limit on proofs, not on algorithms

Greedy is optimal on every member. The gap says no analysis against this LP can certify better than $\approx \tfrac12\log_2 n$ here, not that finding a good cover is hard.

24 · measured

LP bound, optimum, algorithm: what the measurements say

Set cover, 10 instances, 150 elements and 100 sets, optimum by CP-SAT:

algorithmmean / OPTworstguarantee
LP bound0.9371.000—
randomized, $t = 7$, best of 201.7282.140$O(\log n)$
primal–dual1.9642.556$f = 21$
greedy (unit 23)1.1481.326$H_d \approx 5$
  • Greedy beats both LP-based algorithms on random set cover, while guaranteeing about the same.
  • Primal–dual beats rounding on weighted vertex cover (1.39 against 1.75), with the same guarantee of 2. Rounding takes every half.
  • The LP is tight on random facility location: integral 30 times of 30.
  • The gap families are built by hand. Nothing random came close to them.

An approximation ratio is a certificate, and practice asks a different question. Unit 26 answers it with heuristics, and unit 28 with a method for comparing them honestly.

24 · lab

Lab 24 — what you build

about 2½–3 hours · uv run co lab 24
  1. Vertex cover LP and threshold rounding.
  2. Randomized rounding for set cover, with exact miss probabilities and the union bound.
  3. Primal–dual set cover.
  4. Jain–Vazirani: event-driven dual ascent in exact arithmetic, pruning, assignment.
  5. Integrality gaps: $K_n$ and GF(2)k.
uv run co test 24
uv run co then 24     # LP · optimum · algorithm on 72 instances · failure rates · out/then.png

24 · checkpoint

Done when

checkpoint
  • All five lab steps are ✓.
  • You can exhibit an instance realising the integrality gap of a given LP, and explain why it proves that no rounding of that LP can beat that ratio.
  • You can say why greedy solves that same instance optimally without contradicting anything.

Reading

Williamson & Shmoys (2011), ch. 1, 4, 7.
Vazirani (2001), ch. 14–15, 24.
Jain & Vazirani, JACM 48 (2001).
Jain, Combinatorica 21 (2001).

Next

25 semidefinite relaxations: Goemans–Williamson Max-Cut · 26 metaheuristics, benchmarked honestly.