Summary of Previous Lecture - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Summary of Previous Lecture

Description:

Showed that for every Boolean function of n variables f there CNF of size n2n ... Has G a sub-set of k vertexes such that every edge has at lest one vertex in it? ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 22
Provided by: evgenyd
Category:

less

Transcript and Presenter's Notes

Title: Summary of Previous Lecture


1
Summary of Previous Lecture
  • Reductions, NP-hardness, NP-completeness
  • TMSAT NP-complete
  • Defined (k-)CNF
  • Expressed equality in CNF
  • Showed that for every Boolean function of n
    variables f there CNF ? of size n2n such that
    ?(u)f(u) for every u?0,1n

2
Plan for today
  • Cook-Levin Theorem SAT is NP complete
  • Oblivious machines
  • Encoding of a verifier into CNF
  • Reductions
  • 3-SAT is NP complete (from SAT)
  • Clique is NP complete (from 3-SAT)
  • Vertex Cover is NP complete (from 3-SAT)

3
SAT
  • SAT is a language of all satisfiable CNF formulas
  • k-SAT is a language of all satisfiable k-CNF
    formulas
  • COOK-LEVIN Theorem SAT is NP-complete.
  • Corollary 3-SAT is NP complete (poly-time
    reduction).

4
Technicalities oblivious TM
  • TM M is oblivious if for an input x?? and i?N the
    location of Ms head at ith step is only a
    function of length of x and i.
  • Claim For any Turing machine that runs in T(n)
    there is an oblivious Turing machine that runs in
    O(T(n)2).

5
Technicalities oblivious TM
  • Oblivious M has ? ??ma a??, new start state
    qs, stae q0 and it has 7 states qir, qil, qirr,
    qilr, qirl qill, qi for each state qi?Q-q0.
  • Initialization
  • qs,,L,m,q0
  • q0,?,R,?,q0.
  • From start state qs TM M reads symbol (say a),
    prints instead marker (ma), moves left and into a
    state q0. Then M sweeps right until it discovers
    a marker.

6
Technicalities oblivious TM (continued)
  • Transition simulation
  • qi,a,R,b,qj
  • In state qi M reads a, prints b moves right and
    into a new state qj. Simulated by
  • qi,,R,,qj qi,ma,R,b,qjr qjr,,R,m,qjrr
  • qjrr,,R,,qjrr qjrr,?,L, ?,qjlr qjlr,,L,
    ,qjlr
  • qjlr,?,R, ?,qj
  • M reads the ma , prints b, moves right, and into
    a new state associated with qj. Next M reads
    next symbol (say c), prints marker (mc), sweeps
    right until space, sweeps left until space and
    then moves right until it discovers mc.

7
Technicalities oblivious TM (continued)
  • Transition simulation
  • qi,a,L,b,qj
  • In state qi M reads a, prints b moves left and
    into a new state qj. Simulated by
  • qi,,R,,qi qi,ma,R,ma,qi rl
    qirl,,R,,qirl
  • qirl,?,L, ?,qill qill,,L, ,qill qill,ma,L,b
    ,qj l
  • qjl,,L,m,qjlr qjlr,,L, ,qjlr qjlr,?,R,
    ?,qj.
  • M reads the ma , moves right, and into a new
    state associated with qi that indicates that the
    machine should have moved left. Next M sweeps
    right until space, sweeps left until it discovers
    ma, prints b, moves left, reads next symbol (say
    c), prints marker (mc), sweeps left until space
    and then moves right until it discovers mc.

