GATE Computer ScienceHardGATE CS (PYQ pattern)

Assume P ≠ NP. Which of the following problems have a polynomial-time algorithm? I. 2-SAT. II. 3-colourability of a graph. III. Maximum matching in a general graph. IV. Longest simple path in a DAG. V. Minimum vertex cover in a general graph.

  1. A. I, III and IV only
  2. B. I and III only
  3. C. I, II and IV only
  4. D. III, IV and V only

Correct answer: A. I, III and IV only

2-SAT (via SCCs), general matching (Edmonds' blossom algorithm) and longest path in a DAG (DP over a topological order) are in P. 3-colourability and vertex cover are NP-complete.

More Algorithms questions

Exams that ask this topic