Machine-translated by Google. Questions are authored in English.
Top

Discussion

Let P\(_{1}\) be the problem of finding a Hamiltonian cycle in a graph G and P\(_{2}\) be the problem of determining if a Hamiltonian cycle exists in a graph. Which one of the following is true ?

  • A.Both P\(_{1}\) and P\(_{2}\) are NP-Hard
  • B.P\(_{1}\) is NP-Hard, but P\(_{2}\) is not
  • C.P\(_{2}\) is NP-Hard, but P\(_{1}\) is not
  • D.Neither P\(_{1}\) nor P\(_{2}\) is NP-Hard

Answer: A

Both P\(_{1}\) and P\(_{2}\) are NP-hard.

P\(_{2}\), deciding whether a Hamiltonian cycle exists, is a classic NP-complete problem, so it is NP-hard.

P\(_{1}\), finding a Hamiltonian cycle, is at least as hard: any algorithm that finds a cycle also decides whether one exists (it either returns a cycle or reports none). So P\(_{2}\) reduces to P\(_{1}\), and P\(_{1}\) is NP-hard too. That rules out every option denying NP-hardness to either.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.