Unit 7

Approximation Algorithms

Approximation ratios and proof patterns for Vertex Cover, Max-Cut, metric TSP, and Bin Packing.

Goals

  • Separate optimization problems from their threshold decision versions.
  • State and prove approximation guarantees for minimization and maximization.
  • Analyze four representative algorithms and recognize their proof patterns.
  • Treat Bin Packing's additive guarantees carefully.

1. Optimization is not a decision language

A decision problem asks for one bit. For example, VC-DEC asks whether a graph has a vertex cover of size at most kk. The associated optimization problem MIN-VC asks for the smallest cover itself (or its size). NP-completeness is formally a property of the decision language; approximation is a guarantee about the optimization objective.

Threshold queries connect the two. If objective values are integers bounded by a polynomial number of bits and we can answer “is OPT≤k\mathrm{OPT}\le k?”, binary search finds the optimal value. A standard self-reduction can often recover a witness. Conversely, an optimizer answers every threshold question. This connection does not mean that an approximation algorithm decides the exact language: a 22-approximation returning cost 1212 cannot decide whether OPT≤7\mathrm{OPT}\le7.

Write an optimization problem as instances II, feasible solutions F(I)F(I), and objective val⁡(I,S)\operatorname{val}(I,S). Let OPT(I)\mathrm{OPT}(I) be the best feasible value. A polynomial-time algorithm must first output S∈F(I)S\in F(I); only then does the ratio matter.

Ratio conventions

For minimization, an α\alpha-approximation, α≥1\alpha\ge1, satisfies

val⁡(I,A(I))≤α OPT(I).\operatorname{val}(I,A(I))\le \alpha\,\mathrm{OPT}(I).

For maximization we use the same factor-above-one convention:

val⁡(I,A(I))≥OPT(I)α.\operatorname{val}(I,A(I))\ge \frac{\mathrm{OPT}(I)}{\alpha}.

Some texts instead report a maximization performance fraction ρ∈[0,1]\rho\in[0,1] with A(I)≥ρOPT(I)A(I)\ge\rho\mathrm{OPT}(I). Thus “a 1/21/2 guarantee” and “a factor-22 approximation” may describe the same Max-Cut result. State the convention. The guarantee is worst-case, per instance, and includes polynomial running time; good experiments alone establish only a heuristic.

2. Minimum Vertex Cover: maximal matching

Algorithm. Start with C=∅C=\varnothing. While an uncovered edge {u,v}\{u,v\} remains, put both u,vu,v in CC and delete all edges incident to either endpoint. Return CC. The chosen edges form a maximal matching MM.

Theorem. The algorithm is a 22-approximation for unweighted Minimum Vertex Cover.

Proof walkthrough.

  1. Feasibility. When the loop stops no edge remains uncovered. Equivalently, if an edge had neither endpoint in CC, it could have been added to MM, contradicting maximality.
  2. Lower bound. Every vertex cover must contain at least one endpoint of each edge of MM. Matching edges are vertex-disjoint, so one selected vertex cannot cover two of them. Hence OPT≥∣M∣\mathrm{OPT}\ge |M|.
  3. Charge the output. The algorithm takes exactly two endpoints per matched edge: ∣C∣=2∣M∣≤2OPT|C|=2|M|\le2\mathrm{OPT}.

On the path 1−2−3−41-2-3-4, choosing edges {1,2}\{1,2\} and {3,4}\{3,4\} returns all four vertices, while {2,3}\{2,3\} is an optimum cover of size two. The factor can therefore be tight for this algorithm. “Maximal” means no edge can be added; it does not mean maximum cardinality.

3. Max-Cut: half of all edges

For an undirected graph G=(V,E)G=(V,E), a cut (S,V∖S)(S,V\setminus S) has value equal to the number (or total nonnegative weight) of crossing edges.

Randomized algorithm. Independently put every vertex on either side with probability 1/21/2. For each edge e={u,v}e=\{u,v\}, let Xe=1X_e=1 if its endpoints differ. Then Pr⁡[Xe=1]=1/2\Pr[X_e=1]=1/2, and linearity of expectation gives

E[X]=∑e∈EE[Xe]=∣E∣/2.\mathbb E[X]=\sum_{e\in E}\mathbb E[X_e]=|E|/2.

Because OPT≤∣E∣\mathrm{OPT}\le |E|, the expected cut is at least OPT/2\mathrm{OPT}/2. No independence among the XeX_e variables is required for this sum. Repeating and keeping the best cut improves confidence, but the expectation statement already proves existence.

There is also a deterministic form. Process vertices one at a time, choosing the side that leaves the conditional expected final cut no smaller. This method of conditional expectations returns a cut of value at least ∣E∣/2|E|/2. An elementary local-improvement view gives the same bound: move any vertex having more neighbors on its own side than across. Each move strictly increases the integer cut value, so the process stops; at termination every vertex has at least half its incident edges crossing. Summing crossing degrees counts every crossing edge twice, yielding 2∣δ(S)∣≥∣E∣2|\delta(S)|\ge |E|.

