-
Let SHAM3 be the problem of finding a Hamiltonian cycle in a graph G = (V, E) with |V| divisible by 3 and DHAM3 be the problem of determining if a Hamiltonian cycle exists in such graphs. Which one of the following is true?
-
- Both DHAM3 and SHAM3 are NP-hard
- SHAM3 are NP-hard but DHAM3 is not
- DHAM3 is NP-hard, and SHAM3 is not
- Neither DHAM3 nor SHAM3 is NP-hard
- Both DHAM3 and SHAM3 are NP-hard
Correct Option: A
There is a difference between SHAM3 and DHAM3 that SHAM3 is used for finding a Hamiltonian cycle in a graph but DHAM3 is the problem of determining if a graph exists in a Hamiltonian cycle. Also it is given that |V| is divisible by 3, hence the problem can be reduced from 3 SAT which further determines that SHAM3 and DHAM3 are NP hard.