1 / 23

CSCI 2670 Introduction to Theory of Computing

CSCI 2670 Introduction to Theory of Computing. November 29, 2005. Agenda. Today More on the class NP. The class NP. Definition: A verifier for a language A is an algorithm V, where A={w|V accepts <w,c> for some string c} The string c is called a certificate of membership in A.

elata
Download Presentation

CSCI 2670 Introduction to Theory of Computing

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 2670Introduction to Theory of Computing November 29, 2005

  2. Agenda • Today • More on the class NP November 29, 2005

  3. The class NP Definition: A verifier for a language A is an algorithm V, where A={w|V accepts <w,c> for some string c} The string c is called a certificate of membership in A. Definition: NP is the class of languages that have polynomial-time verifiers. November 29, 2005

  4. Who wants $1,000,000? • In May, 2000, the Clay Mathematics Institute named seven open problems in mathematics the Millennium Problems • Anyone who solves any of these problems will receive $1,000,000 • Proving whether or not P equals NP is one of these problems November 29, 2005

  5. NP P coNP What we know November 29, 2005

  6. Are there any problems here? What we don’t know NP P coNP November 29, 2005

  7. Solving NP problems • The best-known methods for solving problems in NP that are not known to be in P take exponential time • Brute force search November 29, 2005

  8. NP-completeness • A problem C is NP-complete if finding a polynomial-time solution for C would imply P=NP Definition: A language B is NP-complete if it satisfies two conditions: • B is in NP, and • Every A in NP is polynomial time reducible to B November 29, 2005

  9. An NP-complete problem • A formula is Boolean if each of its variables can be assigned the values TRUE (1) or FALSE (0) • A Boolean formula is satisfiable if there is some assignment of values that results in the formula evaluating to TRUE SAT: Is a given Boolean formula satisfiable? • SAT is NP-complete • We will go over the proof next week November 29, 2005

  10. Examples • (x  y)  ( x  y) • Satisfiable – e.g., x = y = 1 • ((xy)  (xz))  ((xy)  (yz)) • Satisfiable – e.g., x = 0, y = z = 1 • ((xy)  (xz))  ((xy)  (yz)) • Unsatisfiable November 29, 2005

  11. Proving a problem is NP-complete • A problem C is NP-complete if finding a polynomial-time solution for C would imply P=NP • If a polynomial-time solution is found for C, then that solution can be used to find a polynomial-time solution for any other problem in NP • What does this remind you of? • Reductions! November 29, 2005

  12. Reductions and NP-completeness • If we can prove an NP-complete problem C can be polynomially reduced to a problem A, then we’ve shown A is NP-complete • A polynomial-time solution to A would provide a polynomial-time solution to C, which would imply P=NP November 29, 2005

  13. Polynomial functions Definition: A function f:Σ*Σ* is a polynomial time computable function if some polynomial time Turing machine M exists that halts with just f(w) on its tape, when started on any input w. November 29, 2005

  14. f f Polynomial reductions Definition: Language A is polynomial-time reducible to language B, written A ≤P B, if a polynomial time computable function f:Σ*Σ* exists, where for every w w  A iff f(w)  B November 29, 2005

  15. Reductions & NP-completeness Theorem: If A ≤P B and BP, then AP. Proof: Let M be the polynomial time algorithm that decides B and let f be the polynomial reduction from A to B. Consider the TM N N = “On input w • Compute f(w) • Run M on f(w) and output M’s result” Then N decides A in polynomial time. November 29, 2005

  16. Implications of NP-completeness Theorem: If B is NP-complete and BP, then P = NP. Theorem: If B is NP-complete and B≤PC for some C in NP, then C is NP-complete November 29, 2005

  17. Showing a problem in NP-complete • Two steps to proving a problem L is NP-complete • Show the problem is in NP • Demonstrate there is a polynomial time verifier for the problem • Show some NP-complete problem can be polynomially reduced to L November 29, 2005

  18. NP-completeness proof • LPATH = {<G, a, b, k> | G is a graph with nodes a and b and a simple path of length k from a to b} • A simple path has no repeated nodes • We will use the fact that the following language is NP-complete • UHAMPATH = {<G,a,b> | G is a graph with a Hamiltonian path from a to b} • A Hamiltonian path visits each node exactly once November 29, 2005

  19. LPATH is NP-complete • First show LPATH is in NP • Can we verify a solution to LPATH in polynomial time? • Yes • Check the certificate is a simple length-k path from a to b November 29, 2005

  20. Reduction from UHAMPATH R = “On input <G,a,b>, where G = <V,E> is a graph with nodes a and b • If |V| ≤ 1 reject • Check if <G,a,b,|V|-1> is in LPATH” November 29, 2005

  21. Two questions • Need to demonstrate that <Ga,b> is in UHAMPATH iff <G,a,b,|V|-1> is in LPATH • This is clear from the definitions of UHAMPATH and LPATH • Need to demonstrate that the reduction is in polynomial time • The reduction takes O(|V|) time (to evaluate |V| November 29, 2005

  22. Insight • We know (because I said so) that UHAMPATH is NP-complete • Therefore, a polynomial time solution to UHAMPATH would imply P = NP • We showed that we can convert UHAMPATH to LPATH in polynomial time • Therefore, a polynomial solution to LPATH would provide a polynomial solution to UHAMPATH • LPATH must be NP-complete November 29, 2005

  23. Summary • To show a language L is NP-complete • Demonstrate L is in NP • Find a language C that is known to be NP-complete • Create a function f from C to L • Demonstrate that if x is in C then f(x) is in L • Demonstrate that if f(x) is in L then x is in C • Demonstrate f is computable in polynomial time November 29, 2005

More Related