Example. A triangle has three edges and optimum two. Random assignment has expected 3/23/2, while local improvement returns a cut of size two. The analysis promises only at least 1.51.5 in expectation (hence at least two for some integral cut), not that every random run cuts half the edges.

4. Metric TSP: the double-tree algorithm

General TSP admits no useful metric shortcut argument. Here the input is a complete weighted graph whose nonnegative distances satisfy symmetry and the triangle inequality

d(u,w)≤d(u,v)+d(v,w).d(u,w)\le d(u,v)+d(v,w).

Algorithm.

  1. Compute a minimum spanning tree TT.
  2. Double every edge of TT. All degrees are even, so the multigraph has an Euler tour.
  3. Traverse an Euler tour and shortcut already visited vertices, finally returning to the start.

Theorem. Double-tree is a 22-approximation for metric TSP.

Proof walkthrough. Delete any edge from an optimal Hamiltonian cycle; what remains is a spanning tree, so w(T)≤OPTw(T)\le\mathrm{OPT}. Doubling gives an Eulerian multigraph of weight 2w(T)2w(T). Whenever the Euler walk would revisit vertices, replace a subpath by the direct edge. Triangle inequality says shortcutting cannot increase cost. The resulting Hamiltonian tour therefore costs at most

2w(T)≤2OPT.2w(T)\le2\mathrm{OPT}.

Worked example. Put four points at the corners of a unit square with Euclidean distances. An MST uses three unit sides, so its doubled weight is 66. One Euler traversal may revisit a corner; shortcutting can produce the perimeter tour of cost 44, which is optimal. The guarantee remains 22, even though this instance performs better.

The most common invalid proof applies shortcutting without a metric. If a missing diagonal is represented by a very expensive direct edge, replacing a two-edge detour can increase cost.

5. Bin Packing: asymptotic and additive care

Items have sizes si∈(0,1]s_i\in(0,1] and bins have capacity 11. The goal is to minimize the number of bins. The volume lower bound is

OPT≥⌈∑isi⌉,\mathrm{OPT}\ge \left\lceil\sum_i s_i\right\rceil,

but volume alone can be weak because items cannot be split.

Next Fit (NF). Keep one open bin. Place the next item if it fits; otherwise close that bin and open a new one. If NF uses mm bins, every consecutive pair of bins has total load greater than 11: the first item of the later bin did not fit in the earlier one. Pairing bins gives

∑isi>⌊m/2⌋,\sum_i s_i>\lfloor m/2\rfloor,

so m≤2 OPTm\le2\,\mathrm{OPT} (a sharper statement is m<2OPT+1m<2\mathrm{OPT}+1). The algorithm is online: it sees no future items.

First Fit Decreasing (FFD). Sort items in nonincreasing order, then put each into the first bin with enough room. FFD is substantially stronger. A classical theorem gives

FFD(I)≤119OPT(I)+69.\mathrm{FFD}(I)\le \frac{11}{9}\mathrm{OPT}(I)+\frac{6}{9}.

This is an absolute bound with an additive constant, and implies asymptotic ratio 11/911/9. Do not erase the additive term when OPT\mathrm{OPT} is small. The full FFD proof uses a detailed classification of item sizes and is beyond this lesson; the course-summary pages motivate the algorithm, while textbook authority is used here only for the general approximation framework.

Example. For items 0.6,0.6,0.4,0.40.6,0.6,0.4,0.4, NF in that order makes two perfect bins. In the order 0.6,0.4,0.6,0.40.6,0.4,0.6,0.4 it also makes two; but order sensitivity appears immediately in larger examples, which is why decreasing-order preprocessing matters.

6. A reusable proof template

For every claimed approximation:

  1. Specify the input assumptions and objective.
  2. Give executable polynomial-time pseudocode.
  3. Prove the output is feasible.
  4. Find a lower bound on OPT\mathrm{OPT} for minimization, or an upper bound for maximization.
  5. Relate the algorithm's value to that bound.
  6. State whether the result is deterministic, expected, high-probability, absolute, or asymptotic.

Matching size lower-bounds Vertex Cover; total edge weight upper-bounds Max-Cut; MST weight lower-bounds metric TSP; total item volume lower-bounds Bin Packing. These simple certificates are the engines of the analyses.

Common mistakes

  • Calling an optimization problem “NP-complete” without identifying its decision version.
  • Proving a bound on cost but not feasibility or polynomial runtime.
  • Inverting minimization and maximization inequalities.
  • Treating expected performance as a guarantee for every random run.
  • Shortcutting a TSP walk without triangle inequality.
  • Reporting an asymptotic Bin Packing ratio as an exact bound for every instance.

Visualizations

Guided construction

Approximation-ratio proof bridges

Step 1 of 6
minimizationOPT ≤ A ≤ α·OPTControl an algorithmic upper bound using an OPT lower bound.
maximizationOPT/α ≤ A ≤ OPTControl an algorithmic lower bound using an OPT upper bound.
Lower bound used for minimizationUpper bound used for maximization

For a board visualization, draw four “proof bridges”: matched edges →\to VC lower bound; all edges →\to Max-Cut upper bound; optimal tour minus one edge →\to MST; total item volume →\to bins. Label each bridge with the direction of its inequality.

