NP-Completeness (36.4-5/34.4-5) - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

NP-Completeness (36.4-5/34.4-5)

Description:

3-CNF with k clauses is satisfiable iff G has independent k-set ... For any graph G any independent set in G 1-1 corresponds to clique in the complement graph G' ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 10
Provided by: ALE7150
Learn more at: http://www.cs.gsu.edu
Category:

less

Transcript and Presenter's Notes

Title: NP-Completeness (36.4-5/34.4-5)


1
NP-Completeness (36.4-5/34.4-5)
  • P yes and no in pt
  • NP yes in pt
  • NPH ? NPC

NP-hard
NPC
P
NP
2
Satisfiability
  • Boolean formulas ?x, (x ? y) (x ? y) (x?y) (x?y)
  • Satisfiability Problem (SP)
  • given a Boolean formula
  • is there any 0-1 input (0-1 assignment to
    variables) s.t. formula is true (1)?
  • Cooks Theorem SP is NP-complete.
  • SP is an NP-problem (why?)
  • SP is NP-hard (w/o proof)

3
3-CNF
  • Conjunctive normal form (CNF)
  • (l11 ? l12 ?... ?l1s1) ?... ? (ln1 ? ln2 ?...
    ?lnsn)
  • each literal l is either variable or negation
  • 3-CNF each si3
  • 3-CNF Satisfiability is NPC
  • (?x1 ?x2) ? (x1 ? ? x4 )
  • Corresponding tree
  • y3?(y1 ? (?x1 ? x2))
  • ?(y2 ? ( x1 ? ? x4 ))
  • Truth assignment for each clause using tables.

y3?
y2?
y1?
? x1
x2
x1
? x4
4
Independent Set
  • Independent set in a graph G
  • pairwise nonadjacent vertices
  • Max Independent Set is NPC
  • Is there independent set of size k?
  • Construct a graph G
  • literal -gt vertex
  • two vertices are adjacent iff
  • they are in the same clause
  • they are negations of each other
  • 3-CNF with k clauses is satisfiable iff G has
    independent k-set
  • assign 1s to literals-vertices of independent
    set
  • Example f (xzy) (xza) (axy)

x, z, y independent
F is satisfiable f 1 if x z y 1
5
MAX Clique
  • Max Clique (MC)
  • Find the maximum number of pairwise adjacent
    vertices
  • MC is in NP
  • for the answer yes there is certificate of
    polynomial length clique which can be checked
    in polynomial time
  • MC is in NPC
  • Polynomial time reduction from MIS
  • For any graph G any independent set in G 1-1
    corresponds to clique in the complement graph G

red clique
noedge ? edge edge ? noedge
G
Complement G
6
Minimum Vertex Cover
  • Vertex Cover
  • the set of vertices which has at least one
    endpoint in each edge
  • Minimum Vertex Cover (MVC)
  • the set of vertices which has at least one
    endpoint in each edge
  • MIN Vertex Cover is NPC
  • If C is vertex cover, then V - C is an
    independent set

red independent set
blue vertex cover
7
Set Cover
  • Given a set X and a family F of subsets of X, F
    ? 2X, s.t. X covered by F
  • Find subfamily G of F such that G covers X and
    G is minimize
  • Set Cover is NPC
  • reduction from Vertex Covert
  • Graph representation

edge between set A? F and element x ? X means x
? A
d
a
b
c
red elements of ground set X
blue subsets in family F
A
B
A a,b,c, B c,d
8
Intermediate Classes
Dense Set Cover is NP but not in P neither in NPC
Dense Set Cover Each element of X belongs to at
least half of all sets in F
9
Runtime Complexity Classes
  • Runtime order
  • constant
  • almost constant
  • logarithmic
  • sublinear
  • linear
  • pseudolinear
  • quadratic
  • polynomial
  • subexponential
  • exponential
  • superexponential
  • Example
  • adding an element in a queue/stack
  • inverse Ackerman function O(logloglog n)
  • n times
  • extracting minimum from binary heap
  • n1/2
  • traversing binary search tree, list
  • O(n log n) sorting n numbers, closest pair, MST,
    Dijkstra shortest paths
  • adding two n?n matrices
  • e n (1/2)
  • e n, , n!
  • Ackerman function
Write a Comment
User Comments (0)
About PowerShow.com