Combinatorial Optimization: Matching, Approximation Algorithms & Complexity
Combinatorial optimization asks for the best discrete structure — a tour, a subset, a schedule — from an exponentially large but finite set. Most natural problems are NP-hard, making exact algorithms impractical at scale. Approximation algorithms offer a compelling alternative: polynomial-time procedures with provable worst-case guarantees on solution quality.
Concepts
Green edges carry flow; red edges are saturated (form the min-cut). Max-flow = min-cut = 20.
The question "find the shortest tour through all cities" sounds geometric, but its difficulty is combinatorial: there are possible tours, and no structure allows us to discard most of them without examination. Combinatorial optimization formalizes this: a finite but exponentially large search space, an objective to minimize, and the question of whether we can do better than exhaustive search. For most natural problems, we cannot — but approximation algorithms offer polynomial-time procedures with provable guarantees on how far the solution can be from optimal.
NP-Hardness and Complexity
A problem is NP-hard if every problem in NP reduces to it in polynomial time. An optimization problem is NP-hard if its decision version is NP-complete. NP-hardness rules out polynomial-time exact algorithms unless P = NP.
Key reductions chain as follows: . Each reduction takes a "yes" instance to a "yes" instance in polynomial time, so a polynomial solver for the target would solve the source.
An approximation algorithm with ratio produces a solution of cost at most (for minimization) in polynomial time. The ratio measures the worst-case multiplicative deviation from optimum.
The reduction chain is not just a theoretical classification — it is a constructive argument. Each reduction is an explicit polynomial-time function that maps "yes" instances to "yes" instances, so a polynomial algorithm for the target would immediately give a polynomial algorithm for every problem in the chain. This is why NP-hardness proofs close the door on exact polynomial algorithms: they show the problem encodes something as hard as Boolean satisfiability itself.
Traveling Salesman Problem
Given a complete graph with edge weights , find the minimum-weight Hamiltonian cycle.
ILP formulation (Dantzig-Fulkerson-Johnson):
where is the set of edges incident to and is the cut set for . The subtour elimination constraints prevent disconnected cycles — there are exponentially many of them, handled by cutting-plane separation.
Christofides' algorithm (for metric TSP, where triangle inequality holds):
- Compute a minimum spanning tree .
- Let be the set of odd-degree vertices in . Find a minimum-weight perfect matching on .
- Combine to get an Eulerian multigraph. Find an Euler tour, then shortcut repeated vertices.
Approximation ratio: (removing any edge from OPT gives a spanning tree). (the optimal TSP tour restricted to gives a perfect matching on of cost ; since is even, take every other edge). Shortcuts only decrease cost by the triangle inequality. Total: .
0/1 Knapsack and FPTAS
The 0/1 knapsack problem:
Dynamic programming in time. Define = maximum value using items with capacity exactly :
with for all . The answer is . This is pseudo-polynomial: polynomial in and , but can be exponential in the input bit-length.
FPTAS (fully polynomial-time approximation scheme). Scale and round the values: where . Solve the DP on scaled values in time. The optimal value of the rounded instance differs by at most , giving a -approximation for any in polynomial time.
Scheduling: Makespan Minimization
Given jobs with processing times and machines, assign jobs to minimize makespan .
List scheduling (Graham, 1966): Assign each job greedily to the currently least-loaded machine.
Approximation ratio 2: When the last job finishes on machine at time , machine was the least loaded when was assigned, so:
Thus . Sorting jobs in decreasing order before assignment (LPT rule) improves this to , and a PTAS achieves for any fixed .
LP Relaxations and Integrality Gaps
The LP relaxation lower-bounds OPT and its integrality gap (or for maximization) limits how good an LP-based approximation can be.
For metric TSP, the Held-Karp LP relaxation (the natural LP without integrality) is conjectured to have integrality gap exactly — matching Christofides' ratio. This is the content of the conjecture, one of the most famous open problems in combinatorial optimization.
For vertex cover, the LP relaxation (set , minimize s.t. for edges) has integrality gap , leading to the standard 2-approximation by rounding all to 1.
Worked Example
0/1 Knapsack DP
Four items: , capacity .
DP table (rows = items added, cols = weight ):
| \ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 (v=3,w=2) | 0 | 0 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |
| 2 (v=4,w=3) | 0 | 0 | 3 | 4 | 4 | 7 | 7 | 7 | 7 |
| 3 (v=5,w=4) | 0 | 0 | 3 | 4 | 5 | 7 | 8 | 9 | 9 |
| 4 (v=6,w=5) | 0 | 0 | 3 | 4 | 5 | 7 | 9 | 10 | 10 |
Optimal value = 10 at and . Backtrack: item 4 included (), remaining capacity 3; item 2 included (), value . Solution: items 2 and 4.
Christofides 3/2 Ratio Argument
For 4-city metric TSP with symmetric distances, suppose .
- MST cost (delete any OPT edge to get a spanning tree).
- Odd-degree vertices in : say 2 vertices. Minimum matching on these 2 vertices uses one OPT edge, so .
- Euler tour of : total weight . Shortcut (triangle inequality): still .
- Ratio: .
The matching bound is tight because the tour on the even-indexed OPT edges and the tour on odd-indexed OPT edges are both perfect matchings of , together covering OPT. The cheaper one costs .
Connections
Where Your Intuition Breaks
A -approximation for TSP sounds like it leaves a 50% gap from optimal — but on real-world instances, heuristics like LKH (Lin-Kernighan-Helsgott) routinely find tours within 1–2% of OPT. The gap between the worst-case approximation ratio and typical performance is enormous. The reason: approximation ratios bound the adversarial case, not the typical case. On random Euclidean instances or structured graphs, the LP relaxation is nearly tight and the matching step adds little. The ratio is tight on carefully constructed adversarial examples, not on the delivery routes, circuit board problems, or genome assembly instances that motivate TSP in practice. Always interpret approximation ratios as theoretical certificates, not predictions of average performance.
The LP relaxation quality and approximation ratio are intimately linked. For vertex cover: the LP has integrality gap and the LP-rounding gives a 2-approximation. For TSP: Christofides' ratio matches the conjectured LP gap. The Held-Karp LP gives a lower bound on OPT; if you can round its fractional solution to an integer tour losing a factor of at most , you immediately have a -approximation. Designing good LP relaxations is as important as designing the rounding scheme.
| Problem | Best known approx. ratio | LP gap | NP-hard? |
|---|---|---|---|
| Metric TSP | (Christofides) | (conjectured) | Yes |
| Vertex Cover | 2 | 2 | Yes |
| Set Cover | Yes (inapprox.) | ||
| Knapsack | FPTAS | 1 | Yes |
| Makespan () | PTAS | — | Strongly NP-hard |
Not every NP-hard problem admits a good approximation. The PCP theorem (Arora et al., 1998) establishes that for problems like MAX-3-SAT, approximating within certain constants is NP-hard itself. For Set Cover, achieving ratio better than for any is NP-hard (Feige, 1998). Inapproximability results are as important as upper bounds: they tell you when to stop looking for better algorithms and start asking whether your problem has special structure.
Practical Takeaways
When facing a combinatorial optimization problem: (1) identify if it reduces to a polynomially-solvable special case (network flow, matching, shortest path); (2) if NP-hard, determine the best LP relaxation and its gap; (3) choose between exact ILP (branch-and-cut), a certified approximation, or problem-specific heuristics based on required optimality guarantees and instance size.
Enjoying these notes?
Get new lessons delivered to your inbox. No spam.