Exercises

Exercise 1 — Factor from a bound

A minimization algorithm returned 3030, and you proved OPT≥20\mathrm{OPT}\ge20. Which approximation factor did you prove? Why need you not know exact OPT\mathrm{OPT}?

Solution

The ratio ALG/OPT≤30/20=3/2\mathrm{ALG}/\mathrm{OPT}\le30/20=3/2. A lower bound on OPT suffices for minimization; it may be conservative. Exact OPT is unnecessary.

Exercise 2 — Vertex Cover via maximal matching

Prove that taking both endpoints of a maximal matching is a 22-approximation. Distinguish maximal from maximum matching.

Solution

Feasibility: maximality — every edge meets MM, else it could be added. Bound: edges of MM are disjoint, so OPT≥∣M∣\mathrm{OPT}\ge|M|. The algorithm picks 2∣M∣2|M| vertices, hence ALG≤2 OPT\mathrm{ALG}\le2\,\mathrm{OPT}. A maximum matching is not required.

Exercise 3 — Max-Cut expectation

Prove E[X]≥12∑ewe\mathbb E[X]\ge\tfrac12\sum_e w_e for a fair random cut with nonnegative weights, even with dependence. When do negative weights break the argument?

Solution

Each edge is cut with probability 1/21/2, so E[X]=∑ewe/2\mathbb E[X]=\sum_e w_e/2 by linearity — no independence needed. Nonnegative weights give ∑we≥OPT\sum w_e\ge\mathrm{OPT}, hence expectation ≥OPT/2\ge\mathrm{OPT}/2. Negative weights: OPT may leave a negative edge uncut, so half the total weight need not lower-bound OPT usefully.

Exercise 4 — Metric TSP

Outline the double-tree 22-approximation under triangle inequality. What fails without it?

Solution

w(MST)≤OPTw(\mathrm{MST})\le\mathrm{OPT} (delete an edge from an optimal tour). Doubling yields an Eulerian tour of weight 2w(MST)2w(\mathrm{MST}). Shortcutting under triangle inequality does not increase cost. Without the triangle inequality, shortcutting may raise cost.

Exercise 5 — Bin packing volume

NF used 99 bins. What does the adjacent-bin pairing argument say about OPT\mathrm{OPT}? Why does an asymptotic 11/911/9 ratio not replace additive constants on small instances?

Solution

Disjoint adjacent pairs with load >1>1 give volume >4>4 from four pairs among eight bins, hence with a ninth bin OPT≥5\mathrm{OPT}\ge5 in the standard course argument. The 11/911/9 ratio describes large-OPT behavior; additive constants dominate small instances (e.g. OPT=2\mathrm{OPT}=2 allows up to 33 bins under FFD).

Summary

Approximation is a worst-case theorem: a feasible polynomial-time solution versus a bound on OPT\mathrm{OPT}. Bound direction and problem hypotheses are part of the proof.

Guided practice

Task 1 — Bound direction

A VC run selected 66 matching edges (1212 vertices). You also found a hand cover of size 88. What does each number prove about the factor?

Solution

The matching gives OPT≥6\mathrm{OPT}\ge6, so ALG/OPT≤12/6=2\mathrm{ALG}/\mathrm{OPT}\le12/6=2. The size-88 cover is an upper bound on OPT (OPT≤8\mathrm{OPT}\le8) and alone does not certify the minimization algorithm's quality.

Task 2 — Expectation versus derandomization

Random Max-Cut may return an empty cut on one run. How do conditional expectations turn an expectation guarantee into a deterministic algorithm?

Solution

At each step fix a side for a vertex that does not decrease the conditional expected remaining weight. The resulting deterministic solution is at least the original expectation. Expectation existence ≠\neq a per-run random guarantee.

Task 3 — Approximation versus NP-completeness

Why does a polynomial approximation algorithm for an optimization problem not contradict NP-completeness of the decision version?

Solution

The decision version asks an exact threshold; approximation allows relative error. An approximate solution need not decide whether OPT≤K\mathrm{OPT}\le K. Only exact approximation (factor 11) or certain FPTAS settings relate directly to decision.

Source trail and authority

  • Student-summary evidence (scope only): סיכומי שיעור/סיכום ממוזג.pdf, pp. 58–63, 67, and 76–80. Pages 79–80 discuss Steiner Tree and use a related MST/doubling/shortcut pattern; they do not explicitly present metric TSP. Accordingly, the metric-TSP lesson above is supported by the textbooks, not attributed to the merged summary. The summary is student-authored evidence of course emphasis, not final authority.
  • Textbook authority: Sipser, Introduction to the Theory of Computation, 3rd ed., §10.1, pp. 393–396 (approximation framework); Papadimitriou, Computational Complexity, Ch. 13, especially §13.1, pp. 299–309 (approximation algorithms) and §13.2, pp. 309–319 (complexity context).
  • Editorial status: definitions and the four analyses above were cross-checked against those textbook sections. The exact FFD constant is presented as a classical survey fact, not proved here. Reviewed; high confidence.