a
Traveling
Salesman
TSP
Problem Hamiltonian Cycle
im
A cycle
G
if itvisitseach
a
C in Hamiltonian Cycle
vertex exactly once Problem statement
Given an undirectedgraph G is there a Hamiltonian cycle in G
Def
is
a
Show that the Hamiltonian Cycle Problem is NP complete
Show that HC is in NP hitofnodes ontheHCinorter
A
o Pol length artificial i
Pol list
time certifies
is
all nodes are in the hit
check that There is an edge between adjacent nodes in the hit
check thatthere is an edgebetween the lastandfirstmidis r
ChooseverterConer
HC
2
vertex cover Sp
1
long
GyuDb
v is I
I
463
v
U
DX
ill
9,463,0
an
I
i
in
w
a
P EE
w
i
i
0
w
G
O
Proof
A suppose that G
a vertex cover ofSgi E
vertex cover setbe
Ui Uz O_0
Cv E has let the
Uh
S
we will identify neighbors of Ui as shown here
i
iO gg
Form a Ham Cycle in G
the nodes in start at s
u viif u iUfif
by following G in this order i
and go to
u vi6J
u U G
e v
That
if
u
Thi g
uit
f
Then go to Sz and follow the nodes
Uz Uz I
UE I yds if
Uz
a
to
UzUz UzUEG
Luzvis o
Then
go
Sz
I
Uh
uh vii I
unUh 63
6
UE I u
if
Uhuh
fun under D
Ye Thenreturnbackto s
6
Suppose G has a Hamiltonian cycle C then the set
B
S 0elli 00D C
uj CsgCuiui e
for some k j will be a vortex cover set in G
siggysif
Ek
Ei
ifwehavea HCie tour
G ofcost n
tourofcost
is
in G a
Vertex Cover ata
Indep set
Ei
3
SAT
is
Hc
in G
hard
tsponGraphgwltfniaeqkae.it n
tips
initial
Aed ofhowgoodan optsoI couldbe
costofthe optso I 3 Conot fthe MST costofour approx so l G 2 costof MST
This is a
Cost of
tour
2Costof
costofour approx so I
secontoftheopto approximation alg
General
Theorem if P NP then for any constant971 there is
TSP
e time approximation no polynomial
algorithm with approximation ratio f for the general TSP
Plan we will assume thatsuch
an
approximation algorithm
exists we will then use solve the H C problem
it
to
Given problem
will
construct G as
o
o
G
as in G connected
an instance ofthe on graph G we
HC
follows has the same setnodes
G is a fully have a cost of 1
graph Edges in G that are also G
otheredges in 0 have a
cost of
aww
fluI I
O
ifG has a HC four GINI costoyopt
fluI
flirt
has a tourof
ifG
G has
arts a
Discussion 11
1. In the Min-Cost Fast Path problem, we are given a directed graph G=(V,E) along with positive integer times te and positive costs ce on each edge. The goal is to determine if there is a path P from s to t such that the total time on the path is at most T and the total cost is at most C (both T and C are parameters to the problem). Prove that this problem is NP-complete.
2. We saw in lecture that finding a Hamiltonian Cycle in a graph is NP-complete. Show that finding a Hamiltonian Path — a path that isits each erte eactl once, and isnt reqired to return to its starting point — is also NP-complete.
3. Some NP-complete problems are polynomial-time solvable on special types of graphs, such as bipartite graphs. Others are still NP-complete.
Show that the problem of finding a Hamiltonian Cycle in a bipartite graph is still NP-complete.
A show Ham
2 3
Path is 7
in NP
HI
Shou HC
Kp
a Show that HC 2 choose HC
on a Bipartitegrapheinp 3 Show HC Sp HC on a bipartitegraph
a
G
Coo
Go CC
ABCA C.BA
AABBCc A
CB’AC’B cg.cIBIAI
Ao
Aga
G
1,1 4
E
B
A
B
C do
A
Oo
A
Mathis
anode from G
item’s
Ginn a setofa items whereitem I haswigA wi is there a subsetof theirs w total weight
W and Z M Ai
Na
X Sao
A
2 3
Shou M CF P is in Skip
Choose subsetSam Show sum
N P
Ep M CFP Decinoilerminofsubsetsam
o
Bi
A
C Wz
A0 Az An
8 at0 FfGji Not
so C Jet0 C Wi t o town
f B fBu Bu Cao
G
Isthenaustpathis
total costs times
W_and total M
tawz
with