A topic in the Open Knowledge Graph — a free, open map of 15,495 topics and the order to learn them in.

Approximation Algorithms (LP Relaxation and Primal-Dual)

Research Depth 115 in the knowledge graph ☐ I know this ☆ Set as goal
5topics build on this
565prerequisites beneath it
See this on the map →
Greedy AlgorithmsLinear Programming Algorithms+2 more→→Algorithmic Game TheoryPCP Theorem and Hardness of Approximation+3 more
approximation-algorithms lp-relaxation primal-dual integrality-gap

Core Idea

Approximation algorithms provide provably near-optimal solutions to NP-hard optimization problems in polynomial time. LP relaxation replaces integer constraints with continuous ones, solves the resulting linear program, and then rounds the fractional solution to an integer solution — the integrality gap bounds the worst-case approximation ratio. The primal-dual method constructs feasible primal and dual solutions simultaneously, using complementary slackness conditions to guide the algorithm and weak duality to prove the approximation guarantee. For vertex cover, LP relaxation yields a 2-approximation (round all variables >= 1/2); for set cover, randomized rounding of the LP relaxation gives an O(log n)-approximation matching the hardness of approximation lower bound. These techniques transform optimization problems into algebraic ones where duality theory provides the performance guarantee.

How It's Best Learned

Write the vertex cover ILP for a small graph, relax it, and solve the LP by inspection. Round at 1/2 and compare the three numbers: LP value, rounded cost and true optimum. Then run the primal-dual algorithm on the same graph, raising edge duals until a vertex goes tight. Seeing both methods produce the same 2-factor bound shows where the guarantee comes from.

Common Misconceptions

Explainer

NP-hardness tells you that finding optimal solutions is (almost certainly) intractable. Approximation algorithms respond by asking: how close to optimal can we get in polynomial time? The answer depends on the problem, and the most powerful tools for both designing approximation algorithms and proving their guarantees come from linear programming duality.

LP relaxation is the most natural approach. Formulate the optimization problem as an integer linear program (ILP), drop the integrality constraints to get a linear program (LP), solve it, and round the fractional solution to an integer one. The LP optimum is a lower bound on the ILP optimum (for minimization), so if rounding increases the cost by at most a factor alpha, you have an alpha-approximation. For vertex cover, the rounding is simple: every vertex with LP value >= 1/2 enters the cover. Every edge is covered (its LP constraint forces at least one endpoint to >= 1/2), and the cost at most doubles. The factor of 2 is tight for this rounding scheme because the LP's integrality gap is exactly 2.

The primal-dual method is more sophisticated and often yields combinatorial algorithms. Instead of solving the LP, you simultaneously construct a feasible primal solution (the approximate answer) and a feasible dual solution (the lower bound certificate). The algorithm typically grows dual variables until some dual constraint becomes tight, then adds the corresponding primal element. Weak duality guarantees that the dual objective is a lower bound on the optimum, so if the primal cost is at most alpha times the dual objective, you have an alpha-approximation. The beauty is that the LP is never solved — it appears only in the proof. This yields fast, combinatorial algorithms with provable guarantees.

The deepest results in approximation algorithms connect the integrality gap of an LP (or SDP) relaxation to the hardness of approximation. The Unique Games Conjecture, if true, implies that for many problems the integrality gap of the natural SDP relaxation exactly characterizes the best achievable approximation ratio. For set cover, the Theta(log n) approximation ratio matches both the LP integrality gap and the hardness lower bound — the LP relaxation captures the problem's approximability perfectly. Understanding these connections between relaxation strength, rounding techniques, and computational hardness is the central project of modern approximation algorithm theory.

Practice Questions 4 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Regular Language Recognition Algorithms → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Context-Free Grammar Properties and Ambiguity → Parse Trees, Derivations, and Ambiguity in CFGs → Context-Free Grammars in Compiler Design → Abstract Syntax Trees (ASTs) → Symbol Tables and Scope Resolution → Semantic Analysis Phase → Scope and Binding Resolution → Scope, Shadowing, and Variable Lifetime → Parameter Passing: Value vs. Reference → Two-Dimensional Arrays → Graph Representations: Adjacency List vs. Adjacency Matrix → Depth-First Search (DFS) → Depth-First Search: Implementation and Applications → Topological Sort → Dynamic Programming → Longest Common Subsequence (LCS) Problem → Edit Distance: Levenshtein Distance and DP → 0/1 Knapsack Problem: Bounded Capacity DP → Greedy Algorithms → Approximation Algorithms and Approximation Ratios → Hardness of Approximation → Approximation Algorithms (LP Relaxation and Primal-Dual)

Longest path: 116 steps · 565 total prerequisite topics

Prerequisites (4)

Leads To (5)