Given the following statements :
$S_{1}$ : The subgraph-isomorphism problem takes two graphs $G_{1}$ and $G_{2}$ and asks whether $G_{1}$ is a subgraph of $G_{2}$ .
$S_{2}$ : The set-partition problem takes as input a set $S$ of numbers and asks whether the numbers can be partitioned into two sets $A$ and $\bar{A} = S - A$ such that$$\sum_{x \in A} x = \sum_{x \in \bar{A}} x$$Which of the following is true ?
A
$S_{1}$ is $NP$ problem and $S_{2}$ is $P$ problem.
B
$S_{1}$ is $NP$ problem and $S_{2}$ is $NP$ problem.
C
$S_{1}$ is $P$ problem and $S_{2}$ is $P$ problem.
D
$S_{1}$ is $P$ problem and $S_{2}$ is $NP$ problem.
Show the worked solutionA problem is in NP when a proposed solution can be checked in polynomial time.\(S_1\): subgraph isomorphism — given a mapping of the vertices of \(G_1\) into \(G_2\), checking that every edge maps to an edge is polynomial, so it is in NP (it is NP-complete; it contains CLIQUE as a special case).\(S_2\): set partition — given the set \(A\), comparing the two sums is polynomial, so it is in NP (it is NP-complete, a special case of subset sum).Neither is known to be in P, so both are NP problems.Answer: B
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com