Professional Documents
Culture Documents
16
16
Handout Number 16
Reducibility Proof
Problem A is said to be polynomial-time reducible to Problem B if, for some xed
integer k, the following is true. Given an input I of size n for A, one can construct
eciently an input I of size nk for B such that the answer to I is YES if and only if
0
0
that the size of I is at most a polynomial function of the size of I . (In principle, the
0 0
construction needs to be doable in polynomial time, but we will not ask you to give a
proof.)
Second, you need to give a convincing argument that the answer to I is YES if and 0
to the Eulerian cycle problem. The size of G is the number of bits needed to encode V
and E , and thus at most n2 .
We construct G = (V ; E ) as an input to the Hamiltonian cycle problem as follows.
0 0 0
For each e = i; j E , construct three vertices ve;i ; ve;j ; ve ; let V be the set of all such
f g 2
0
vertices. Thus, V = 3 E 3n2 . There will be two kinds of edges in E : rst, for each
j
0
j j j
0
e E incident to i in G, create all the 2s edges among ve;i for these s e's. Note that the
2
done eciently (this last assertion you don't need to justify rigorously for this course).
It remains to show that
Claim: G has an Eulerian cycle if and only if G has a Hamiltonian cycle. 0
ek E has ik ; ik+1 as its two endpoints. Then the following is clearly a Hamiltonian
2
cycle in G (just check that all vertices in V appear, and that all consecutive vertices are
0 0
connected by edges in E ): 0
ve1 ;i1 ; ve1 ; ve1 ;i2 ; ve2 ;i2 ; ve2 ; ve2 ;i3 ; ; vem ;im ; vem ; vem;i1 ; ve1 ;i1 :
This proves the claim in one direction.
Conversely, assume that G has a Hamiltonian cycle C in which the m = E vertices
0
j j
of the form ve (e E ) appear in the circular order ve1 ; ve2 ; ; vem ; ve1 . Note that, since
2
each ve has only two edges in E , these two edges must be used in the Hamiltonian cycle
0
to enter and leave ve . Since there are only 3m vertices in V , it follows that the cycle C 0
an edge in E connecting the two vertices vet ;it ; vet+1 ;it+1 for each 1 t m, implying
0
0