01Chapter 1: Why NP-Hard Optimization Calls for ApproximationMany problems you meet in practice ask for the best solution, not just a valid one. Examples include the smallest set of servers that monitors every network link, the shortest delivery route, and the most valuable load that fits in a truck. A large number of these problems are NP-hard. This chapter 3 min read
02Chapter 2: Approximation Ratios: What a Guarantee MeansThis chapter assumes you know Big-O notation and what polynomial time means, and that you have seen NP-hardness. The previous chapter explained why exact algorithms for NP-hard optimization problems are impractical. This chapter defines exactly what an approximation algorithm promises in their place3 min read
03Chapter 3: Proving Guarantees Without Knowing the OptimumThis chapter assumes you know Big-O notation, basic graph terms (matchings and spanning trees), and the definition of an approximation ratio from the previous chapter.2 min read
04Chapter 4: A 2-Approximation for Vertex CoverThis chapter assumes you know what a matching is, can read short Python functions, and remember the approximation ratio from the previous chapter. It applies the lower-bounding idea from the last chapter to its first concrete problem.2 min read
05Chapter 5: Greedy Set Cover and the ln n BoundThis chapter assumes you know the approximation ratio and the strategy of bounding the optimum from the previous chapters. It also uses Python sets and the harmonic series H_n = 1 + 1/2 + … + 1/n, which grows like ln n.3 min read
07Chapter 7: Metric TSP: From Spanning Trees to ToursThis chapter assumes you know minimum spanning trees (MSTs) and Prim's algorithm, Euler tours, and the lower-bounding technique from earlier chapters.3 min read
08Chapter 8: Why General TSP Cannot Be ApproximatedThis chapter assumes you know what a Hamiltonian cycle is, that deciding whether a graph has one is NP-complete, and how a polynomial-time reduction works. It also builds on the previous chapter, where the triangle inequality made a 2-approximation possible for metric TSP.3 min read
09Chapter 9: Local Search: A 1/2-Approximation for Max-CutThis chapter assumes you know basic graph terms (degree, edges), Big-O notation, and the definition of an approximation ratio for maximization problems from earlier chapters.3 min read
10Chapter 10: Approximation Schemes: Trading Accuracy for TimeThis chapter assumes you know the approximation ratio from earlier chapters, Big-O notation, and the idea of strong versus weak NP-hardness. So far every algorithm in this tutorial has had one fixed guarantee, such as 2 for vertex cover or H_n for set cover. An approximation scheme gives you a setti3 min read
11Chapter 11: An FPTAS for 0/1 KnapsackThis chapter assumes you already know the PTAS/FPTAS definitions from the previous chapter, can read dynamic programming code, and understand what pseudo-polynomial running time means.2 min read
12Chapter 12: LP Relaxation and Rounding for Weighted Vertex CoverThis chapter assumes you know what a linear program (LP) is, that LPs can be solved in polynomial time, and how the matching-based 2-approximation for unweighted vertex cover works. It also assumes you can read Python that uses scipy.2 min read
13Chapter 13: Randomized Approximation for MAX-SATThis chapter assumes you know basic discrete probability, specifically expectation and linearity of expectation. It also assumes you are comfortable with the approximation ratio for maximization problems from earlier chapters. The goal is a simple randomized algorithm that satisfies 7/8 of the claus3 min read
14Chapter 14: The Primal-Dual MethodThis chapter assumes you know linear programming (LP) basics, the LP relaxation of weighted vertex cover from the earlier chapter, and the idea of a dual LP. The rounding approach in that chapter solves the LP first. The primal-dual method skips the solver. It builds a feasible dual solution and an 2 min read
15Chapter 15: Limits of Approximation: Gap Reductions and the PCP TheoremThis chapter assumes you know polynomial-time reductions and NP-completeness, the approximation ratio, and the argument from the chapter "Why General TSP Cannot Be Approximated." That argument was a first example of the technique developed here.3 min read
16Chapter 16: Approximation Classes: PTAS, FPTAS, and APXThis chapter assumes you have read the earlier chapters on approximation ratios, approximation schemes, and hardness of approximation through gap reductions. It also assumes you know what "unless P = NP" means as a conditional result. Here we sort the problems from this tutorial into classes based o3 min read