next up previous
Next: About this document

 COS 341, November 12, 1997

Handout Number 16

Reducibility Proof

Problem A is said to be polynomial-time reducible to Problem B if, for some fixed integer k, the following is true. Given an input I of size n for A, one can construct efficiently an input I' of size tex2html_wrap_inline112 for B such that the answer to I' is YES if and only if the answer to I is YES.

In this course when you are asked to show that A is polynomial-time reducible to B, we do not require a proof with complete details. However, it should contain at least the following elements.

First, the construction of I' from I should be unambiguous, and it has to be convincing that the size of I' is at most a polynomial function of the size of I'. (In principle, the 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 only if the answer to I is YES.

As an example, we show that the Eulerian cycle problem is polynomial-time reducible to the Hamiltonian cycle problem. Let G=(V, E) be a graph where |V|=n be the input to the Eulerian cycle problem. The size of G is the number of bits needed to encode V and E, and thus at most tex2html_wrap_inline140 .

We construct G' = (V',E') as an input to the Hamiltonian cycle problem as follows. For each tex2html_wrap_inline144 , construct three vertices tex2html_wrap_inline146 ; let V' be the set of all such vertices. Thus, tex2html_wrap_inline150 . There will be two kinds of edges in E': first, for each tex2html_wrap_inline144 , create two edges tex2html_wrap_inline156 , tex2html_wrap_inline158 ; second, for each tex2html_wrap_inline160 , if there are s tex2html_wrap_inline164 incident to i in G, create all the tex2html_wrap_inline170 edges among tex2html_wrap_inline172 for these s e's. Note that the size of G' is at most tex2html_wrap_inline180 . Furthermore, the construction of G' can be done efficiently (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.

Let m = |E|. Suppose G has an Eulerian cycle tex2html_wrap_inline192 where tex2html_wrap_inline194 has tex2html_wrap_inline196 as its two endpoints. Then the following is clearly a Hamiltonian cycle in G' (just check that all vertices in V' appear, and that all consecutive vertices are connected by edges in E'):

displaymath100

This proves the claim in one direction.

Conversely, assume that G' has a Hamiltonian cycle C in which the m=|E| vertices of the form tex2html_wrap_inline210 ( tex2html_wrap_inline164 ) appear in the circular order tex2html_wrap_inline214 . Note that, since each tex2html_wrap_inline210 has only two edges in E', these two edges must be used in the Hamiltonian cycle to enter and leave tex2html_wrap_inline210 . Since there are only 3m vertices in V', it follows that the cycle C must be of the form

displaymath101

where tex2html_wrap_inline194 has tex2html_wrap_inline230 as its two endpoints in G. By definition of cycle, there must be an edge in E' connecting the two vertices for each tex2html_wrap_inline238 , implying that tex2html_wrap_inline240 . But this means that tex2html_wrap_inline192 is an Eulerian cycle in G. This proves the other direction.



next up previous
Next: About this document

Andrew Yao
Tue Nov 11 18:30:29 EST 1997