Asked By : Ronnie
Answered By : Luke Mathieson
- $f$ is computable in polynomial time.
- $a$ is a Yes-instance of $A$ if and only if $f(a)$ is a Yes-instance of $B$.
In Saeed’s proof, the function $f$ is copying the graph, adding a new vertex, adding edges between it and all other vertices in the graph and setting $k$ to the size of the initial graph plus one. This is the part that must be computable in polynomial time. It should be obvious that we can take a graph, add a vertex and some edges, and set a number pretty quickly. Certainly in polynomial time. Now we have the second part. All this says is that if there is a Hamiltonian cycle in the first graph, then there is a wheel on $k$ vertices in the second graph and vice versa. We do not have to be able to find either (in any time bound). We only need to know that if one exists, then the other does. You can prove this in any mathematically valid way. It is a purely existential statement. In practice we almost always show that knowing the solution to $f(a)$ would tell us where the solution to $a$ is, but there is no need for it to show how to find it. This is a lot like showing something is in NP using the verifier definition – we get given a solution and we have to check it. We never say where we got the solution in the first place. Reductions work similarly, we just say that if we can correctly answer Yes or No to one, we can correctly answer the other (out of $a$ and $f(a)$ – note that it doesn’t say anything about an arbitrary instance of $B$). In fact, the whole point of the reduction is to show that we can’t find a wheel subgraph in polynomial time unless P=NP.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/12009 3.2K people like this