Parameterized Algorithms
744 words
4 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Parameterized Algorithms ## 🎯 Learning Objectives - Explain fixed-parameter tractability (FPT) - Design bounded search tree algorithms - Apply kernelization techniques - Understand the W-hierarchy - Identify FPT vs. W-hard problems * * * ## 1.

Parameterized Algorithms
🎯 Learning Objectives
- Explain fixed-parameter tractability (FPT)
- Design bounded search tree algorithms
- Apply kernelization techniques
- Understand the W-hierarchy
- Identify FPT vs. W-hard problems
1. Parameterized Complexity
1.1 Intuition
Some NP-hard problems are "easy" when a parameter is small. For example, finding a vertex cover of size k: brute force over C(n,k) subsets is O(nk), but with parameterized techniques it's O(2kn) — exponential only in k, not n.
1.2 Definitions
| Concept | Meaning | Example |
|---|---|---|
| FPT | O(f(k)⋅nO(1)) | Vertex cover: O(2kn) |
| XP | O(nf(k)) | Clique: O(nk) |
| Kernel | Reduction to size f(k) | Vertex cover: O(k2) kernel |
| W[1]-hard | Unlikely FPT | Clique, Independent Set |
2. Vertex Cover (Bounded Search Tree)
2.1 Algorithm
pythondef vertex_cover(G, k): if k < 0: return None if not G.edges(): return set() (u, v) = any edge in G # Branch: either u or v must be in the cover result1 = vertex_cover(G - {u}, k-1) if result1 is not None: return result1 ∪ {u} result2 = vertex_cover(G - {v}, k-1) if result2 is not None: return result2 ∪ {v} return None
Branching factor: 2, Depth: k, Time: O(2kn)
2.2 Kernelization
Buss kernel: Remove isolated vertices, degree > k vertices must be in cover. Remaining graph has ≤ k2 edges.
- Remove isolated vertices (degree 0)
- If any vertex has degree > k, include it in cover, decrease k
- If remaining graph has > k2 edges, reject (more than k2 edges needs > k vertices)
- Kernel size: O(k2)
3. Feedback Vertex Set (FVS)
3.1 Problem
Remove ≤ k vertices to make graph acyclic.
3.2 FPT Algorithm
- Branch on vertices in cycles
- Use iterative compression technique
- Running time: O(5knO(1))
4. The W-Hierarchy
FPT⊆W[1]⊆W[2]⊆...⊆XP| Problem | Class | Status |
|---|---|---|
| Vertex Cover | FPT | O(1.618k+n) |
| Feedback Vertex Set | FPT | O(5kn) |
| k-Path (path of length k) | FPT | O(2O(k)n) |
| Clique | W[1]-complete | FPT unlikely |
| Dominating Set | W[2]-complete | FPT unlikely |
5. Common Pitfalls
Pitfall: Confusing XP with FPT
The mistake: Thinking O(nk) (XP) is FPT.
Correct approach: FPT requires k only in the exponent's base (O(f(k)n)), not in the exponent of n (O(nk)). For k=10, FPT = O(210n)=O(1024n), XP = O(n10).
6. Key Concepts Reference
| Technique | Time Complexity | Application |
|---|---|---|
| Bounded search tree | O(f(k)⋅n) | Vertex cover, SAT |
| Kernelization | Reduce to O(f(k)) size | VC kernel: O(k2) |
| Color coding | Color vertices randomly | k-Path detection |
| Iterative compression | Add vertices one by one | FVS, odd cycle transversal |
| Treewidth | Parameterize by treewidth | Many problems on bounded treewidth |
7. 📝 Practice Questions
Q1: Run vertex cover search tree on a triangle graph with k=2.Answer: Pick edge (a,b):
- Branch 1: Include a, recurse on {b,c} with k=1. Pick edge (b,c). Include b (k=0, no edges = valid). Cover: {a,b}.
- Branch 2: Include b, recurse on {a,c} with k=1. Pick edge (a,c). Include a (k=0). Cover: {b,a} = same. Q2: Explain the Buss kernel for vertex cover.
Answer: (1) Remove isolated vertices (degree 0 — never needed). (2) If any vertex has degree > k, it MUST be in any k-cover (if not, its k+1 neighbors need k+1 vertices to cover). Add it to cover, reduce k by 1. (3) After removing high-degree vertices, remaining max degree ≤ k, so max edges = n*k/2. But we can bound n ≤ k²+k (since otherwise > k² edges). Kernel size: O(k²) vertices and edges. Q3: Why is Clique not believed to be FPT?Answer: Clique is W[1]-complete. If Clique ∈ FPT, then W[1] = FPT, which would mean all W[1]-hard problems (Independent Set, Partial Vertex Cover) are FPT — widely considered unlikely. The hardness comes from the parameter k being in the exponent of n in the naive O(nk) brute force, and no f(k)nO(1) algorithm is known. Q4: What is the bounded search tree technique?Answer: At each step, identify a structure (edge, cycle, formula clause) that requires branching into 2+ cases. Each branch reduces the parameter k. The tree depth is at most k, branching factor b, so total nodes ≤ b^k. If each node processes in polynomial time, total = O(b^k × n^{O(1)}).
8. 🔗 Cross-References
- Week 6 - NP-Completeness: Why parameterization helps
- Week 11 - Kernelization: Kernelization details
- BSCS4020 (DSA): Graph algorithms Join Discord PreviousOnline & ParallelNextKernelization