MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
-
Upload
meljun-cortes-mbampa -
Category
Documents
-
view
221 -
download
0
Transcript of MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
1/16
CSC 3130: Automata theory and formal languages
Andrej Bogdanov
http://www.cse.cuhk.edu.hk/~andrejb/csc3130
NP-completeness
Fall 2008
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
2/16
P and NP
languages that can be decided on a TMwith polynomial running time
P =
(problems that admit efficient algorithms)
NP = languages decidable on a nondeterministic
TM with polynomial running time
(solutions can be checked efficiently)
decidable
NP
P
We believe that NP is bigger than P,
but we are not 100% sure
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
3/16
Evidence that NP is bigger than P
These (and many others) are in NP
Their solutions, once found, are easy to verify
But no efficient algorithms are known for any of
them
The fastest known algorithms take time 2n
CLIQUE = {(G, k): G is a graph with a clique ofk vertices}
IS= {(G, k): G is a graph with an independent set ofk vertices}
VC= {(G, k): G is a graph with a vertex cover ofk vertices}
SAT= {f:fis a satisfiable Boolean formula
}
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
4/16
Equivalence of certain NP languages
We strongly suspect that problems like CLIQUE,SAT, etc. require time 2nto solve
We do not know how to prove this, but what we
can prove is that
If any one of them is tractable (by a polynomial-
time algorithm), then all of them are tractable
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
5/16
Equivalence of certain NP languages
All these problems are as hard as one another
Moreover, they are at the frontier ofNP
They are at least as hard as any problem in NPNP
P
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
6/16
Polynomial-time reductions
What do we mean when we say, for example,
We mean that
Or, we can convert an imaginary poly-timealgorithm forIS into one forCLIQUE
CLIQUE is at least as hard as IS
IfCLIQUE has a polynomial-time algorithm,
so does IS
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
7/16
Polynomial-time reductions
Theorem
IfCLIQUE has a
polynomial-time
algorithm, so does IS
CLIQUE = {(G, k): G is a graph with a clique ofk vertices}
IS= {(G, k): G is a graph with an independent set ofk vertices}
1 2
3 4
{1, 4}, {2, 3, 4}, {1} are cliques
{1, 2}, {1, 3}, {4} are
independent sets
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
8/16
Polynomial-time reductions
Proof: Suppose CLIQUE has an algorithmA
We want to use it to solve IS
IfCLIQUE has a polynomial-timealgorithm, so does IS
G, k
reject
if not
accept
ifG has IS of size k
A
G, k
reject
if not
accept
ifGhas clique of size k
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
9/16
Reducing IS to CLIQUE
We look for a polynomial-time transformation s.t.:
RG, k G, k
IfG has a clique of size k,
then G has an IS of size k
IfG does not have a clique of size k,then G has no IS of size k
1 2
3 4
G
ISs of size k cliques of size k
1 2
3 4
Gflip all edges
set k = k
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
10/16
Reducing IS to CLIQUE
RG, k G, kOn input (G, k)Construct G by flipping all edges ofG
Set k = k
Output (G, k)
independent sets in G cliques in G
IfG has a clique of size k,
then G has an IS of size k
IfG does not have a clique of size k,
then G has no IS of size k
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
11/16
Reduction recap
We showed that
by converting an imaginary algorithm forCLIQUE
into one for IS
To do this, we came up with a reduction thattransforms instances ofIS into ones forCLIQUE
IfCLIQUE has a polynomial-time algorithm,
so does IS
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
12/16
Polynomial-time reductions
Language Lpolynomial-time reduces to Lif
there exists a polynomial-time computable map R
that takes an instance xofLinto instanceyofL
s.t.xL if and only if yL
L L(IS) (CLIQUE)
x y(G, k) (G,k)
xL yL(G has IS of size k) (Ghas clique of size k)
R
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
13/16
Meaning of poly-time reductions
Saying Lreduces to L means Lis easier than L In other words, if we can solve L, then we can also
solve L
Theorem
Proof
IfLreduces toLand LP, then LP
x y
xL yL
R algorithm forLacc
rej
algorithm
accepts
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
14/16
Notes about reductions
The direction of the reduction is very important This makes sense, because A is easier than B and
B is easier than A mean different things
However, it is possible that Lreduces to Land L
reduces to L
This means that Land Lare as hard as one another
For example, IS and CLIQUE reduce to one another
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
15/16
The Cook-Levin Theorem
So every problem in NP is easier than SAT
But SAT itself is in NP, so SAT must be the
hardest problem in NP:
Every LNP reduces to SAT
IfSATP, then P = NP
SAT= {f:f is a satisfiable Boolean formula}
-
7/31/2019 MELJUN CORTES -- AUTOMATA THEORY LECTURE - 22
16/16
Interpretation of Cook-Levin Theorem
Optimistic view:
Pessimistic view:
If we manage to solve SAT, then wecan also solve
CLIQUE, scheduling, and almost anything
Since we do not believe P = NP, it is unlikely that
we will ever have a fast algorithm forSAT