01Chapter 1: Why NP-Hard Optimization Calls for ApproximationMany practical problems ask for the best solution among a huge set of candidates. Examples include the fewest servers that monitor every network link, the shortest delivery route through 200 stops, and the most profitable set of items that fits within a budget. For many of these problems, no one kno6 min read
02Chapter 2: Approximation Ratios: What a Guarantee MeansThis chapter assumes you know Big-O notation, what it means for an algorithm to run in polynomial time, and the basic idea of NP-hardness. The previous chapter explained why exact algorithms for NP-hard optimization problems are impractical. Here we make "close to optimal" precise, so that later cha7 min read
03Chapter 3: Proving Guarantees Without Knowing the OptimumThis chapter assumes you know the definition of the approximation ratio from the previous chapter. It also assumes you can read basic Python and follow a short proof by inequalities. Here is the central difficulty. A guarantee such as "ALG ≤ 2 · OPT" compares the algorithm's output with the optimal 7 min read
04Chapter 4: A 2-Approximation for Vertex CoverThis chapter assumes you know what a matching is in a graph and that minimum vertex cover is NP-hard. It also builds on the previous chapter's idea of proving a guarantee by comparing the algorithm's output with a lower bound on the optimum, written OPT. Here that idea becomes a complete algorithm. 7 min read
05Chapter 5: Greedy Set Cover and the ln n BoundThis chapter assumes you know what NP-hardness means and have seen the approximation ratio defined. It also uses the main idea from the last two chapters: you prove a guarantee by comparing the algorithm's output with a bound on the unknown optimum. You should be comfortable with sums like 1 + 1/2 +8 min read
06Chapter 6: Scheduling on Identical Machines: List Scheduling and LPTThis chapter assumes you can follow a proof that compares an algorithm's cost with a lower bound on the optimum, as in the previous chapters. It also assumes you know what a binary heap does and can read Python that uses heapq.7 min read
07Chapter 7: Metric TSP: From Spanning Trees to ToursThe Traveling Salesperson Problem (TSP) gives you n cities and a distance between every pair. You want the shortest closed tour that visits every city exactly once. TSP is NP-hard, and the next chapter shows that with arbitrary distances it cannot be approximated within any constant factor unless P 7 min read
08Chapter 8: Why General TSP Cannot Be ApproximatedThe previous chapter gave a 2-approximation for TSP when distances obey the triangle inequality. It is natural to hope that a weaker constant, say 10 or 1000, could be achieved without that assumption. That hope fails. Unless P = NP, no polynomial-time algorithm approximates general TSP within any c7 min read
09Chapter 9: Local Search: A 1/2-Approximation for Max-CutThis chapter assumes you know the approximation-ratio definition from earlier chapters, basic graph terms (degree, neighbors, edge sets), and the idea of bounding the unknown optimum to prove a guarantee. The code uses only plain Python.6 min read
10Chapter 10: Approximation Schemes: Trading Accuracy for TimeThe earlier chapters each gave one fixed guarantee: 2 for vertex cover, H_n for set cover, 4/3 for LPT scheduling. If you need a solution within 1% of optimal, none of those algorithms can provide it. An approximation scheme is a family of algorithms with a dial on it. You choose an error tolera7 min read
11Chapter 11: An FPTAS for 0/1 KnapsackThis chapter assumes you know the PTAS and FPTAS definitions from the previous chapter. It also assumes you can read a one-dimensional dynamic program (DP) in Python and that you are comfortable with floor rounding and big-O bounds. The goal is to turn an exact but pseudo-polynomial knapsack algorit6 min read
12Chapter 12: LP Relaxation and Rounding for Weighted Vertex CoverThis chapter assumes you know what a linear program (LP) is: you minimize a linear objective subject to linear inequalities, and LPs can be solved in polynomial time. It also assumes you have read the earlier chapter on the matching-based 2-approximation for vertex cover, and that you can run Python6 min read
13Chapter 13: Randomized Approximation for MAX-SATThis chapter assumes you know linearity of expectation, how to read an approximation ratio for a maximization problem (from the earlier chapter on ratios), and the basic shape of a linear program (LP) and its relaxation, from the chapter on rounding for weighted vertex cover. The code uses only the 6 min read
14Chapter 14: The Primal-Dual MethodThis chapter assumes you know the LP relaxation of weighted vertex cover from the chapter on LP rounding, and that you can read a linear program and form its dual. Linear programming duality is the main tool here. You will also need the greedy set cover algorithm from earlier in the tutorial.7 min read
15Chapter 15: Limits of Approximation: Gap Reductions and the PCP TheoremThis chapter assumes you know polynomial-time reductions and NP-completeness, the definition of the approximation ratio from earlier chapters, and the argument from the chapter on general TSP, where a Hamiltonian-cycle instance was turned into a TSP instance with a huge cost gap. That TSP argument u7 min read
16Chapter 16: Approximation Classes: PTAS, FPTAS, and APXThis chapter assumes you already know the material from earlier chapters: how an approximation ratio is defined, what a PTAS and an FPTAS are, the knapsack FPTAS, and the idea of a gap reduction from the PCP chapter. It also assumes you are comfortable with NP-completeness and strong NP-hardness. Th6 min read