Presentation is loading. Please wait.

Presentation is loading. Please wait.

Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.

Similar presentations


Presentation on theme: "Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C."— Presentation transcript:

1 Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C

2 Complexity ©D.Moshkovitz 2  Introduction Objectives: –To present an NP-Complete problem Overview: –SAT - definition and examples –The Cook-Levin theorem –What next?

3 Complexity ©D.Moshkovitz 3 SAT Instance: A Boolean formula. Problem: To decide if the formula is satisfiable. FT A satisfiable Boolean formula: FTTT An unsatisfiable Boolean formula:

4 Complexity ©D.Moshkovitz 4 Co-NP To Which Time Complexity Class Does SAT Clearly Belong? NP P SAT

5 Complexity ©D.Moshkovitz 5 SAT is in NP: Non-Deterministic Algorithm Guess an assignment to the variables. Check the assignment. FTFTTT x1x1 x2x2 x3x3 F T T

6 Complexity ©D.Moshkovitz 6 The Cook-Levin Theorem: SAT is NP-Complete Proof Idea: For any NP machine M and any input string w, we construct a Boolean formula  M,w which is satisfiable iff M accepts w.... SIP 254-259

7 Complexity ©D.Moshkovitz 7 q0q0 w1w1 wnwn _ q0q0 w1w1 wnwn _ q0q0 w1w1 wnwn _ Representing a Computation by a Configurations Table nknk nknk upper bound on the running time indicates tape bounds the content of the (relevant part of the) tape and the position of the head

8 Complexity ©D.Moshkovitz 8 Tableau: Example TM: –Q={q 0,q accept,q reject } –  ={1} –  ={1,_} –  (q 0,1)={(q 0,_,R)} –  (q 0,_)={(q accept,L)} TM: –Q={q 0,q accept,q reject } –  ={1} –  ={1,_} –  (q 0,1)={(q 0,_,R)} –  (q 0,_)={(q accept,L)} What does this machine do? tableau (input 11)

9 Complexity ©D.Moshkovitz 9 The Variables of the Formula x i, j, s position in the tableau (1  i,j  n k ) symbol (s  Q  {#}) stands for: “Is s the content of cell (i,j)?”

10 Complexity ©D.Moshkovitz 10  M,w =  cell   start   move   accept The Formula  cell content consistency input consistency transition legal machine accepts

11 Complexity ©D.Moshkovitz 11 Ensuring Unique Cell-Symbol The (i,j) cell must contain some symbol It can’t contain two different symbols. Note: the length of this formula is polynomial in n.

12 Complexity ©D.Moshkovitz 12 Ensuring Initial Configuration Corresponds to Input Observe: we can explicitly state the desired configuration in the first step. Assuming the input string is w 1 w 2...w n,

13 Complexity ©D.Moshkovitz 13 Ensuring the Computation Accepts The accepting state is visited during the computation.

14 Complexity ©D.Moshkovitz 14 Ensuring Every Transition is Legal Local: only need to examine 2  3 “windows”

15 Complexity ©D.Moshkovitz 15 Which Windows are Legal in the Below Example?? TM: –Q={q 0,q accept,q reject } –  ={1} –  ={1,_} –  (q 0,1)={(q 0,_,R)} –  (q 0,_)={(q accept,L)} TM: –Q={q 0,q accept,q reject } –  ={1} –  ={1,_} –  (q 0,1)={(q 0,_,R)} –  (q 0,_)={(q accept,L)}  

16 Complexity ©D.Moshkovitz 16 Ensuring Every Transition is Legal for any a 1,...,a 6 s.t. this is a legal window a1a1 a2a2 a3a3 a4a4 a5a5 a6a6

17 Complexity ©D.Moshkovitz 17  M,w =  cell   start   move   accept The Bottom Line , which is of size polynomial in n - Check! - is satisfiable iff the TM accepts the input string.

18 Complexity ©D.Moshkovitz 18 Conclusion: SAT is NP- Complete For any language A in NP, testing membership in A can be reduced to... satisfiability problem

19 Complexity ©D.Moshkovitz 19 Co-NP Revisiting the Map NP P NPC SAT

20 Complexity ©D.Moshkovitz 20 The Road Ahead From now on, in order to show some NP problem is NP-Complete, we merely need to reduce SAT to it. any NP problem can be reduced to... SAT new NP problem can be reduced to... We’ve already shown this will imply the new problem is in NPC

21 Complexity ©D.Moshkovitz 21... And Beyond! Moreover, every NP-Complete problem we discover, provides us with a new way for showing problems to be NP-Complete. any NP problem can be reduced to... Known NP-hard problem new NP problem can be reduced to...

22 Complexity ©D.Moshkovitz 22 Summary We’ve proved SAT is NP-Complete. We’ve also described a general method for showing other problems are NP-Complete too. 


Download ppt "Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C."

Similar presentations


Ads by Google