12. )
( 3
n
TIME
Examples in class:
}
grammar
free
-
context
by
generated
is
:
,
{
2
G
w
w
G
L
}
and
matrices
:
,
,
{
3
2
1
3
2
1
3
M
M
M
n
n
M
M
M
L
CYK algorithm
Matrix multiplication
13. Polynomial time algorithms: )
( k
n
TIME
Represents tractable algorithms:
for small we can decide
the result fast
k
constant 0
k
24. Example: The Satisfiability Problem
Boolean expressions in
Conjunctive Normal Form:
k
t
t
t
t
3
2
1
p
i x
x
x
x
t
3
2
1
Variables
Question: is the expression satisfiable?
clauses
34. Example: The satisfiability problem
Non-Deterministic algorithm:
•Guess an assignment of the variables
e}
satisfiabl
is
expression
:
{ w
w
L
•Check if this is a satisfying assignment
39. Example: Does the Satisfiability problem
have a polynomial time
deterministic algorithm?
WE DO NOT KNOW THE ANSWER
Open Problem: ?
NP
P
40. NP-Completeness
A problem is NP-complete if:
•It is in NP
•Every NP problem is reduced to it
(in polynomial time)
41. Observation:
If we can solve any NP-complete problem
in Deterministic Polynomial Time (P time)
then we know:
NP
P
42. Observation:
If we prove that
we cannot solve an NP-complete problem
in Deterministic Polynomial Time (P time)
then we know:
NP
P
43. Cook’s Theorem:
The satisfiability problem is NP-complete
Proof:
Convert a Non-Deterministic Turing Machine
to a Boolean expression
in conjunctive normal form
44. Other NP-Complete Problems:
•The Traveling Salesperson Problem
•Vertex cover
•Hamiltonian Path
All the above are reduced
to the satisfiability problem
45. Observations:
It is unlikely that NP-complete
problems are in P
The NP-complete problems have
exponential time algorithms
Approximations of these problems
are in P