Consider the following two problems of graph.
1) Given a graph, find if the graph has a cycle that visits every vertex exactly once except the first visited vertex which must be visited again to complete the cycle.
2) Given a graph, find if the graph has a cycle that visits every edge exactly once.
Which of the following is true about above two problems.
(A) Problem 1 belongs NP Complete set and 2 belongs to P
(B) Problem 1 belongs to P set and 2 belongs to NP Complete set
(C) Both problems belong to P set
(D) Both problems belong to NP complete set
Answer: (A)
Explanation: Problem 1 is Hamiltonian Cycle problem which is a famous NP Complete problem.
Problem 2 is Euler Circuit problem which is solvable in Polynomial time.
Quiz of this Question