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
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
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
NP Complete    GATE CS 2013
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
NP Complete    GATE-CS-2014-(Set-1)
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.
NP Complete    GATE-CS-2014-(Set-3)
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
NP Complete    GATE-CS-2006
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.
 Question 11
Consider the following two problems on undirected graphs
```α : Given G(V, E), does G have an independent set of size | V | - 4?
β : Given G(V, E), does G have an independent set of size 5? ```
Which one of the following is TRUE?
 A α is in P and β is NP-complete B α is NP-complete and β is in P C Both α and β are NP-complete D Both α and β are in P
NP Complete    GATE-CS-2005
Discuss it

Question 11 Explanation:
Graph independent set decision problem is NP Complete.
 Question 12
Ram and Shyam have been asked to show that a certain problem Π is NP-complete. Ram shows a polynomial time reduction from the 3-SAT problem to Π, and Shyam shows a polynomial time reduction from Π to 3-SAT. Which of the following can be inferred from these reductions ?
 A Π is NP-hard but not NP-complete B Π is in NP, but is not NP-complete C Π is NP-complete D Π is neither NP-hard, nor in NP
NP Complete    GATE-CS-2003
Discuss it

Question 12 Explanation:
Since polynomial time reduction from the 3-SAT problem to Π is possible, it is NP hard. Since polynomial time reduction from Π to 3-SAT is possible, it is NP-Complete.
 Question 13
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
NP Complete    GATE-CS-2015 (Mock Test)
Discuss it

Question 13 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.
 Question 14
Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2. Then which one of the following is consistent with the above statement?
 A Q1 is in NP, Q2 is NP hard B Q2 is in NP, Q1 is NP hard C Both Q1 and Q2 are in NP D Both Q1 and Q2 are in NP hard
NP Complete    GATE-CS-2015 (Set 2)
Discuss it

Question 14 Explanation:
```Q1 reduces in polynomial time to 3-SAT
==> Q1 is in NP

3-SAT reduces in polynomial time to Q2
==> Q2 is NP Hard.  If Q2 can be solved in P, then 3-SAT
can be solved in P, but 3-SAT is NP-Complete, that makes
Q2 NP Hard
```
 Question 15
Language L1 is polynomial time reducible to language L2. Language L3 is polynomial time reducible to L2, which in turn is polynomial time reducible to language L4. Which of the following is/are True?
```I. If L4 ∈ P, L2 ∈ P
II. If L1 ∈ P or L3 ∈ P, then L2 ∈ P
III. L1 ∈ P, if and only if L3 ∈ P
IV. If L4 ∈ P, then L1 ∈ P and L3 ∈ P ```
 A II only B III only C I and IV only D I only
NP Complete    GATE-CS-2015 (Set 3)
Discuss it

Question 15 Explanation:
 Question 16
A problem in NP is NP-complete if
 A It can be reduced to the 3-SAT problem in polynomial time B The 3-SAT problem can be reduced to it in polynomial time C It can be reduced to any other problem in NP in polynomial time D some problem in NP can be reduced to it in polynomial time
Analysis of Algorithms    NP Complete    GATE IT 2006
Discuss it

Question 16 Explanation:
A problem in NP becomes NPC if all NP problems can be reduced to it in polynomial time. This is same as reducing any of the NPC problem to it. 3-SAT being an NPC problem, reducing it to a NP problem would mean that NP problem is NPC.   Please refer: http://www.geeksforgeeks.org/np-completeness-set-1/
 Question 17
For problems X and Y, Y is NP-complete and X reduces to Y in polynomial time. Which of the following is TRUE?
 A If X can be solved in polynomial time, then so can Y B X is NP-complete C X is NP-hard D X is in NP, but not necessarily NP-complete
NP Complete    Gate IT 2008
Discuss it

Question 17 Explanation:

In order to solve these type of questions in GATE, we will give 2 important theorems. Proofs of these is beyond the scope of this explanation. For Proofs please refer to Introduction To Algorithms by Thomas Cormen.

Theorem - 1 When a given Hard Problem (NPC, NPH and Undecidable Problems) is reduced to an unknown problem in polynomial time, then unknown problem also becomes Hard.

Case - 1  When NPC(NP-Complete) problem is reduced to unknown problem, unknown problem becomes NPH(NP-Hard).

Case - 2 When NPH(NP-Hard) problem is reduced to unknown problem, unknown problem becomes NPH(NP-Hard).

Case - 3 When undecidable problem is reduced to unknown problem, unknown problem becomes also becomes undecidable.

Remember that Hard problems needs to be converted for this theorem but not the other way.

Theorem - 2

When an unknown problem  is reduced to an  Easy problem(P or NP) in polynomial time, then unknown problem also becomes easy.

Case - 1  When an unknown problem  is reduced to a P type problem, unknown problem also becomes P.

Case - 2 When an unknown problem  is reduced to a NP type problem, unknown problem also becomes NP.

Remember that unknown problems needs to be converted for this theorem to work but not the other way.

In the given question, X which is unknown problem is reduced to NPC problem in polynomial time so Theorem - 1 will not work. But all NPC problems are also NP, so we can say that X is getting reduced to a known NP problem so that  Theorem - 2 is applicable and X is also NP. In order to make it NPC, we have to prove it NPH first which is not the case as Y is not getting reduced to X.

This solution is contributed by Pranjul Ahuja.

There are 17 questions to complete.

GATE CS Corner

See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.