1 / 27

CSCI 4325 / 6339 Theory of Computation

CSCI 4325 / 6339 Theory of Computation. Zhixiang Chen. Chapter 7 NP-Completeness. NP. NP-complete. P. The New World. Poly-Time Computable Functions. Definition. A function is said to be poly-time computable if there is a poly-time bounded TM M that computes it.

rowena
Download Presentation

CSCI 4325 / 6339 Theory of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI 4325 / 6339Theory of Computation Zhixiang Chen

  2. Chapter 7NP-Completeness

  3. NP NP-complete P The New World

  4. Poly-Time Computable Functions • Definition. A function is said to be poly-time computable if there is a poly-time bounded TM M that computes it.

  5. Polynomial Reduction • Definition. Let be two languages. A poly-time computable function is called a polynomial reduction from to if the following is true: • When is ploynomially reducible to , we denote

  6. Understand Polynomial Reduction • When is polynomially reducible to , we have the two results: • If is (deterministically or nondeterministically) poly-time computable, so is . • If is not (deterministically or nondeterministically) ploy-time computable, neither is .

  7. Reduction Examples • Theorem. Hamilton Cycle Problem SAT. • Proof. • Given: A graph • Want: An algorithm (poly-time computable function) f that produces a Boolean CNF such that • G has a Hamilton Cycle if and only if f(G) is satisfiable

  8. j n -1 1 … 2 A HC Illustration 3 Construction of the Reduction f: • f(G) has Boolean variables • Motivation for is • Node i of G is the j-th node in the Hamilton cycle of G.

  9. Construction of the Reduction f: • Conditions for a Hamilton Cycle (HC): • At least one node at the j-th position of HC • No nodes occur twice in a HC: • Each node occurs exactly once in a HC:

  10. Construction of the Reduction f: • Any two consecutive nodes in the HC must be connected by an edge. In other words, if there is no edge from node i to node k, then node i and node k must not be two consecutive nodes in the HC: • Easy to verify: G has an HC if and only if f(G) is satisfiable.

  11. Reduction Composition • Lemma 7.1.1. If f is a polynomial reduction from to , and g is a reduction from to then is a reduction from to Proof. (Prove in class.)

  12. NP-Completeness • Definition A language is called NP-complete, if • (a) • (b) • An NP-complete language is the “hardest” problem in NP.

  13. Theorem • Theorem 7.1.1. Let L be an NP-complete language. Then P = NP if and only if L is in P. • Proof. (Prove in class.) • By this theorem, to prove P=NP, one only needs to show one NP-complete problem in P.

  14. Cook Theorem • Cook-Levin Theorem. SAT is NP-complete. • Proof. • (1) SAT is in NP • Easy to show • (2) • Hard to show.

  15. Cook Theorem • Prove (2): • Basic Idea: use CNF to describe TM computation • Because L is in NP, there is a polynomial p, an NTM M such that M is p-bounded and L=L(M). • Want: Find a poly-time computable function f such that

  16. Construction of f : • 1. Represent M’s configurations, i.e. tape content, r/w head position, current state. • 2. Ensure that all transitions between configurations are legal. • 3. Encode the initial configuration

  17. … Step 0 … … … p(|x|) p(|x|) p(|x|) p(|x|) … Step 1 … Step 2 … … Step p(|x|)+1 Construction of f : • Since M is p-bounded, given , the whole working space of M is illustrated below

  18. Construction of f : • Define variables • At step i, we need a variable to describe the state • Assume M has s states: • is true M is at state j at step i

  19. Construction of f : • Of course, M has exactly one state at each step.

  20. Construction of f : • Describe r/w head position at step i: is true iff head position is at j at step i.

  21. Construction of f : • Describe tape content • Assume M has d tape symbols is true iff M has symbol k at cell j at step i.

  22. Construction of f : • For each tape cell, M has at least one symbol • For each tape cell, M has at most one symbol

  23. Construction of f : • Encode the initial input tape • Let the input • Head position • Initial state • The x encoding • Padding blanks between cell |x| and cell p(|x|) where 1 means blank Assume the initial state is indexed as 1.

  24. Construction of f : • Describe the halting configuration of M. • Assume the halting state is indexed as s.

  25. Construction of f : • Describe moves from one configuration to another. • Do this according to the transition relation of M: • For any transition of the form “if M is at state r with head position j and current symbol k at step i, M will be at state r’ with head position j’ and current symbol k’ at cell j at step i+1 with the only tape cell being changed being cell j.” [Note. Either j’=j, or j’=j-1, or j’=j+1.] • The above means that if M is not scanning cell j at step i, then the content of cell j will remain unchanged.

  26. Construction of f : • The following describes the transition:

  27. Putting All Together • We have the desired reduction f(x) such that • f(x) is a CNF • f(x) has variables • f(x) has clauses • f(x) is poly-time computable.

More Related