Reduction: Rudrata (s,t) Path → Rudrata Cycle
The RUDRATA CYCLE problem: Given a graph, is there a cycle that passes through each vertex exactly once?
RUDRATA -PATH: Two vertices and are specified, we want a path starting at and ending at that goes through each vertex exactly once.
Reduction: maps an instance of RUDRATA - Path into an instance of RUDRATA CYCLE as follows: is simply with additional vertex and 2 additional edges .
To recover a Rudrata -path in given any Rudrata cycle in , we simply delete edges from the cycle.
To confirm the validity of this reduction, we show that it works in the case of either outcome depicted:
- When the instance of RUDRATA CYCLE has a solution
- Since the new vertex has only two neighbors,
- any Rudrata cycle in must consecutively traverse the edges and .
- The rest of the cycle then traverses every other vertex en route from to .
- Thus deleting the two edges from the Rudrata Cycle gives a Rudrata path from to in the original graph .
- Since the new vertex has only two neighbors,
- When the instance of RUDRATA CYCLE does not have a solution
- We must show that the original instance of RUDRATA -PATH cannot have a solution either.
- Usually easier to prove the contrapositive: If there is a solution of the original problem in , then there is a solution of the problem in
- Just add the two edges and to the Rudrata path to close the cycle.
- We must show that the original instance of RUDRATA -PATH cannot have a solution either.