Top MCQs on NP Complete Complexity with Answers

Last Updated : 27 Sep, 2023

NP-complete problems are a subset of the larger class of NP (nondeterministic polynomial time) problems. NP problems are a class of computational problems that can be solved in polynomial time by a non-deterministic machine and can be verified in polynomial time by a deterministic Machine.
More on NP complete Complexity

NP Complete Complexity Quiz

NP Complete Complexity Quiz


Question 1

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

(B) NP-complete \\cap P = \\Phi

(C) NP-hard = NP

(D) P = NP-complete
 

Cross

A

Tick

B

Cross

C

Cross

D



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.

Hence (B) is the correct answer.

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)
Cross
R is NP-complete
Tick
R is NP-hard
Cross
Q is NP-complete
Cross
Q is NP-hard


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?
Cross
There is no polynomial time algorithm for X.
Cross
If X can be solved deterministically in polynomial time, then P = NP.
Tick
If X is NP-hard, then it is NP-complete.
Cross
X may be undecidable.


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

Cross

both in P

Cross

both NP complete

Tick

NP-complete and in P respectively

Cross

undecidable and NP-complete respectively



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 satisfactory if logical values can be assigned to its variables to make 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. 

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.
Tick
1, 2 and 3
Cross
1 and 3
Cross
2 and 3
Cross
1 and 2


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.
Cross
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
Cross
The first problem that was proved as NP-complete was the circuit satisfiability problem.
Cross
NP-complete is a subset of NP Hard
Tick
All of the above
Cross
None of the above


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. 
Tick
1, 2 and 3
Cross
1 and 2 only
Cross
2 and 3 only
Cross
1 and 3 only


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)? GATECS2014Q48
Cross
A
Cross
B
Cross
C
Tick
D


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: GATECS2014Q55
Cross
NP-Complete.
Tick
solvable in polynomial time by reduction to directed graph reachability.
Cross
solvable in constant time since any input instance is satisfiable.
Cross
NP-hard, but not NP-complete.


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?
Tick
Both DHAM3 and SHAM3 are NP-hard
Cross
SHAM3 is NP-hard, but DHAM3 is not
Cross
DHAM3 is NP-hard, but SHAM3 is not
Cross
Neither DHAM3 nor SHAM3 is NP-hard


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 20 questions to complete.


Share your thoughts in the comments

Similar Reads