Lecture on Mar 23, 2004 P vs NP, NPCompleteness - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Lecture on Mar 23, 2004 P vs NP, NPCompleteness

Description:

Grand Challenge: Is P NP? One of the most important open problems ... A million-dollar problem: prize presented by the Clay Mathematics Institute. What if P NP? ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 25
Provided by: yanzon
Category:

less

Transcript and Presenter's Notes

Title: Lecture on Mar 23, 2004 P vs NP, NPCompleteness


1
Lecture on Mar 23, 2004P vs NP, NP-Completeness
  • Topics
  • The Complexity Classe NP
  • The P vs NP problem
  • NP-Completeness
  • Reading Sipser Sections 7.2, 7.3, 7.4

2
The Class NP
  • Stands for Nondeterministic Polynomial Time,
    Cook 1970.
  • Nondeterminism A fundamental concept introduced
    by Rabin Scott, 1959.
  • Informally, a nondeterministic algorithm is one
    endowed with the power to make a
    nondeterministic choice in each step.
  • Will illustrate but wont treat it formally in
    this course.
  • NP traditionally defined using nondeterministic
    TMs.
  • Will give an equivalent alternative definition.

3
The Class NP
  • Def A language L ? NP if ? a polynomial time
    verifier V s.t.
  • ? x ? L, ? a proof ?x s.t. V(x, ?x ) ? 1
  • ?x Proof of membership of x
  • ? x ? L, ? ?, V(x, ?) ? 0
  • Thus nonmembers have no proof of membership
  • Thus NP ? Class of all languages that are
    efficiently verifiable
  • ? Class of problems whose
    solutions are efficiently verifiable

4
A View of NP
  • Envision a language L as consisting of correct
    statements.
  • An all-powerful prover P, and a polynomial-time
    verifier V.
  • P wants to prove x ? L, writes down a proof ?x
    , sends ?x to V.
  • V verifies that ?x is a correct proof of x ?
    L.
  • An NP proof system requires that
  • Every correct statement has a proof that is
    easily verifiable.
  • Every incorrect statement has no proof of
    correctness even an all-powerful malicious
    prover cannot fool you.

5
Examples of NP Languages
  • Many natural computational problems are in NP.
  • Example Is a given integer n a composite
    number?
  • COMPOSITES ? ?n? n ? p?q, p, q ? 1
  • Claim COMPOSITES ? NP.
  • Proof For each composite n ? p?q, (p, q) is a
    proof of compositeness.
  • The verifier V, given (n, p, q), simply verifies
    that n ? p?q.
  • If n is composite, then n is accepted given (n,
    p, q).
  • If n is prime, then n is rejected as ? p, q ? 1,
    n ? p?q.
  • In fact, COMPOSITES ? P, as PRIMES ? P.

6
Examples of NP Languages
  • Theorem P ? NP, i.e. every language in P is in
    NP.
  • Intuitively Verifying a solution is easier than
    coming up with one.
  • Proof Let L ? P, and A a polynomial-time
    algorithm that decides L.
  • Then A is a verifier which can verify without any
    proof.
  • There are however problems in NP which are not
    known to be in P.

7
CLIQUE
  • Def A clique C of a graph G is a complete
    subgraph of G, i.e. every two nodes of C are
    adjacent. A k-clique is a clique with k nodes.
  • Does a given graph G has a k-clique?
  • CLIQUE ? ?G,k? G has a k-clique

a 4-clique
8
CLIQUE
  • Claim CLIQUE ? NP.
  • Proof For each ?G,k? ? CLIQUE, G has a k-clique
    C.
  • The k-clique C is a proof of that G has a
    k-clique.
  • The verifier V, given ?G,k,C?, simply verifies
    that C is a k-clique, i.e.
  • C is a subgraph of G, C has k nodes, and there is
    an edge between every two nodes of C.
  • If ?G,k? ? CLIQUE, then ?G,k? is accepted given
    ?G,k,C?.
  • If ?G,k? ? CLIQUE, then ?G,k? is rejected as G
    has no k-clique.
  • Do not know whether CLIQUE ? P.
  • Cannot try all possible subsets of k nodes of
    such subsets ? (n/k)k , exponentially large in k.
  • Still do not know how to do much better than the
    naïve method.

9
Hamiltonian Path
  • Def A Hamiltonian Path of a graph G is a path
    that visits each node of G exactly once. G is
    Hamiltonian if G has a Hamiltonian path.

Hamiltonian
Not Hamiltonian
10
Hamiltonian Path
  • Is a given graph G Hamiltonian?
  • HAM ? ?G? G is Hamiltonian
  • Claim HAM ? NP.
  • Proof For each ?G? ? HAM, a Hamiltonian path P
    is a proof of membership.
  • The verifier V, given ?G, P?, simply verifies
    that P is a Hamiltonian path,
  • P is a path G, P visits each node of G exactly
    once.
  • If ?G? ? HAM, then ?G? is accepted given ?G,P?.
  • If ?G? ? HAM, then ?G? is rejected as G has no
    Hamiltonian path
  • Do not know whether HAM ? P. Cannot try all n!
    possible paths.

