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 . 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 ?”, 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 -approximation returning cost cannot decide whether .
Write an optimization problem as instances , feasible solutions , and objective . Let be the best feasible value. A polynomial-time algorithm must first output ; only then does the ratio matter.
Ratio conventions
For minimization, an -approximation, , satisfies
For maximization we use the same factor-above-one convention:
Some texts instead report a maximization performance fraction with . Thus “a guarantee” and “a factor- 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 . While an uncovered edge remains, put both in and delete all edges incident to either endpoint. Return . The chosen edges form a maximal matching .
Theorem. The algorithm is a -approximation for unweighted Minimum Vertex Cover.
Proof walkthrough.
- Feasibility. When the loop stops no edge remains uncovered. Equivalently, if an edge had neither endpoint in , it could have been added to , contradicting maximality.
- Lower bound. Every vertex cover must contain at least one endpoint of each edge of . Matching edges are vertex-disjoint, so one selected vertex cannot cover two of them. Hence .
- Charge the output. The algorithm takes exactly two endpoints per matched edge: .
On the path , choosing edges and returns all four vertices, while 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 , a cut has value equal to the number (or total nonnegative weight) of crossing edges.
Randomized algorithm. Independently put every vertex on either side with probability . For each edge , let if its endpoints differ. Then , and linearity of expectation gives
Because , the expected cut is at least . No independence among the 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 . 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 .
Example. A triangle has three edges and optimum two. Random assignment has expected , while local improvement returns a cut of size two. The analysis promises only at least 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
Algorithm.
- Compute a minimum spanning tree .
- Double every edge of . All degrees are even, so the multigraph has an Euler tour.
- Traverse an Euler tour and shortcut already visited vertices, finally returning to the start.
Theorem. Double-tree is a -approximation for metric TSP.
Proof walkthrough. Delete any edge from an optimal Hamiltonian cycle; what remains is a spanning tree, so . Doubling gives an Eulerian multigraph of weight . 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
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 . One Euler traversal may revisit a corner; shortcutting can produce the perimeter tour of cost , which is optimal. The guarantee remains , 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 and bins have capacity . The goal is to minimize the number of bins. The volume lower bound is
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 bins, every consecutive pair of bins has total load greater than : the first item of the later bin did not fit in the earlier one. Pairing bins gives
so (a sharper statement is ). 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
This is an absolute bound with an additive constant, and implies asymptotic ratio . Do not erase the additive term when 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 , NF in that order makes two perfect bins. In the order 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:
- Specify the input assumptions and objective.
- Give executable polynomial-time pseudocode.
- Prove the output is feasible.
- Find a lower bound on for minimization, or an upper bound for maximization.
- Relate the algorithm's value to that bound.
- 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
Approximation-ratio proof bridges
For a board visualization, draw four “proof bridges”: matched edges VC lower bound; all edges Max-Cut upper bound; optimal tour minus one edge MST; total item volume bins. Label each bridge with the direction of its inequality.
Exercises
Exercise 1 — Factor from a bound
A minimization algorithm returned , and you proved . Which approximation factor did you prove? Why need you not know exact ?
Solution
The ratio . 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 -approximation. Distinguish maximal from maximum matching.
Solution
Feasibility: maximality — every edge meets , else it could be added. Bound: edges of are disjoint, so . The algorithm picks vertices, hence . A maximum matching is not required.
Exercise 3 — Max-Cut expectation
Prove 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 , so by linearity — no independence needed. Nonnegative weights give , hence expectation . 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 -approximation under triangle inequality. What fails without it?
Solution
(delete an edge from an optimal tour). Doubling yields an Eulerian tour of weight . Shortcutting under triangle inequality does not increase cost. Without the triangle inequality, shortcutting may raise cost.
Exercise 5 — Bin packing volume
NF used bins. What does the adjacent-bin pairing argument say about ? Why does an asymptotic ratio not replace additive constants on small instances?
Solution
Disjoint adjacent pairs with load give volume from four pairs among eight bins, hence with a ninth bin in the standard course argument. The ratio describes large-OPT behavior; additive constants dominate small instances (e.g. allows up to bins under FFD).
Summary
Approximation is a worst-case theorem: a feasible polynomial-time solution versus a bound on . Bound direction and problem hypotheses are part of the proof.
Guided practice
Task 1 — Bound direction
A VC run selected matching edges ( vertices). You also found a hand cover of size . What does each number prove about the factor?
Solution
The matching gives , so . The size- cover is an upper bound on OPT () 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 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 . Only exact approximation (factor ) 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.
The pages this was written from
3 pages
These pages were chosen by word overlap between the text here and the page's transcription — nobody has verified them. Treat them as a lead to check, not a citation.
Lecture 11 · page 2אלגוריתמי קירוב וסכום תת קבוצהShared wordsשנכנסים · שלפני · קצוות · מקסימיזציה · בודדת · בחירת
Lecture 13 · page 3המשך בעיות NP קשותShared wordsגרסת · האופטימיזציה · First · Fit · שלמים · אופטימלי
Lecture 13 · page 4המשך בעיות NP קשותShared wordsהעץ · משקלים · הצלעות · steiner · עץ · משקל