Computer Science 500 Theory of Computation Spring 1999 April 6

1 / 31
About This Presentation
Title:

Computer Science 500 Theory of Computation Spring 1999 April 6

Description:

Computer Science 500 Theory of Computation Spring 1999 April 6 –

Number of Views:61
Avg rating:3.0/5.0
Slides: 32
Provided by: petersg
Category:

less

Transcript and Presenter's Notes

Title: Computer Science 500 Theory of Computation Spring 1999 April 6


1
Computer Science 500Theory of ComputationSpring
1999April 6
2
A language not known to be in P
example
SAT ? ? is a boolean
formula that has a satisfying
assignment
3
Polynomial Time Verifiabledefinition
L is Polynomial Time Verifiable iff There is k, a
language L2 in P L x w, w O(xk),
such that (w,x) is in L2
E
?p1
4
?p1, NP, poly-time verifiable another view
?p1
L? iff L x ? w p(w,x)
Polynomial (in x) time decidable predicate
5
A language known to be in NP
example
SAT ? a boolean formula x1, x2
xn??such that ?(x1, x2 xn) TRUE
E
Polynomial verifier guess assignment to
variables, plug into ?, verify
6
NP-harddefinition
A language L is NP-hard iff L in NP, L
ltp L
A
7
NP-completedefinition
A language L is NP-complete iff L is in NP
L is NP-hard
8
Theorem (Cook-Levin)SAT is NP-complete
Proof We already know SAT is in NP. So, we
only need to show that SAT is NP-hard. Let L be
any language in NP. We demonstrate a poly-time
reduction from L to SAT
9
Proof SAT is NP-hard
Fix L. Suppose NTM N decides L is time
nk-3 Goal Given (N,w), efficiently construct
a boolean formula ? such that N has an
accepting ? has a satisfying path on w
assignment
10
Proof Idea
w ? L N has an accepting path on w ? a legal,
accepting tableau for N computing on w ? ?i ?
?a ? ?c ? ?m has a satisfying assignment
11
Proof SAT is NP-hard
Idea Given (N,w), build a table (tableau)
Ns configuration
c1,1 c1,2 c1,3c1,4 c1,nk c2,1
c2,2 c2,3 c2,4
c2,nk . . . cnk,,1 cnk,2 cnk,3 cnk,4
cnk,nk
1 2 nk
time
12
Proof SAT is NP-hard
If N accepts w, then there is a legal tableau
that looks like this
Current state and implicit location of the
tape head
Ns configuration
q0 w1 w2 wn U U c2,2 c2,3 c2,4
c2,nk1 c3,2 c3,3 c3,4
c3,nk1 any accept
configuration
1 2 nk
time
13
For 0lt i,j lt nk and m in ??U Q U , let
boolean variable xi,j,m correspond to whether
or not ci,j m I.e. For every i,j, exactly
one value xi,j,m True For other values of
m, xi,j,m False
14
Proof SAT is NP-hard
Constructing ?
Each line in the tableau is a valid move for N
??w? ?cell AND ?move AND ?start AND ?accept
The last line is a valid accept configuration
For each i,j exactly one value xi,j,m equals 1
The first line of the tableau is the initial
configuration
15
?cell
?cell ANDi,j (ORm xi,j,m (ANDm neq m xi,j,m
))
Each cell ci,j in the tableau contains exactly
one of Q, ?,
16
?move
Column j j1 j2
A B A B/q
Y Z Y/q Z
Row i Row i1
A q1 C q2 A D
A q1 C A D q2
17
?move (continued)
Column j j1 j2
q1 C E D q2 E
q1 C E A D E
Row i Row i1
F A q1 F A D
F A q1 F q2 A
18
?start
?start x1,1, AND x1,2,q0 AND x1,3,w1 ..
AND x1,n2,wn AND x1,n3,U AND x1,nk-1,U AND
x1,nk,
19
?final
?final ORj xnk,j,qA
20
Definition 3-SAT
3-SAT ?(x1, x2 xn) ? is in SAT ? C1
AND C2 AND Cn where Ci ?i1 OR
?i2 OR ?i3, and each ?ij xk or xk for
some k
Conjunctive Normal Form
21
Theorem3-SAT is NP-complete
Proof 1) 3-SAT is in NP (by guessing the
assignment to variables and verifying that ?(x1,
x2 xn) 1) 2) f of Cook/Levins theorem can be
converted 3-SAT form
22
Definition Vertex Cover
Given graph G (V,E), a subset V1 of vertices
is a vertex cover if each edge in E is adjacent
to at least one vertex in V1 Vertex-Cover
(G,k) G has a vertex cover of size
at most k
23
3-SAT ltp Vertex Cover
Input Boolean formula F (a or b or not c)
AND ((not a) or b or d) AND C clauses using N
variables
Output graph G G has a vertex cover of size
2C N if and only if F is satisfiable
24
Output graph GC triangles and N pairs
a
a
b
d
b
c
25
  • Each instance vertex of a variable is connected
    to one
  • of the variables pair vertices
  • T if the instance is not negated
  • and F if the instance is negated

26
Showing the construction reduces 3-SAT to vertex
cover
1. If there is a satisfying assignment then
there must be a vertex cover of size 2C N 2.
If there a vertex cover of size 2C N then there
must be a satisfying assignment
(reduction does not necessarily preserve the size
of the witness set)
27
Showing 1.
Given an assignment, circle T or F accordingly,
a
a
b
d
b
c
28
Showing 1. ...
For each triangle / clause circle two vertices,
leaving one true literal
This covers the edges
a
a
b
d
b
c
29
Showing 2.
(At least) one of each true/false pair of
vertices must be in the cover
30
Showing 2. ...
(At least) two vertices in each triangle / clause
must be in the cover
a
b
c
31
Showing 2. ...
If any one of the clauses is not satisfied, then
one of the highlighted edges is not covered
a
b
c
Write a Comment
User Comments (0)
About PowerShow.com