8
Oblivious TM works in time O((T(n)2)
  • Suppose that on a given letter M moved left,
    printed a new symbol and got to state qj, then M
    does the following
  • Reads marker
  • Remembers it in a state qjrl
  • Sweeps right until space
  • Reverses, remembers it in a state qjll, sweeps
    left until marker,
  • Replaces it by respective symbol, remembers it in
    a state qjl
  • Moves left, replaces next letter to the left by
    the marker, finishing to prepare the tape. It
    remembers that in state qjlr
  • Continues sweep left until blank
  • Reverses and gets to the state qj
  • Sweeps right until the marker
  • Since each sweep is at most T(n) steps, we
    substituted one step in M by at most 3T(n) steps
    in M.

9
Oblivious TM - snapshots
  • M is 2 tape oblivious machine. Snapshot of M is a
    state of M at a given time lta,b,qgt?????Q Snapshot
    at a step I encoded by string zi of length c2log
    ? log Q that depends on M only.

10
Useful poly-time computable functions
  • For M running on input y?0,1m in poly-time T(m)
    denote
  • Input head position at step i by inpos(i),
  • Working head position at step i by work(i),
  • Last time (step ) M visited position work(i)
    before step i by prev(i).
  • All are computable in poly-time in length of y.

11
Next snapshot map function
  • Snapshot after a step i depends on (is a
    function of)
  • Contents of work tape saved in encoding of a
    snapshot at step prev(i) z prev(work(i)).
  • Contents of input tape yinpos(i)
  • State at the step i-1 saved in encoding zi-1

12
Cook-Levin Theorem proof
  • Hence zif(zi-1, yinpos(i), z prev(work(i)))
    where f is a map with domain 0,12c1 to the
    range 0,1c.
  • For x?0,1n construct ?x s.t x?L??x?SAT x?L?
    there exists a poly-timeTM M and u?0,1p(x)
    such that M(y)1 where yxu
  • Execution of M on y is determined by its snapshot
    sequence z1, z2,,zT(n) where T(n) is a runtime
    on y and zi?0,1c.

13
Cook-Levin Theorem proof (continued)
  • So there must be a string
  • ty z1 z2zT(n)?0,1np(n)cT(n) such that
  • First n- bits are x
  • Bits np(n)1 to np(n)c encode initial snapshot
    of M lty1,?,qsgt
  • For every i?2,,T(n) holds
  • zif(zi-1, yinpos(i), z prev(work(i)))
  • Bits np(n)c(T(n)-1) to np(n)cT(n) encode that
    machine is in accepting position overlooking
    spaces on both tapes.

14
Cook-Levin Theorem proof (continued)
  • Condition 1 is expressed by the formula
  • (x1 v ?t1) ? (?x1 v t1)? ? (xn v ?tn)?(?xnv tn)
  • Conditions 2 and 4 define c specific bits so
    for each we can define a Boolean function that
    takes these bit strings to 0 and others to 1. So
    by Claim we can have CNF on c variables of size
    c2c that is true only if the variables are
    assigned these values.
  • Similarly condition 3 is an AND of conditions on
    3c1 known bits (c the left-zi and 2c1 bits on
    the right of equality) so by Claim it can be
    expressed by formula of size at most (3c1)23c1.

15
Cook-Levin Theorem proof (continued)
  • The formula is AND of all formulas that we
    constructed it has size at most 2np(n)dT(n)
    where d depends on M not on x (d(3c1)23c1.
  • Since we can compute each zi in polynomial time
    the formula can also be computed in polynomial
    time.

16
3-SAT
  • Given a 3-CNF formula ? over n variables with m
    clauses. Has ? a satisfying assignment?
  • 3-SAT ? ? is satisfiable 3-CNF

17
SAT ?p3-SAT
  • Let F be a CNF over n variables with m clauses.
  • If we have a clause with more than 3 variables
    split it into 2 introducing extra variable as
    follows Cl1vl2vvln becomes l1vl2vz and
    ?zvl3vvln. Applying transformation repeatedly we
    get 3-SAT
  • We introduced at most n-1 variables per clause so
    all in all we may have added at most m(n-1)
    variables. New formula F ?3-SAT if and only if
    F?SAT
  • Thus the transformation is poly-time reduction.

18
Clique
  • Given an undirected graph G and a number k.
  • Has G a complete sub-graph with k-vertexes?
  • CLIQUEltG,kgt G has clique of size k

19
3-SAT?p CLIQUE
  • Let ? be a 3-CNF over n variables with m clauses.
    Graph G? has vertexes that are literals in ? a
    pair of vertexes is connected by an edge if it
    satisfies the following conditions
  • Vertexes are not opposing literals (x, ?x)
  • Vertexes do not belong to the same clause.
  • Does ltG?,mgt belong to CLIQUE?
  • Need to show ??3-SAT? ltG?,mgt ?CLIQUE

20
Vertex Cover
  • Given an undirected graph G and a number k. Has G
    a sub-set of k vertexes such that every edge has
    at lest one vertex in it?
  • VCltG,kgt G has vertex cover of size k

21
3-SAT?pVC (vertex cover)
  • Let ? be a 3-CNF with m clauses over n variables
  • For each variable x in ? add vertexes x and ?x
  • Connect opposite-literal vertexes (x, ?x) with an
    edge
  • For each clause add a triangle sub-graph that has
    literals of the clause as vertexes
  • Connect same-literal vertexes with edges
  • Is ltG?,2mngt an instance of a vertex cover?
  • Need to show ??3-SAT? ltG?,2mngt ?VC
Write a Comment
User Comments (0)
About PowerShow.com