Advanced Topic 47 of 51 Algorithms
Approximation Algorithms
Methods guaranteeing near-optimal answers to hard problems.
How it works
Approximation algorithms give provably near-optimal solutions to NP-hard optimization problems in polynomial time. Their quality is measured by an approximation ratio, the worst-case factor between the returned value and the true optimum. For example, a simple algorithm gives a 2-approximation for vertex cover, and Christofides gives 1.5 for metric traveling salesman. Some problems have approximation schemes, and others cannot be approximated well unless P equals NP.
Step-by-step walkthrough
- The exact problem is NP-hard, so no fast exact method is known.
- A polynomial-time algorithm gives an answer quickly.
- The answer is provably within a factor of the optimal, such as at most twice.
- Vertex cover by taking both ends of maximal matching edges is a 2-approximation.
- The guarantee holds for every input.
Where it is used
Network design, scheduling, facility location, vertex cover, set cover and routing logistics where exact solutions are too slow use approximation algorithms.
Common pitfall
The worst-case ratio may be far from the typical case, and heuristics without guarantees can be much worse. Some practical solvers beat theoretical ratios. Be careful with minimization versus maximization when stating ratios. Verify that the problem structure, such as the triangle inequality, is satisfied.
Where it fits in the course
Approximation Algorithms is topic 47 of 51 in Algorithms, rated Advanced. It follows Randomized Algorithms. The next topic is Amortized Analysis.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Algorithms quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Algorithms quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Approximation Algorithms?
Where do people use Approximation Algorithms?
What is the most common mistake with Approximation Algorithms?
What should I learn before this topic?
How can I practice it?
Is Approximation Algorithms hard to learn?
How long does it take to learn Approximation Algorithms?
Which topics are related to Approximation Algorithms?
What should I study after Approximation Algorithms?
Related topics
- Randomized Algorithms (Algorithms)
- Amortized Analysis (Algorithms)
- Huffman Coding (Algorithms)
- Convex Hull (Algorithms)
- Line Drawing Algorithms (Graphics, Vision & Media)
- Load Balancing Algorithms (Distributed Systems & Cloud)
- Wait-Free Algorithms (Concurrency & Parallelism)