# NP Complete

• Last Updated : 06 May, 2017

 Question 1
Assuming P != NP, which of the following is true ?
(A) NP-complete = NP

(B) NP-complete P =

(C) NP-hard = NP

(D) P = NP-complete
 A A B B C C D D
NP Complete    50 Algorithms MCQs with Answers
Discuss it

Question 1 Explanation:
The answer is B (no NP-Complete problem can be solved in polynomial time). Because, if one NP-Complete problem can be solved in polynomial time, then all NP problems can solved in polynomial time. If that is the case, then NP and P set become same which contradicts the given condition.
 Question 2
Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and S is polynomial-time reducible to R. Which one of the following statements is true? (GATE CS 2006)
 A R is NP-complete B R is NP-hard C Q is NP-complete D Q is NP-hard
NP Complete
Discuss it

Question 2 Explanation:
(A) Incorrect because R is not in NP. A NP Complete problem has to be in both NP and NP-hard. (B) Correct because a NP Complete problem S is polynomial time educable to R. (C) Incorrect because Q is not in NP. (D) Incorrect because there is no NP-complete problem that is polynomial time Turing-reducible to Q.
 Question 3
Let X be a problem that belongs to the class NP. Then which one of the following is TRUE?
 A There is no polynomial time algorithm for X. B If X can be solved deterministically in polynomial time, then P = NP. C If X is NP-hard, then it is NP-complete. D X may be undecidable.
NP Complete
Discuss it

Question 3 Explanation:
(A) is incorrect because set NP includes both P(Polynomial time solvable) and NP-Complete . (B) is incorrect because X may belong to P (same reason as (A)) (C) is correct because NP-Complete set is intersection of NP and NP-Hard sets. (D) is incorrect because all NP problems are decidable in finite set of operations.
 Question 4
The problem 3-SAT and 2-SAT are
 A both in P B both NP complete C NP-complete and in P respectively D undecidable and NP-complete respectively
NP Complete
Discuss it

Question 4 Explanation:
The Boolean satisfiability problem (SAT) is a decision problem, whose instance is a Boolean expression written using only AND, OR, NOT, variables, and parentheses. The problem is: given the expression, is there some assignment of TRUE and FALSE values to the variables that will make the entire expression true? A formula of propositional logic is said to be satisfiable if logical values can be assigned to its variables in a way that makes the formula true. 3-SAT and 2-SAT are special cases of k-satisfiability (k-SAT) or simply satisfiability (SAT), when each clause contains exactly k = 3 and k = 2 literals respectively. 2-SAT is P while 3-SAT is NP Complete. (See this for explanation) References: http://en.wikipedia.org/wiki/Boolean_satisfiability_problem
 Question 5
Which of the following statements are TRUE? (1) The problem of determining whether there exists a cycle in an undirected graph is in P. (2) The problem of determining whether there exists a cycle in an undirected graph is in NP. (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.
 A 1, 2 and 3 B 1 and 3 C 2 and 3 D 1 and 2
NP Complete
Discuss it

Question 5 Explanation:
1 is true because cycle detection can be done in polynomial time using DFS (See this). 2 is true because P is a subset of NP. 3 is true because NP complete is also a subset of NP and NP means Non-deterministic Polynomial time solution exists. (See this)
 Question 6
Which of the following is true about NP-Complete and NP-Hard problems.
 A If we want to prove that a problem X is NP-Hard, we take a known NP-Hard problem Y and reduce Y to X B The first problem that was proved as NP-complete was the circuit satisfiability problem. C NP-complete is a subset of NP Hard D All of the above E None of the above
NP Complete    50 Algorithms MCQs with Answers
Discuss it

Question 6 Explanation:
 Question 7
Which of the following statements are TRUE?
```1. The problem of determining whether there exists
a cycle in an undirected graph is in P.
2. The problem of determining whether there exists
a cycle in an undirected graph is in NP.
3. If a problem A is NP-Complete, there exists a
non-deterministic polynomial time algorithm to solve A. ```
 A 1, 2 and 3 B 1 and 2 only C 2 and 3 only D 1 and 3 only
GATE CS 2013    NP Complete
Discuss it

Question 7 Explanation:
1. We can either use BFS or DFS to find whether there is a cycle in an undirected graph. For example, see DFS based implementation to detect cycle in an undirected graph. The time complexity is O(V+E) which is polynomial. 2. If a problem is in P, then it is definitely in NP (can be verified in polynomial time). See NP-Completeness 3. True. See See NP-Completeness
 Question 8
Suppose a polynomial time algorithm is discovered that correctly computes the largest clique in a given graph. In this scenario, which one of the following represents the correct Venn diagram of the complexity classes P, NP and NP Complete (NPC)?
 A A B B C C D D
GATE-CS-2014-(Set-1)    NP Complete
Discuss it

Question 8 Explanation:
Clique is an NP complete problem. If one NP complete problem can be solved in polynomial time, then all of them can be. So NPC set becomes equals to P.
 Question 9
Consider the decision problem 2CNFSAT defined as follows:
 A NP-Complete. B solvable in polynomial time by reduction to directed graph reachability. C solvable in constant time since any input instance is satisfiable. D NP-hard, but not NP-complete.
GATE-CS-2014-(Set-3)    NP Complete
Discuss it

Question 9 Explanation:
2CNF-SAT can be reduced to strongly connected components problem. And strongly connected component has a polynomial time solution. Therefore 2CNF-SAT is polynomial time solvable. See https://en.wikipedia.org/wiki/2-satisfiability#Strongly_connected_components for details. As a side note, 3CNFSAT is NP Complete problem.
 Question 10
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?
 A Both DHAM3 and SHAM3 are NP-hard B SHAM3 is NP-hard, but DHAM3 is not C DHAM3 is NP-hard, but SHAM3 is not D Neither DHAM3 nor SHAM3 is NP-hard
GATE-CS-2006    NP Complete    50 Algorithms MCQs with Answers
Discuss it

Question 10 Explanation:
The problem of finding whether there exist a Hamiltonian Cycle or not is NP Hard and NP Complete Both. Finding a Hamiltonian cycle in a graph G = (V,E) with V divisible by 3 is also NP Hard.
There are 19 questions to complete.
My Personal Notes arrow_drop_up

Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.