ca r ni z i X
a n
nirari Aftra aCrzvr5
ki 22 1 N 3 1 X
K O Kz O K3 O
Satisfiability
problem
SAT
General Form
3 SAT
0 0
Plan Given an instance of 3 SAT
w K clauses Build agraph
That has an indep setof Gi kiff the 3 SAT instance is satisfiable
N
x van a
a
d
C R V R2 Vaz
u I ATV away
C3 Tea V kEUR3
Gil I
Do
a ai
set a e I
set ai O
set ai toeither Eor I
r
E
if X c NP and for all Ye NP
YEp X then X is the hardestproblem
NP
3 SAT has been proven to be
such a problem
such aproblem is calledNP complete
Transitivity
42SPY and YEpX
Him 2 Epix
3s ATSpindpsut spvertexcoverspseta.ru
P NP Don’t know
Basic strategy to show
a problem Is N D Complete
f Prove X E N P
2 Choose a problem Y that is
known to be ND Complete
2 Prove that I Ep E
NPhard Setof problems
that are at least as hard as
ND Complete problems
g
NPcomplete
Inly
a
handfulof
problems
Traveling Salesman Problem TSP
Hamiltonian Cycle
Distort
0 0
Def A cycle C in G is a
Hamiltonian Cycle if itvisitseachvertex exactly once
Problem statement
Given an undirectedgraph G is there
a Hamiltonian cycle in G
k
0
Show that the HamiltonianCycle
Problem is NP complete
1 Show Ham Cycle is in N P
certificate ordered list ofnodes
out he a
certifier e All nodes appearing
check there is an edge
between needs adjacentofnodes
edgebetween last
firstnodes
0 no repeating nodes
is the bit
2 Choose a problem that
we
already know is NP complete
choose
vertexcoversshow that vertexconaspHam cycle
Ew.DK Eu v.D
YU 2 o o
n
a
1
Tu if.f
G
0 I
YU 6 v.v
I l
f
I
I
Fu TO 8 8
O
Beginning
Fpath
i
i
day
path
Hoz
w
tE
G
O
X Y X W X V X z A
G
in
G k 2
no
Proof A suppose that G Cv E has
a vertex coverofSgi E let the
vertex cover setbe
S Ui Uz Uh
we will identify neighborsofUi as
shown here
f
i
i
gguit
Form a Ham Cycle in G byfollowing
the nodes in G in this order i
start at s and go to
u vi if u vi 6J
u iUf if u U G
e
v That if u Thi g
O
Then go to Sz and follow the nodes
Uz Uz I Uz Uz 6
Uz UE I Uz UE G
a yds if Luz vis o
Then go to Sz
I
uh vii I un Uh 63
Uh UE I Uh uh 6
Ye u if fun under D
Then return back to s
B Suppose G has a Hamiltonian
cycle C then the set
S uj ell i Csg Cui ui D e C
for some k j Ek
will be a vortex cover set in G
O 0O_
Before Lecture Notes – 13
Before Lecture Notes – 14