Algorithm II
8. Intractability II
WU Xiaokun 吴晓堃
xkun.wu [at] gmail
Decision problem.
A(s) = \left\{ \begin{array}{ll} yes & \text{if}\ s \in X \\ no & \text{if}\ s \notin X \\ \end{array}\right.
Def. Algorithm A runs in polynomial time if for every string s, A(s) terminates in \le p(|s|) “steps,” where p(\cdot) is some polynomial function.
Def. \mathcal{P} = set of decision problems for which there exists a poly-time algorithm.
Ex. PRIMES
\mathcal{P}. Decision problems for which there exists a poly-time algorithm.
Def. Algorithm C(s, t) is a certifier for problem X if for every string s: s \in X iff there exists a string t such that C(s, t) = yes.
Def. \mathcal{NP} = set of decision problems for which there exists a poly-time certifier.
Ex. COMPOSITES
SAT. Given a CNF formula \Phi, does it have a satisfying truth assignment?
3-SAT. SAT where each clause contains exactly 3 literals.
Certificate. An assignment of truth values to the Boolean variables.
Certifier. Check that each clause in \Phi has at least one true literal.
Ex.
Conclusions. SAT \in \mathcal{NP}, 3-SAT \in \mathcal{NP}.
HAMILTON-PATH. Given an undirected graph G = (V, E), does there exist a simple path P that visits every node?
Certificate. A permutation \pi of the n nodes.
Certifier. Check that \pi contains each node in V exactly once, and that G contains an edge between each pair of adjacent nodes.
Conclusion. HAMILTON-PATH \in \mathcal{NP}.
\mathcal{NP}. Decision problems for which there exists a poly-time certifier.
\mathcal{P}.
Decision problems for which there exists a poly-time algorithm.
\mathcal{NP}. Decision
problems for which there exists a poly-time certifier.
\mathcal{EXP}.
Decision problems for which there exists an exponential-time
algorithm.
Proposition. \mathcal{P}
\subseteq \mathcal{NP}.
Pf. Consider any problem X
\in \mathcal{P}.
Proposition. \mathcal{NP}
\subseteq \mathcal{EXP}.
Pf. Consider any problem X
\in \mathcal{NP}.
\mathcal{P}.
Decision problems for which there exists a poly-time algorithm.
\mathcal{NP}. Decision
problems for which there exists a poly-time certifier.
\mathcal{EXP}.
Decision problems for which there exists an exponential-time
algorithm.
Proposition. \mathcal{P}
\subseteq \mathcal{NP}.
Proposition. \mathcal{NP}
\subseteq \mathcal{EXP}.
Fact. \mathcal{P} \ne \mathcal{EXP} \Rightarrow either \mathcal{P} \ne \mathcal{NP}, or \mathcal{NP} \ne \mathcal{EXP}, or both.
Q. How to solve an instance of 3-SAT with n variables?
A. Exhaustive search: try all 2^n truth assignments.
Q. Can we do anything substantially more
clever?
Conjecture. No poly-time algorithm (ie.
intractable) for 3-SAT.
Does \mathcal{P} = \mathcal{NP}? [Cook 1971, Edmonds, Levin, Yablonski, Gödel] Is the decision problem as easy as the certification problem?
Consensus opinion. Probably no.
I conjecture that there is no good algorithm for the traveling salesman problem. My reasons are the same as for any mathematical conjecture: (i) It is a legitimate mathematical possibility and (ii) I do not know. — Jack Edmonds 1966
In my view, there is no way to even make intelligent guesses about the answer to any of these questions. If I had to bet now, I would bet that \mathcal{P} is not equal to \mathcal{NP}. I estimate the half-life of this problem at 25-50 more years, but I wouldn’t bet on it being solved before 2100. — Bob Tarjan (2002)
We seem to be missing even the most basic understanding of the nature of its difficulty…. All approaches tried so far probably (in some cases, provably) have failed. In this sense \mathcal{P} = \mathcal{NP} is different from many other major mathematical problems on which a gradual progress was being constantly done (sometimes for centuries) whereupon they yielded, either completely or partially. — Alexander Razborov (2002)
I think that in this respect I am on the loony fringe of the mathematical community: I think (not too strongly!) that \mathcal{P} = \mathcal{NP} and this will be proved within twenty years. Some years ago, Charles Read and I worked on it quite bit, and we even had a celebratory dinner in a good restaurant before we found an absolutely fatal mistake. — Béla Bollobás (2002)
In my opinion this shouldn’t really be a hard problem; it’s just that we came late to this theory, and haven’t yet developed any techniques for proving computations to be hard. Eventually, it will just be a footnote in the books. ” — John Conway
\mathcal{P} = \mathcal{NP}, but only
Ω(n^{100}) algorithm for 3-SAT.
\mathcal{P} \ne \mathcal{NP}, but with
O(n \log^\ast n) algorithm for
3-SAT.
\mathcal{P} = \mathcal{NP} is
independent (of ZFC axiomatic set theory).
It will be solved by either 2048 or 4096. I am currently somewhat pessimistic. The outcome will be the truly worst case scenario: namely that someone will prove \mathcal{P} = \mathcal{NP} because there are only finitely many obstructions to the opposite hypothesis; hence there exists a polynomial time solution to SAT but we will never know its complexity! — Donald Knuth
Millennium prize. $1 million for resolution of \mathcal{P} \ne \mathcal{NP} problem.
binary | ASCII | char |
---|---|---|
1010000 | 80 | P |
0111101 | 61 | = |
1001110 | 78 | N |
1010000 | 80 | P |
0111111 | 63 | ? |
Def. Problem X polynomial (Cook) reduces to problem Y if arbitrary instances of problem X can be solved using:
Def. Problem X polynomial (Karp) transforms to problem Y if given any instance x of X, we can construct an instance y of Y such that x is a yes instance of X iff y is a yes instance of Y.
Note. Polynomial transformation is polynomial reduction with just one call to oracle for Y, exactly at the end of the algorithm for X. Almost all previous reductions were of this form.
Open question. Are these two concepts the same with respect to \mathcal{NP}?
\mathcal{NP}-complete. A problem Y \in \mathcal{NP} with the property that for every problem X \in \mathcal{NP}, X \le_P Y.
Proposition. Suppose Y
\in \mathcal{NP}-complete. Then,
Y \in \mathcal{P} iff \mathcal{P} = \mathcal{NP}.
Pf. \Leftarrow If
\mathcal{P} = \mathcal{NP}, then Y \in \mathcal{P} because Y \in \mathcal{NP}.
Pf. \Rightarrow
Suppose Y \in \mathcal{P}.
Fundamental question. Are there any “natural” \mathcal{NP}-complete problems?
Theorem. [Cook 1971, Levin 1973] CIRCUIT-SAT \in \mathcal{NP}-complete.
Remark. Once we establish first “natural” \mathcal{NP}-complete problem, others fall like dominoes.
Recipe. To prove that Y \in \mathcal{NP}-complete:
Proposition. If X
\in \mathcal{NP}-complete, Y \in \mathcal{NP}, and X \le_P Y, then Y
\in \mathcal{NP}-complete.
Pf. Consider any problem W
\in \mathcal{NP}. Then, both W \le_P
X and X \le_P Y.
Suppose that X \in \mathcal{NP}-complete, Y \in \mathcal{NP}, and X \le_P Y. Which can you infer?
A. Y is \mathcal{NP}-complete.
B. If Y \notin
\mathcal{P}, then \mathcal{P} \ne
\mathcal{NP}.
C. If \mathcal{P} \ne
\mathcal{NP}, then neither X nor
Y is in \mathcal{P}.
D. All of the above.
Basic genres of \mathcal{NP}-complete problems and paradigmatic examples.
Practice. Most \mathcal{NP} problems are known to be either in \mathcal{P} or \mathcal{NP}-complete.
\mathcal{NP}-intermediate? FACTOR, DISCRETE-LOG, GRAPH-ISOMORPHISM, etc.
Theorem. [Ladner 1975] Unless \mathcal{P} = \mathcal{NP}, there exist problems in \mathcal{NP} that are neither in \mathcal{P} nor \mathcal{NP}-complete.
Garey and Johnson. Computers and Intractability.
Asymmetry of \mathcal{NP}. We need short certificates only for yes instances.
Ex 1. SAT vs. UN-SAT.
SAT. Given a CNF formula Φ, is there a satisfying truth assignment?
UN-SAT. Given a CNF formula Φ, is there no satisfying truth assignment?
Asymmetry of \mathcal{NP}. We need short certificates only for yes instances.
Ex 2. HAM-CYCLE vs. NO-HAM-CYCLE.
HAM-CYCLE. Given a graph G = (V, E), is there a simple cycle Γ that contains every node in V?
NO-HAM-CYCLE. Given a graph G = (V, E), is there no simple cycle Γ that contains every node in V?
Asymmetry of \mathcal{NP}. We need short certificates only for yes instances.
Q. How to classify UN-SAT and NO-HAM-CYCLE?
\mathcal{NP}.
Decision problems for which there is a poly-time certifier.
Ex. SAT, HAM-CYCLE, and COMPOSITES.
Def. Given a decision problem X, its complement \bar{X} is the same problem with yes and no answers reversed.
Ex. X = \{ 4, 6, 8, 9, 10, 12, 14, 15, … \}
\text{co-}NP.
Complements of decision problems in \mathcal{NP}.
Ex. UN-SAT, NO-HAM-CYCLE, and PRIMES.
Fundamental open question. Does \mathcal{NP} = \text{co-}NP?
Theorem. If \mathcal{NP}
\ne \text{co-}NP, then \mathcal{P} \ne
\mathcal{NP}.
Pf idea.
Good characterization. [Edmonds 1965] \mathcal{NP} \cap \text{co-}NP.
Ex. Given a bipartite graph, is there a perfect matching?
Observation. \mathcal{P} ⊆ \mathcal{NP} \cap \text{co-}NP.
Fundamental open question. Does \mathcal{P} = \mathcal{NP} \cap \text{co-}NP?
LINEAR-PROGRAMMING. Given A \in \Re^{m \times n}, b \in \Re^m, c \in \Re^n, and \alpha \in \Re, does there exist x \in \Re^n such that Ax \le b, x \ge 0 and cT x \ge \alpha?
Theorem. [Gale-Kuhn-Tucker 1948] LINEAR-PROGRAMMING
\in \mathcal{NP} \cap
\text{co-}NP.
Pf sketch. If (P) and (D) are nonempty, then
max
= min
.
\begin{aligned} \text{(Primary)} \max c^Tx && \\ \text{s.t.} && Ax & \le b \\ && x & \ge 0 \\ \end{aligned}
\begin{aligned} \text{(Dual)} \min y^Tb && \\ \text{s.t.} && A^Ty & \ge c \\ && y & \ge 0 \\ \end{aligned}
Theorem. [Khachiyan 1979] LINEAR-PROGRAMMING \in \mathcal{P}.
Theorem. [Pratt 1975] PRIMES \in \mathcal{NP} \cap \text{co-}NP.
Pf sketch. An odd integer s is prime iff there exists an integer 1 < t < s s.t.
\begin{aligned} t^{s-1} & \equiv 1 \pmod{s} \\ t^{\frac{s-1}{p}} & \ne 1 \pmod{s} \\ \end{aligned}
for all prime divisors p of s-1.
CERTIFIER
(s)
CHECK s - 1 = 2 \times 2 \times 3 \times
36473.
CHECK 17^{s-1} = 1 \pmod{s}.
CHECK 17^{(s-1) / 2} \equiv 437676
\pmod{s}.
CHECK 17^{(s-1) / 3} \equiv 329415
\pmod{s}.
CHECK 17^{(s-1) / 36,473} \equiv 305452
\pmod{s}.
Theorem. [Agrawal-Kayal-Saxena 2004] PRIMES \in \mathcal{P}.
FACTORIZE. Given an integer x, find its prime
factorization.
FACTOR. Given two integers x and y,
does x have a nontrivial factor <
y?
Theorem. FACTOR \equiv_P FACTORIZE.
Pf.
Theorem. FACTOR \in
\mathcal{NP} \cap \text{co-}NP.
Pf.
Fundamental question. Is FACTOR \in \mathcal{P}?
Challenge. [RSA-704] Factor this number.
74037563479561712828046796097429573142593188889231289\\ 08493623263897276503402826627689199641962511784399589\\ 43305021275853701189680982867331732731089309005525051\\ 16877063299072396380786710086096962537934650563796359\\
($30,000 prize if you can factor)
Modern cryptography.
RSA. Based on dichotomy between complexity of two problems.
Theorem. [Shor 1994] Can factor an n-bit integer in O(n^3) steps on a “quantum computer.”
2001. Factored 15 = 3
\times 5 (with high probability) on a quantum computer.
2012. Factored 21 = 3 \times
7.
Fundamental question. Does \mathcal{P} = \mathcal{BQP}?
A Terminological Proposal. [Knuth 1974]
I needed an adjective to convey such a degree of difficulty, both formally and informally; … The goal is to find an adjective
x
that sounds good in sentences like this:
- The covering problem is
x
.- It is
x
to decide whether a given graph has a Hamiltonian circuit.- It is unknown whether or not primality testing ia an
x
problem.
Note. The term x
does not necessarily
imply that a problem is in \mathcal{NP}, just that every problem in
\mathcal{NP} poly-time reduces to
x
.
Knuth’s original suggestions.
Some English word write-ins.
Hard-boiled. [Ken Steiglitz] In honor of Cook.
Hard-ass. [Al Meyer] Hard AS Satisfiability.
Sisyphean. [Bob Floyd] Problem of Sisyphus was time-consuming.
Ulyssean. [Donald Knuth] Ulysses was known for his persistence.
“ creative research workers are as full of ideas for new terminology as they are empty of enthusiasm for adopting it. ” — Donald Knuth
PET. [Shen Lin] Probably Exponential Time.
GNP. [Al Meyer] Greater than or equal to \mathcal{NP} in difficulty.
Exparent. [Mike Paterson] Exponential + apparent.
Perarduous. [Mike Paterson] Throughout (in space or time) + completely.
Supersat. [Al Meyer] Greater than or equal to satisfiability.
Polychronious. [Ed Reingold] Enduringly long; chronic.
\mathcal{NP}-complete. A problem in \mathcal{NP} such that every problem in \mathcal{NP} poly-time reduces to it.
\mathcal{NP}-hard.
[Bell Labs, Steve Cook, Ron Rivest, Sartaj Sahni]
A problem such that every problem in \mathcal{NP} poly-time reduces to it.
“If the Martians know that \mathcal{P} = \mathcal{NP} for Turing Machines and they kidnap me, I would lose face calling these problems ‘formidable’.” — Vaughan Pratt.