Seyed Masoud Hosseini · Overview · Study log · Weekly summaries · Ideas · Search · Transcript · RSS feed
Design & Analysis of Algorithms · Lecture 25 of 34 · 1:17:43
18. Complexity: Fixed-Parameter Algorithms
Study guide
What this lecture covers
The lecture asks what to do with an NP-hard problem when you want an exact answer rather than an approximation, and are willing to accept exponential running time as long as the exponential part is confined to a small "parameter" of the input rather than the whole input size. It follows two earlier lectures, one on proving NP-hardness and one on approximation algorithms, and completes the trio of trade-offs: fast, exact, and works on hard problems — pick two.
Using vertex cover as the running example, you'll see how to design algorithms whose running time is polynomial in the input size and exponential only in a parameter k, and why that matters when k is small in practice. After watching, you should be able to define fixed-parameter tractability (FPT), build a bounded search tree algorithm, apply kernelization to shrink an instance before solving it, and connect FPT to approximation schemes from the previous lecture.
Key ideas
- Parameter: a non-negative integer function of the input,
k(x), that measures how hard a particular instance is, such as the target vertex cover size. - Fixed-parameter tractable (FPT): a problem solvable in time
f(k) * poly(n), where the polynomial's exponent does not depend onk. - Bounded search tree: a recursive algorithm that guesses which endpoint of an uncovered edge belongs in the cover, branching into two smaller subproblems each time
kdecreases by one. - Kernelization: a polynomial-time self-reduction that shrinks an instance
(x, k)to an equivalent smaller instance(x', k')whose size depends only onk, not on the original input size. - Multiplicative vs. additive FPT bounds:
f(k) * poly(n)andf(k) + poly(n)are provably equivalent definitions, and both are equivalent to having a kernelization procedure. - High-degree reduction rule: any vertex with degree greater than
kmust belong to the vertex cover, since leaving it out would force more thankneighbors into the cover. - EPTAS and FPT: an optimization problem with an efficient polynomial-time approximation scheme (EPTAS) yields an FPT algorithm for the corresponding decision problem, by running the scheme with
epsilonjust under1/k.
Walkthrough
Defining parameters and parameterized problems (3:03)
The lecture introduces the general idea of a parameter as a non-negative integer function of the input, giving examples like the number of vertices or edges in a graph. It then defines k-vertex cover: the decision version of vertex cover with an explicit bound k, where k itself is the natural parameter. The goal throughout is a running time polynomial in the overall input size but exponential only in k.
Brute force and why it is "bad" (11:20)
A naive algorithm tries all subsets of k vertices, giving a running time around e * V^k. This is classified as bad because the exponent of n depends on k, so the algorithm is not even polynomial for a fixed k in a useful sense — it becomes impractical quickly as k grows.
Bounded search tree algorithm (18:27)
For any uncovered edge (u, v), at least one endpoint must be in the cover, so the algorithm recursively tries both: add u to the cover, delete it and its edges, decrement k, and recurse; then do the same for v. The recursion tree has height k and branches into two children per node, giving O(V * 2^k) time — exponential only in k, linear in the graph otherwise.
Equivalence of multiplicative and additive FPT, and kernelization theory (28:46)
The lecture proves that f(k) * poly(n) and f(k) + poly(n) describe the same class of problems by splitting into the case n <= f(k) and n >= f(k). It then defines kernelization: a polynomial-time procedure that reduces an instance to an equivalent one whose size depends only on k. The lecture proves an FPT algorithm exists if and only if a kernelization procedure exists, using a similar case split and a "timer" trick when f(k) is not known in advance.
Kernelizing vertex cover (48:14)
A sequence of reduction rules simplifies any vertex cover instance: self-loops force their vertex into the cover, multi-edges collapse to a single edge, and any vertex of degree greater than k must be in the cover. After repeatedly applying these, every remaining vertex has degree at most k, so if a cover of size k exists, the number of edges is at most k^2 and, after deleting isolated vertices, the graph has at most 2k^2 vertices. This produces a quadratic-size kernel in polynomial time; if the kernelized graph is larger than 3k^2, the original instance has no cover of size k.
Combining kernelization with the search algorithms (59:29)
Running brute force on the kernelized graph gives roughly 2^k * k^(2k) time; running the bounded search tree on it gives roughly k^2 * 2^k, a significant improvement, since the exponential part is now singly exponential in k. The lecture notes that further published results push the base below 2, but the kernelization-plus-search-tree combination is the practical takeaway.
Connecting fixed-parameter tractability to approximation schemes (1:04:45)
For an optimization problem with integer optimum, converting to the decision question opt <= k and parameterizing by k links back to the previous lecture's approximation schemes. The lecture proves that if a problem has an efficient PTAS (EPTAS), running it with epsilon slightly below 1/k yields an exact FPT algorithm, because the resulting absolute error is provably less than 1 for integers, forcing the approximate value to equal the optimum. This result is most often used in the contrapositive: showing a problem is not FPT implies it has no EPTAS.
Before you watch
- Know the definition of vertex cover and how it was proven NP-hard, and be comfortable with the greedy 2-approximation algorithm from the previous lecture.
- Review the previous lecture's approximation scheme material (PTAS/FPTAS), since the last section builds directly on it.
- Be comfortable with recursion trees and basic asymptotic analysis, since running times are derived by counting nodes in a branching recursion.
Check your understanding
- Why does an
O(e * V^k)running time count as "bad" for fixed-parameter tractability, even though it is polynomial for any single fixed value ofk? - Walk through why any vertex with degree greater than
kmust belong to an optimal vertex cover of size at mostk. - Explain why proving
f(k) * poly(n)running time is equivalent tof(k) + poly(n)running time only requires comparingntof(k). - What does it mean for a kernelization procedure to produce an instance whose size depends only on
k, and why does that make any exact algorithm afterward run in FPT time? - Why does setting
epsilonjust below1/kin an EPTAS turn an approximate solution into an exact one when the optimum is known to be an integer?
Vocabulary
- trade-off (noun)
- A balance where you gain one thing but lose another.
Fast, exact, and works on hard problems is a trade-off: pick two. - NP-hard (adjective)
- So hard that no known algorithm solves it quickly for all cases.
Vertex cover is NP-hard, so we look for a smarter exact approach. - exponential (adjective)
- Growing extremely fast as the input gets bigger, like doubling each step.
Brute force takes exponential time in the parameter k. - confined (adjective)
- Kept limited to one small part instead of spreading everywhere.
The exponential cost is confined to the parameter, not the whole input. - parameter (noun)
- A number describing one specific feature of the input, used to measure difficulty.
The parameter k is the size of the vertex cover we want. - fixed-parameter tractable (adjective)
- Solvable in a time that is polynomial in the input size and only exponential in a small parameter.
Vertex cover is fixed-parameter tractable when k is small. - polynomial (adjective)
- Growing at a moderate, controlled rate as input size increases, like n squared.
The running time is polynomial in n once k is fixed. - vertex cover (noun)
- A set of vertices in a graph that touches every edge.
We want the smallest vertex cover of size at most k. - brute force (noun)
- A simple method that tries every possibility without any shortcuts.
Brute force checks all subsets of k vertices. - bounded search tree (noun)
- A recursive method that branches into a few choices at each step, with a limited depth.
The bounded search tree tries both endpoints of an uncovered edge. - recursion (noun)
- A method where a problem is solved by calling the same method on smaller versions of itself.
The algorithm uses recursion to shrink k by one each time. - branch (verb)
- To split into separate possible paths that are each explored.
At each edge the algorithm branches into two cases. - decrement (verb)
- To reduce a number by a fixed amount, usually one.
Each time we add a vertex to the cover, we decrement k. - kernelization (noun)
- A method that shrinks a problem instance to a smaller equivalent one before solving it.
Kernelization reduces the graph so its size depends only on k. - equivalent (adjective)
- Having the same answer or effect, even if it looks different.
The smaller instance is equivalent to the original problem. - instance (noun)
- One specific example of a problem, with actual input values.
Each graph and target size k is one instance of vertex cover. - reduction rule (noun)
- A step that simplifies a problem by removing or changing part of it, keeping the answer the same.
The high-degree reduction rule forces certain vertices into the cover. - degree (noun)
- The number of edges connected to one vertex in a graph.
Any vertex with degree greater than k must be in the cover. - self-loop (noun)
- An edge that connects a vertex to itself.
A self-loop forces its vertex into the cover. - isolated vertex (noun)
- A vertex with no edges connected to it.
Isolated vertices are deleted since they never need covering. - multiplicative (adjective)
- Combined by multiplying rather than adding.
f(k) times poly(n) is a multiplicative running-time bound. - additive (adjective)
- Combined by adding rather than multiplying.
f(k) plus poly(n) is an additive running-time bound. - contrapositive (noun)
- A logical form that reverses and negates a statement to prove the same fact.
The result is often used in the contrapositive to show a problem is not FPT. - approximation scheme (noun)
- A family of algorithms that can get as close to the optimal answer as you want, at some cost in time.
An efficient approximation scheme can be turned into an exact FPT algorithm. - singly exponential (adjective)
- Growing like a constant raised to the power k, rather than k raised to a growing power.
The combined algorithm's running time is singly exponential in k. - asymptotic (adjective)
- Describing how a quantity behaves as input size grows very large, ignoring small details.
We compare running times using asymptotic analysis. - practical takeaway (phrase)
- The main useful lesson to remember and apply.
The practical takeaway is combining kernelization with the search tree.
From the YouTube description
MIT 6.046J Design and Analysis of Algorithms, Spring 2015
View the complete course: http://ocw.mit.edu/6-046JS15
Instructor: Erik Demaine
In this lecture, Professor Demaine tackles NP-hard problems using fixed-parameter algorithms.
License: Creative Commons BY-NC-SA
More information at http://ocw.mit.edu/terms
More courses at http://ocw.mit.edu
← Lecture 17: Complexity - Approximation Algorithms · R9. Approximation Algorithms: Traveling Salesman Problem →