11
Knapsack (or Subset Sum)
  • Given a set S of integers, and a target integer
    k, does S contain a subset that adds up to k?
  • KNAPSACK ? ?S,k? S has a subset Y ? y1,,ym ?
    S s.t. ? yi ? k
  • Claim KNAPSACK ? NP.
  • Proof For each ?S,k? ? KNAPSACK, the subset Y is
    a proof of membership.
  • The verifier V, given ?S,k,Y?, simply verifies
    that Y ? S, and elements of Y add up to k.
  • Do not know whether KNAPSACK ? P. Cannot try all
    2n possible subsets.

12
P vs NP
  • Know that P ? NP.
  • Grand Challenge Is P ? NP?
  • One of the most important open problems of all
    sciences.
  • A million-dollar problem prize presented by the
    Clay Mathematics Institute.

13
What if P ? NP?
  • Many optimization problems can be solved
    efficiently and exactly.
  • Much of complexity theory meaningless.
  • Approximation algorithms unnecessary.
  • Much of cryptography collapses!
  • Mathematicians can be replaced by a computer.

14
P vs NP
  • Common Belief P ? NP
  • Philosophical Evidence Verifying a
    proof/solution seems easier than coming up with a
    proof/solution.
  • Empirical Evidence Still dont know how to solve
    CLIQUE, HAMILTONIAN PATH, KNAPSACK, much better
    than the naïve method.

15
NP-Completeness
  • Fundamental concept introduced by Cook 1970,
    Levin 1972
  • NP-Complete problems are the hardest problems
    in NP, and exist
  • An NP-Complete problem represents the entire
    class NP
  • To study the P vs NP problem, it suffices to
    study any single NP-Complete problem
  • Formal definition of NP-Completeness, by
    polynomial-time reduction, next.

16
Polynomial-Time Reduction
  • Def Language A is polynomial-time reducible to
    language B, written A ?P B, if ? a
    polynomial-time computable function f ? ? ?
    such that ? w ? ?, w ? A iff f(w) ? B. The
    function f is called a polynomial-time reduction
    from A to B.

A
B
f
f
17
NP-Completeness
  • Def A language L is NP-Complete if
  • L ? NP
  • Every language in NP is polynomial-time reducible
    to L

18
Simple Facts
  • Lemma 1 If A ?P B and B ? P, then A ? P.
  • Proof
  • Let M be a poly-time algorithm that decides B.
  • Let f be a poly-time reduction from A to B.
  • To decide A in poly-time On input w,
  • Compute f(w)
  • Run M on f(w) and output M(f(w))

19
Simple Facts
  • Lemma 2 If L is NP-Complete and L ? P, then P ?
    NP.
  • Proof
  • Since L is NP-Complete, by definition every
    language A ? NP is poly-time reducible to L.
  • If L ? P, then by Lemma 1, A ? P .
  • Thus NP ? P ? P ? NP (as P ? NP)
  • Cor 3 P ? NP iff any NP-Complete language is in
    P.

20
Simple Facts
  • Lemma 3 If A is NP-Complete and A ?P B, then B
    is NP-Complete.
  • Proof
  • Suppose that A is NPC. Let L be any language in
    NP.
  • By definition, ? a poly-time reduction f from L
    to A.
  • Let g be a poly-time reduction from A to B.
  • Then g?f is a poly-time reduction L to B.
    (Verify!)
  • Cor 4 To show that language B is NP-Complete, it
    suffices to show
  • B ? NP
  • ? an NP-Complete language A s.t. A ?P B

21
Satisfiability
  • Are there NP-Complete languages? YES!
  • Boolean formula An expression involving Boolean
    variables and operations. E.g. ?(x,y,z) ? (?x ?
    y) ? (x ? ?z)
  • ? is satisfiable if some assignment of 0/1 to
    variables makes ? evaluate to 1.
  • ?(x,y,z) ? (?x ? y) ? (x ? ?z) is satisfied by
    the assignment x ? 0, y ? 1, z ? 0.
  • SAT ? ??? ? is a satisfiable Boolean formula

22
Satisfiability
  • SAT ? NP
  • Proof
  • For each ??? ? SAT, a satisfying assignment A is
    a proof of membership.
  • The verifier V, given ??, A?, simply verifies
    that A satisfies ?.
  • If ??? ? SAT, then ??? is accepted given ??, A?.
  • If ??? ? SAT, then ??? is rejected as ? has no
    satisfying assignment.

23
Satisfiability
  • Literal A variable or a negated variable. E.g.
    x, ?y
  • Clause Literals connected with ?
  • E.g. (x ? ?y ? ?z)
  • A Boolean formula is in conjunctive normal form,
    or a CNF-formula, if it consists of clauses
    connected by ?
  • E.g. ?(x,y,z) ? (x ? ?y ? ?z) ? (x ? y ? z)
  • CNF-SAT ? ??? ? is a satisfiable CNF-formula

24
The Cook-Levin Theorem
  • Theorem (Cook 1970, Levin 1972)
    SAT is NP-Complete. Further,
    CNF-SAT is also NP-Complete.
Write a Comment
User Comments (0)
About PowerShow.com