Lecture on Mar 30, 2004 NPCompleteness - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Lecture on Mar 30, 2004 NPCompleteness

Description:

NP-Complete problems are the 'hardest' problems in NP, and they do exist. An NP-Complete problem represents the entire class NP ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 18
Provided by: yanzon
Category:

less

Transcript and Presenter's Notes

Title: Lecture on Mar 30, 2004 NPCompleteness


1
Lecture on Mar 30, 2004NP-Completeness
  • Topics
  • NP-Completeness
  • Reading Sipser Sections 7.4

2
NP-Completeness
  • Fundamental concept introduced by Cook 1970,
    Levin 1972
  • NP-Complete problems are the hardest problems
    in NP, and they do 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.

3
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
4
NP-Completeness
  • Def A language L is NP-Complete if
  • L ? NP
  • Every language in NP is polynomial-time reducible
    to L

5
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))

6
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.

7
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

8
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

9
Satisfiability
  • SAT ? NP
  • Proof
  • For each ??? ? SAT, a satisfying assignment A for
    ? 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 given any ??,
    A?, as ? has no satisfying assignment.

10
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,w) ? (x ? ?y ? ?z ? w) ? (x ? y ?
    z ? ?w)
  • A CNF-formula ? is a 3-CNF-fomula if each clause
    of ? has 3 literals.
  • E.g. ?(x,y,z,w) ? (x ? y ? z) ? (x ? ?y ? w)
  • CNF-SAT ? ??? ? is a satisfiable CNF-formula
  • 3-SAT ? ??? ? is a satisfiable 3-CNF-formula

11
The Cook-Levin Theorem
  • Theorem (Cook 1970, Levin 1972) SAT is
    NP-Complete. Further, CNF-SAT is also
    NP-Complete.
  • Corollary 3-SAT is NP-Complete.
  • Proof of Corollary
  • Clearly 3-SAT ? NP.
  • CNF-SAT ?P 3-SAT.

12
CNF-SAT ?P 3-SAT
  • Let ? be a given CNF-formula.
    Goal
    Transform ? into a 3-CNF-formula ? s.t. ? is
    satisfiable iff ? is
  • Transform each clause of ? into a conjunction of
    clauses of size 3.
  • Replace (a1 ? a2 ? a3 ? a4) by (a1 ? a2 ? z) ?
    (?z ? a3 ? a4)
  • z a new variable
  • In general, replace (a1 ? a2 ? ? ? ak) by

    (a1 ? a2 ? z1) ?
    (?z1 ? a3 ? z2) ? (?z2 ? a4 ? z3) ? ? ? (?zk-3 ?
    ak-1 ? ak)
  • z1 , ? , zk-3 new variables

13
CLIQUE is NP-Complete
  • Already showed that CLIQUE ? NP.
  • Will show that 3-SAT ?P CLIQUE, i.e. ? a
    poly-time reduction f that
  • takes as input a 3-CNF-formula ???
  • outputs ?G,k? ? f(???) s.t. ? is satisfiable iff
    G has a k-clique

14
Poly-time Reduction from 3-SAT to CLIQUE
  • Input A 3-CNF-formula ???. Let k ? of clauses
    in ?.
  • Output ?G,k?, where G is constructed as follows
  • Nodes in G divided into k triples
  • Each triple corresponds to a clause in ?.
  • Each node in a triple corresponds to a literal in
    the corresponding clause.
  • Edges in G connect all but two types of nodes
  • No edge between any two nodes (literals) in the
    same triple (clause)
  • No edge between any two nodes (literals) with
    contradictory labels, i.e. one labeled with x and
    the other labeled ?x for some x.

15
Poly-time Reduction from 3-SAT to CLIQUE
  • Example ? ? (x ? y ? z) ? (?x ? ?y ? ?z) ? (?x
    ? y ? z)

x
y
z
?x
?x
y
?y
z
?z
16
Poly-time Reduction from 3-SAT to CLIQUE
  • Claim ? satisfiable ? G has a k-clique
  • ? satisfiable ? ? an assignment s.t. each of
    the k clauses of ? has at least 1 satisfied
    literal
  • Take 1 satisfied literal from each clause. Then
    by construction of G, the corresponding k nodes
    in G form a k-clique in G
  • No two of the k literals can be contradictory, as
    all the k literals are satisfied.
  • Each of the k literals (nodes) comes from a
    distinct clause (triple).

17
Poly-time Reduction from 3-SAT to CLIQUE
  • Claim G has a k-clique ? ? satisfiable
  • Suppose G has a k-clique C
  • Then by construction of G,
  • Each of the k nodes (literal) of C comes from a
    distinct triple (clause)
  • No two of the k nodes can be contradictory
  • Hence we can satisfy all the k corresponding
    literals, thus all the k clauses, and thus ?.
Write a Comment
User Comments (0)
About PowerShow.com