Classify problems according to computational requirements
Intractability
Q. Which problems will we be able to solve in practice?
P,NP,NP-Complete
A working definition. Those with polynomial-time algorithms.
Tyler Moore
CS 2123, The University of Tulsa
von Neumann
(1953)
Nash
(1955)
Gödel
(1956)
Cobham
(1964)
Edmonds
(1965)
Rabin
(1966)
Some slides created by or adapted from Dr. Kevin Wayne. For more information see
http://www.cs.princeton.edu/~wayne/kleinberg-tardos. Some code reused from Python Algorithms by Magnus Lie
Theory. Definition is broad and robust.
Hetland.
constants a and b tend to be small, e.g., 3 N 2
Practice. Poly-time algorithms scale to huge problems.
4
2 / 48
Classify problems according to computational requirements
Classify problems
Q. Which problems will we be able to solve in practice?
Desiderata. Classify problems according to those that can be solved in
polynomial time and those that cannot.
A working definition. Those with polynomial-time algorithms.
input size = c + lg k
Provably requires exponential time.
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
・Given a constant-size program, does it halt in at most k steps?
・Given a board position in an n-by-n generalization of checkers,
can black guarantee a win?
using forced capture rule
Frustrating news. Huge number of fundamental problems have defied
classification for decades.
5
6
3 / 48
4 / 48
Polynomial-time reductions
Polynomial-time reductions
Desiderata'. Suppose we could solve X in polynomial-time.
Desiderata'. Suppose we could solve X in polynomial-time.
What else could we solve in polynomial time?
What else could we solve in polynomial time?
Reduction. Problem X polynomial-time (Cook) reduces to problem Y if
Reduction. Problem X polynomial-time (Cook) reduces to problem Y if
arbitrary instances of problem X can be solved using:
arbitrary instances of problem X can be solved using:
・Polynomial number of standard computational steps, plus
・Polynomial number of calls to oracle that solves problem Y.
・Polynomial number of standard computational steps, plus
・Polynomial number of calls to oracle that solves problem Y.
computational model supplemented by special piece
of hardware that solves instances of Y in a single step
Notation. X ≤ P Y.
Note. We pay for time to write down instances sent to oracle ⇒
Algorithm
for Y
instance I
(of X)
instances of Y must be of polynomial size.
solution S to I
Caveat. Don't mistake X ≤ P Y with Y ≤ P X.
Algorithm for X
7
8
5 / 48
6 / 48
Polynomial-time reductions
Independent set
Design algorithms. If X ≤ P Y and Y can be solved in polynomial time,
INDEPENDENT-SET. Given a graph G = (V, E) and an integer k, is there a subset
then X can be solved in polynomial time.
of vertices S ⊆ V such that | S | ≥ k, and for each edge at most one of its
endpoints is in S ?
Establish intractability. If X ≤ P Y and X cannot be solved in polynomial time,
then Y cannot be solved in polynomial time.
Ex. Is there an independent set of size ≥ 6 ?
Ex. Is there an independent set of size ≥ 7 ?
Establish equivalence. If both X ≤ P Y and Y ≤ P X, we use notation X ≡ P Y.
In this case, X can be solved in polynomial time iff Y can be.
independent set of size 6
Bottom line. Reductions classify problems according to relative difficulty.
9
11
7 / 48
8 / 48
Vertex cover
Vertex cover and independent set reduce to one another
VERTEX-COVER. Given a graph G = (V, E) and an integer k, is there a subset of
Theorem. VERTEX-COVER ≡P INDEPENDENT-SET.
vertices S ⊆ V such that | S | ≤ k, and for each edge, at least one of its
Pf. We show S is an independent set of size k iff V − S is a vertex cover
endpoints is in S ?
of size n – k.
Ex. Is there a vertex cover of size ≤ 4 ?
Ex. Is there a vertex cover of size ≤ 3 ?
independent set of size 6
independent set of size 6
vertex cover of size 4
vertex cover of size 4
12
13
9 / 48
10 / 48
Set cover
Vertex cover reduces to set cover
SET-COVER. Given a set U of elements, a collection S1, S2, …, Sm of subsets of
Theorem. VERTEX-COVER ≤ P SET-COVER.
U, and an integer k, does there exist a collection of ≤ k of these sets whose
Pf. Given a VERTEX-COVER instance G = (V, E), we construct a SET-COVER
union is equal to U ?
instance (U, S) that has a set cover of size k iff G has a vertex cover of size k.
Sample application.
Construction.
・m available pieces of software.
・Set U of n capabilities that we would like our system to have.
・The ith piece of software provides the set Si ⊆ U of capabilities.
・Goal: achieve all n capabilities using fewest pieces of software.
・Universe U = E.
・Include one set for each node v ∈ V :
a
S2 = { 3, 4, 5, 6 }
S3 = { 1 }
b
e7
U = { 1, 2, 3, 4, 5, 6, 7 }
S1 = { 3, 7 } S4 = { 2, 4 }
e2
S6 = { 1, 2, 6, 7 }
k=2
c
16
11 / 48
Sc = { 3, 4, 5, 6 }
Sd = { 5 }
Se = { 1 }
Sf = { 1, 2, 6, 7 }
d
vertex cover instance
(k = 2)
a set cover instance
U = { 1, 2, 3, 4, 5, 6, 7 }
Sa = { 3, 7 } Sb = { 2, 4 }
e4
e5
e1
e
k=2
e3
e6
f
S5 = { 5 }
Sv = {e ∈ E : e incident to v }.
set cover instance
(k = 2)
17
12 / 48
Vertex cover reduces to set cover
Vertex cover reduces to set cover
Lemma. G = (V, E) contains a vertex cover of size k iff (U, S) contains a set
Lemma. G = (V, E) contains a vertex cover of size k iff (U, S) contains a set
cover of size k.
cover of size k.
Pf. ⇒ Let X ⊆ V be a vertex cover of size k in G.
・Then Y = { Sv : v ∈ X } is a set cover of size k.
a
・Then X = { v : Sv ∈ Y } is a vertex cover of size k in G. ▪
b
e7
e2
e3
a
U = { 1, 2, 3, 4, 5, 6, 7 }
Sa = { 3, 7 } Sb = { 2, 4 }
e4
e6
f
k=2
Pf. ⇐ Let Y ⊆ S be a set cover of size k in (U, S).
▪
c
Sc = { 3, 4, 5, 6 }
e5
e1
Se = { 1 }
e7
e2
Sf = { 1, 2, 6, 7 }
e3
Sc = { 3, 4, 5, 6 }
Sd = { 5 }
Se = { 1 }
Sf = { 1, 2, 6, 7 }
vertex cover instance
(k = 2)
set cover instance
(k = 2)
d
e
vertex cover instance
(k = 2)
c
e5
e1
k=2
U = { 1, 2, 3, 4, 5, 6, 7 }
Sa = { 3, 7 } Sb = { 2, 4 }
e4
e6
f
Sd = { 5 }
d
e
b
set cover instance
(k = 2)
18
19
13 / 48
14 / 48
Satisfiability
3-satisfiability reduces to independent set
Literal. A boolean variable or its negation.
xi or xi
Clause. A disjunction of literals.
C j = x1 ∨ x2 ∨ x3
Theorem. 3-SAT ≤ P INDEPENDENT-SET.
Pf. Given an instance Φ of 3-SAT, we construct an instance (G, k) of
INDEPENDENT-SET that has an independent set of size k iff Φ is satisfiable.
€
Conjunctive normal form. A propositional
Construction.
Φ = C1 ∧ C2 ∧ C3 ∧ C4
・G contains 3 nodes for each clause, one for each literal.
・Connect 3 literals in a clause in a triangle.
・Connect literal to each of its negations.
formula Φ that is the conjunction of clauses. €
SAT. Given CNF formula Φ, does it have a satisfying
truth assignment?
€
3-SAT. SAT where each clause contains exactly 3 literals
(and each literal corresponds to a different variable).
Φ =
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 4 )
G
yes instance: x1 = true, x2 = true, x3 = false, x4 = false
€
Key application. Electronic design automation (EDA).
k=3
Φ =
21
15 / 48
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 4 )
22
16 / 48
€
3-satisfiability reduces to independent set
Review
Lemma. G contains independent set of size k = | Φ | iff Φ is satisfiable.
Basic reduction strategies.
・Simple equivalence: INDEPENDENT-SET ≡ P VERTEX-COVER.
・Special case to general case: VERTEX-COVER ≤ P SET-COVER.
・Encoding with gadgets: 3-SAT ≤ P INDEPENDENT-SET.
Pf. ⇒ Let S be independent set of size k.
・S must contain exactly one node in each triangle.
・Set these literals to true (and remaining variables consistently).
・Truth assignment is consistent and all clauses are satisfied.
Transitivity. If X ≤ P Y and Y ≤ P Z, then X ≤ P Z.
Pf ⇐ Given satisfying assignment, select one true literal from each
Pf idea. Compose the two algorithms.
triangle. This is an independent set of size k. ▪
Ex. 3-SAT ≤ P INDEPENDENT-SET ≤ P VERTEX-COVER ≤ P SET-COVER.
G
k=3
Φ =
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 4 )
23
24
17 / 48
18 / 48
€
Polynomial-time reductions
constraint satisfaction
8. I NTRACTABILITY II
3-SAT
es
uc
ed
e r SET
im ENTt
D
ly
po EPEN
T
SA ND
3- to I
‣ P vs. NP
‣ NP-complete
‣ co-NP
INDEPENDENT-SET
DIR-HAM-CYCLE
GRAPH-3-COLOR
SUBSET-SUM
VERTEX-COVER
HAM-CYCLE
PLANAR-3-COLOR
SCHEDULING
‣ NP-hard
SECTION 8.3
SET-COVER
packing and covering
TSP
sequencing
partitioning
numerical
75
19 / 48
20 / 48
Decision problems
Definition of P
Decision problem.
P. Decision problems for which there is a poly-time algorithm.
・Problem X is a set of strings.
・Instance s is one string.
・Algorithm A solves problem X:
A(s) = yes iff s ∈ X.
Def. Algorithm A runs in polynomial time if for every string s, A(s)
terminates in at most p( | s | ) "steps", where p(⋅) is some polynomial.
Problem
Description
Algorithm
yes
no
MULTIPLE
Is x a multiple of y ?
grade-school division
51, 17
51, 16
REL-PRIME
Are x and y relatively prime ?
Euclid (300 BCE)
34, 39
34, 51
PRIMES
Is x prime ?
AKS (2002)
53
51
EDIT-DISTANCE
Is the edit distance between
x and y less than 5 ?
dynamic
programming
niether
neither
acgggt
ttttta
L-SOLVE
Is there a vector x that
satisfies Ax = b ?
Gauss-Edmonds
elimination
⎡ 0 1 1⎤ ⎡ 4 ⎤
⎢
⎥ ⎢ ⎥
⎢ 2 4 −2 ⎥ , ⎢ 2 ⎥
⎣⎢ 0 3 15 ⎥⎦ ⎣⎢36 ⎥⎦
⎡ 1 0 0 ⎤ ⎡1⎤
⎢
⎥ ⎢ ⎥
⎢ 1 1 1⎥ , ⎢1⎥
⎣⎢0 1 1⎥⎦ ⎣⎢1⎥⎦
ST-CONN
Is there a path between s
and t in a graph G ?
depth-first search
€
(Theseus)
length of s
Ex.
・Problem PRIMES = { 2, 3, 5, 7, 11, 13, 17, 23, 29, 31, 37, …. }.
・Instance s = 592335744548702854681.
・AKS algorithm PRIMES in O( | s | 8 ) steps.
€
5
3
21 / 48
22 / 48
NP
Certifiers and certificates: composite
Certification algorithm intuition.
COMPOSITES. Given an integer s, is s composite?
・Certifier views things from "managerial" viewpoint.
・Certifier doesn't determine whether s ∈ X on its own;
Certificate. A nontrivial factor t of s. Such a certificate exists iff s is
rather, it checks a proposed proof t that s ∈ X.
composite. Moreover | t | ≤ | s |.
Def. Algorithm C(s, t) is a certifier for problem X if for every string s,
Certifier. Check that 1 < t < s and that s is a multiple of t.
s ∈ X iff there exists a string t such that C(s, t) = yes.
"certificate" or "witness"
instance s
Def. NP is the set of problems for which there exists a poly-time certifier.
・C(s, t) is a poly-time algorithm.
・Certificate t is of polynomial size:
certificate t
437669
541 or 809
437,669 = 541 × 809
| t | ≤ p( | s | ) for some polynomial p(⋅)
Remark. NP stands for nondeterministic polynomial time.
Conclusion. COMPOSITES ∈ NP.
6
7
23 / 48
24 / 48
Certifiers and certificates: 3-satisfiability
Certifiers and certificates: Hamilton path
3-SAT. Given a CNF formula Φ, is there a satisfying assignment?
HAM-PATH. Given an undirected graph G = (V, E), does there exist a simple
path P that visits every node?
Certificate. An assignment of truth values to the n boolean variables.
Certificate. A permutation of the n nodes.
Certifier. Check that each clause in Φ has at least one true literal.
Certifier. Check that the permutation contains each node in V exactly once,
and that there is an edge between each pair of adjacent nodes.
instance s
certificate t
Φ =
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 3 ) ∧
( x1
∨ x2 ∨ x 4 )
x1 = true, x2 = true, x3 = false, x4 = false
€
certificate t
instance s
Conclusion. 3-SAT ∈ NP.
Conclusion. HAM-PATH ∈ NP.
8
9
25 / 48
26 / 48
Definition of NP
Definition of NP
NP. Decision problems for which there is a poly-time certifier.
NP. Decision problems for which there is a poly-time certifier.
Problem
L-SOLVE
Description
Algorithm
yes
no
Is there a vector x that
satisfies Ax = b ?
Gauss-Edmonds
elimination
⎡ 0 1 1⎤ ⎡ 4 ⎤
⎢
⎥ ⎢ ⎥
⎢ 2 4 −2 ⎥ , ⎢ 2 ⎥
⎢⎣ 0 3 15 ⎥⎦ ⎢⎣36 ⎥⎦
⎡ 1 0 0 ⎤ ⎡1⎤
⎢
⎥ ⎢ ⎥
⎢ 1 1 1⎥ , ⎢1⎥
⎢⎣0 1 1⎥⎦ ⎢⎣1⎥⎦
Is x composite ?
AKS (2002)
“ NP captures vast domains of computational, scientific, and mathematical
endeavors, and seems to roughly delimit what mathematicians and scientists
COMPOSITES
FACTOR
SAT
3-COLOR
HAM-PATH
Does x have a nontrivial factor
less than y ?
Is there a truth assignment that
satisfies the formula ?
Can the nodes of a graph G be
colored with 3 colors?
Is there a simple path between
s and t that visits every node?
?
?
€
51
€
53
have been aspiring to compute feasibly. ”
— Christos Papadimitriou
(56159, 50) (55687, 50)
¬ x1 ∨ x2
x1 ∨ x2
¬ x2
¬ x1 ∨ x2
x1 ∨ x2
“ In an ideal world it would be renamed P vs VP. ”
— Clyde Kruskal
?
?
10
27 / 48
11
28 / 48
P, NP, and EXP
The main question: P vs. NP
P. Decision problems for which there is a poly-time algorithm.
Q. How to solve an instance of 3-SAT with n variables?
NP. Decision problems for which there is a poly-time certifier.
A. Exhaustive search: try all 2n truth assignments.
EXP. Decision problems for which there is an exponential-time algorithm.
Q. Can we do anything substantially more clever?
Claim. P ⊆ NP.
Conjecture. No poly-time algorithm for 3-SAT.
Pf. Consider any problem X ∈ P.
"intractable"
・By definition, there exists a poly-time algorithm A(s) that solves X.
・Certificate t = ε, certifier C(s, t) = A(s). ▪
Claim. NP ⊆ EXP.
Pf. Consider any problem X ∈ NP.
・By definition, there exists a poly-time certifier C(s, t) for X.
・To solve input s, run C(s, t) on all strings t with | t | ≤ p(| s |).
・Return yes if C(s, t) returns yes for any of these potential certificates.
Remark. Time-hierarchy theorem implies P
▪
⊊ EXP.
12
13
29 / 48
30 / 48
The main question: P vs. NP
Possible outcomes
Does P = NP? [Cook 1971, Edmonds, Levin, Yablonski, Gödel]
P ≠ NP.
Is the decision problem as easy as the certification problem?
“ I conjecture that there is no good algorithm for the traveling salesman
NP
EXP
P
problem. My reasons are the same as for any mathematical conjecture:
EXP
(i) It is a legitimate mathematical possibility and (ii) I do not know.”
P = NP
If P ≠ NP
— Jack Edmonds 1966
If P = NP
If yes. Efficient algorithms for 3-SAT, TSP, 3-COLOR, FACTOR, …
If no. No efficient algorithms possible for 3-SAT, TSP, 3-COLOR, …
Consensus opinion. Probably no.
14
31 / 48
15
32 / 48
Possible outcomes
Possible outcomes
P ≠ NP.
P = NP.
“ 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
P is not equal to NP. I estimate the half-life of this problem at 25–50
“ P = NP. In my opinion this shouldn’t really be a hard problem; it’s just
more years, but I wouldn’t bet on it being solved before 2100. ”
that we came late to this theory, and haven’t yet developed any
— Bob Tarjan
techniques for proving computations to be hard. Eventually, it will
just be a footnote in the books. ”
— John Conway
“ 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 P =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
16
17
33 / 48
34 / 48
Other possible outcomes
Millennium prize
P = NP, but only Ω(n100) algorithm for 3-SAT.
Millennium prize. $1 million for resolution of P = NP problem.
P ≠ NP, but with O(nlog*n) algorithm for 3-SAT.
P = 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 “P = NP because there are only
finitely many obstructions to the opposite hypothesis”; hence there
will exists a polynomial time solution to SAT but we will never
know its complexity! ”
— Donald Knuth
18
35 / 48
19
36 / 48
Looking for a job?
Some writers for the Simpsons and Futurama.
8. I NTRACTABILITY II
・J. Steward Burns. M.S. in mathematics (Berkeley '93).
・David X. Cohen. M.S. in computer science (Berkeley '92).
・Al Jean. B.S. in mathematics. (Harvard '81).
・Ken Keeler. Ph.D. in applied mathematics (Harvard '90).
・Jeff Westbrook. Ph.D. in computer science (Princeton '89).
‣ P vs. NP
‣ NP-complete
‣ co-NP
‣ NP-hard
SECTION 8.4
Copyright © 1990, Matt Groening
Copyright © 2000, Twentieth Century Fox
20
37 / 48
38 / 48
Polynomial transformation
NP-complete
Def. Problem X polynomial (Cook) reduces to problem Y if arbitrary
NP-complete. A problem Y ∈ NP with the property that for every
instances of problem X can be solved using:
problem X ∈ NP, X ≤ p Y.
・Polynomial number of standard computational steps, plus
・Polynomial number of calls to oracle that solves problem Y.
Theorem. Suppose Y ∈ NP-complete. Then Y ∈ P iff P = NP.
Pf. ⇐ If P = NP, then Y ∈ P because Y ∈ NP.
Pf. ⇒ Suppose Y ∈ P.
Def. Problem X polynomial (Karp) transforms to problem Y if given any
・Consider any problem X ∈ NP. Since X ≤ p Y, we have X ∈ P.
・This implies NP ⊆ P.
・We already know P ⊆ NP. Thus P = NP. ▪
input x to X, we can construct an input y such that x is a yes instance of X
iff y is a yes instance of Y.
we require |y| to be of size polynomial in |x|
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.
Fundamental question. Do there exist "natural" NP-complete problems?
Open question. Are these two concepts the same with respect to NP?
we abuse notation ≤ p and blur distinction
24
39 / 48
25
40 / 48
Circuit satisfiability
The "first" NP-complete problem
CIRCUIT-SAT. Given a combinational circuit built from
AND, OR,
and
NOT
Theorem. CIRCUIT-SAT ∈ NP-complete. [Cook 1971, Levin 1973]
gates,
is there a way to set the circuit inputs so that the output is 1?
The Complexity of Theorem-Proving Procedures
IX
1973
. 3
Stephen A. Cook
University of Toronto
output
Summary
∧
¬
yes: 1 0 1
∧
∧
∨
Throughout this paper, a set of
strings means a set of strings o n
some fixed, large, finite alphabet Z.
This alphabet is large enough to include symbols for all sets described
here.
All Turing machines are deterministic recognition devices, unless
the contrary is explicitly stated.
∨
i.
1
0
?
?
Tautologies and Polynomial ReReducibility.
Let us fix a formalism for
the propositional calculus in
which formulas are written as
strings on I. Since we will require infinitely many proposition
symbols (atoms), each such symbol
will consist of a member of Z
followed by a number in binary
notation to distinguish that
symbol.
Thus a formula of length
n can only have about
n/logn
distinct function and predicate
symbols.
The logical connectives
are
&
(and), v (or), and ~(not).
?
variable inputs
hard-coded inputs
certain recursive set of strings on
this alphabet, and we are interested
in the problem of finding a good
lower bound on its possible recognition times.
We provide no such
lower bound here, but theorem 1 will
give evidence that {tautologies} is
a difficult set to recognize, since
many apparently difficult problems
can be reduced to determining tautologyhood.
By reduced we mean,
roughly speaking, that if tautologyhood could be decided instantly
(by an "oracle") then these problems
could be decided in polynomial time.
In order to make this notion precise,
we introduce query machines, which
are like Turing machines with oracles
in [I].
It is shown that any recognition
problem solved by a polynomial timebounded nondeterministic Turing
machine can be "reduced" to the problem of determining whether a given
propositional formula is a tautology.
Here "reduced" means, roughly speaking, that the first problem can be
solved deterministically in polynomial time provided an oracle is
available for solving the second.
From this notion of reducible,
polynomial degrees of difficulty are
defined, and it is shown that the
problem of determining tautologyhood
has the same polynomial degree as the
problem of determining whether the
first of two given graphs is isomorphic to a subgraph of the second.
Other examples are discussed.
A
method of measuring the complexity of
proof procedures for the predicate
calculus is introduced and discussed.
The set of tautologies
(denoted by {tautologies}) is a
519.14
»
«
,
.
. (
(
.
)
,
.
,
,
(
.).
g(n) < (f(n) +2)*.
«
(
( ,
,
;
,
.
.
It is not hard to see that
P-reducibility is a transitive rel a t i o n . Thus the relation E on
.
3.
. (
4.
,
5.
6.
,
,
,
-
».
,
. (
).
500-
.
-
,
-
.
-
.
.
-
).
,
.
)
,
—
-
(
).
).
-
,
.
,
1.
2.
(
(
( , ) —
)»,
,
Definition
A set S of strings is P-reducible (P for polynomial) to a set
T of strings iff there is some
query machine
M and a polynomial
Q(n)
such that for each input string
w, the T-computation of M with input w halts within
Q(Iwl)
steps
(lwl is the length of w ~ and ends
in an accepting state i f f wcS.
-
,
«
,
-
.)
,
,
»
,
.
]),
,
f{n)
g{n)
f(n) ^ (g(n)+2)*
,
1,2
(
,
.
,
«
.
,
,
,
)
-
,
-
,
,
(
,
:
A query machine is a multitape
Turing machine with a distinguished
tape called the query tape, and
three distinguished states called
the query state, yes state, and n._o_
state, respectively.
If M
is a
query machine and T
is a set of
strings, then a T-computation of M
is a computation of M
in which
initially M
is in the initial
state and has an input string w on
its input tape, and each time M
assumes the query state there is a
string u on the query tape, and
the next state M
assumes is the
yes state if uET
and the no state
if u~T.
We think of an "oracle",
which knows T, placing M
in the
yes state or no state.
-
,
).
.
»
,
.
.
(
1
100
.)
(
.
-
).
-
-151-
26
27
41 / 48
Implications of Karp
42 / 48
Implications of Cook-Levin
CIRCUIT-SAT
AT
s
uce
red
me T-SET
i
t
y
EN
pol
ND
CIRCUIT-SAT
s
ce
du
re T
e T-SE
tim EN
3-SAT
3-
PE
3-S o INDE
t
3-SAT
ly ND
po DEPE
IN
to
T
SA
INDEPENDENT-SET
DIR-HAM-CYCLE
GRAPH-3-COLOR
SUBSET-SUM
INDEPENDENT-SET
DIR-HAM-CYCLE
GRAPH-3-COLOR
SUBSET-SUM
VERTEX-COVER
HAM-CYCLE
PLANAR-3-COLOR
SCHEDULING
VERTEX-COVER
HAM-CYCLE
PLANAR-3-COLOR
SCHEDULING
SET-COVER
TSP
SET-COVER
TSP
CIRCUIT-SAT poly-time reduces to all of
All of these problems (and many, many more)
these problems (and many, many more)
35
43 / 48
poly-time reduce to CIRCUIT-SAT.
36
44 / 48
Implications of Karp + Cook-Levin
Some NP-complete problems
Basic genres of NP-complete problems and paradigmatic examples.
・Packing + covering problems: SET-COVER, VERTEX-COVER,INDEPENDENT-SET.
・Constraint satisfaction problems: CIRCUIT-SAT, SAT, 3-SAT.
・Sequencing problems: HAM-CYCLE, TSP.
・Partitioning problems: 3D-MATCHING, 3-COLOR.
・Numerical problems: SUBSET-SUM, PARTITION.
CIRCUIT-SAT
AT
es
duc
e re T
-tim ENT-SE
y
l
D
po
3-SAT
PEN
3-S o INDE
t
INDEPENDENT-SET
Practice. Most NP problems are known to be either in P or NP-complete.
DIR-HAM-CYCLE
GRAPH-3-COLOR
SUBSET-SUM
Notable exceptions. FACTOR, GRAPH-ISOMORPHISM, NASH-EQUILIBRIUM.
Theory. [Ladner 1975] Unless P = NP, there exist problems in NP that are
VERTEX-COVER
HAM-CYCLE
SET-COVER
TSP
PLANAR-3-COLOR
SCHEDULING
neither in P nor NP-complete.
All of these problems are NP-complete; they are
manifestations of the same really hard problem.
37
38
45 / 48
P vs. NP revisited
46 / 48
You NP-complete me
Overwhelming consensus (still). P ≠ NP.
NP
P
NPC
P ≠ NP
P = NP
P = NP
Why we believe P ≠ NP.
“ We admire Wiles' proof of Fermat's last theorem, the scientific theories of Newton,
Einstein, Darwin, Watson and Crick, the design of the Golden Gate bridge and the
Pyramids, precisely because they seem to require a leap which cannot be made by
everyone, let alone a by simple mechanical device. ”
— Avi Wigderson
42
47 / 48
43
48 / 48
© Copyright 2026 Paperzz