Algorithm design patterns
Algorithm design antipatterns
Which problems will we be able to solve in practice?
Working definition: Those with polynomial-time algorithms
Theory: Definition is broad and robust (Turing machine, word RAM, uniform circuits, ...)
Practice: Poly-time algorithms scale to huge problems (constants tend to be small, e.g., \(3N^2\))
Which problems will we be able to solve in practice?
Working definition: Those with polynomial-time algorithms
yes | probably no |
---|---|
shortest path | longest path |
min cut | max cut |
2-satisfiability | 3-satisfiability |
planar 4-colorability | planar 3-colorability |
bipartite vertex cover | vertex cover |
matching | 3D-matching |
primality testing | factoring |
linear programming | integer linear programming |
Desiderata: Classify problems according to those that can be solved in polynomial time and those that cannot.
Example problems requiring (provably) exponential time (at least):
Frustrating news: huge number of fundamental problems have defied classification for decades.
Desiderata': Suppose we could solve problem \(Y\) in polynomial-time. What else could we solve in polynomial time?
Reduction: Problem \(X\) polynomial-time (Turing/Cook) reduces to problem \(Y\) if arbitrary instances of problem \(X\) can be solve using:
Oracle: computational model supplemented by special piece of hardware that solves instances of \(Y\) in a single step
Desiderata': Suppose we could solve problem \(Y\) in polynomial-time. What else could we solve in polynomial time?
Reduction: Problem \(X\) polynomial-time (Turing/Cook) reduces to problem \(Y\) if arbitrary instances of problem \(X\) can be solve using:
Notation: \(X \leq_P Y\)
Note: We pay for time to write down instances of \(Y\) sent to oracle ⇒ instances of \(Y\) must be of polynomial size
Novice mistake: Confusing \(X \leq_P Y\) with \(Y \leq_P X\)
Suppose that \(X \leq_P Y\). Which of the following can we infer?
Which of the following poly-time reductions are known?
Design algorithms: If \(X \leq_P Y\) and \(Y\) can be solved in polynomial time, then \(X\) can be solved in polynomial time
Establish intractibility: If \(X \leq_P Y\) and \(X\) cannot be solved in polynomial time, then \(Y\) cannot be solved in polynomial time
Establish equivalence: If both \(X \leq_P Y\) and \(Y \leq_P X\), we use notation \(X \equiv_P Y\). In this case, \(X\) can be solved in polynomial time iff \(Y\) can be.
Bottom line: Reductions classify problems according to relative difficulty