Data Structures & AlgorithmsVery hardCodeforces Div 2 C · GATE CS

An undirected graph has the vertices D, E, H, K, L, Q, V, Z and the edges Q–H, Q–V, Q–K, L–Z, L–D, E–V, E–K, Z–V, Z–K, H–K, V–D. What is the size of a maximum independent set (a largest set of vertices with no edge between any two of them)?

  1. A. 3
  2. B. 6
  3. C. 4
  4. D. 5

Correct answer: C. 4

Exhaustive search over subsets gives 4. Picking the currently lowest-degree vertex and deleting its neighbourhood (a common heuristic) gives 3, and n minus the maximum matching gives 4, which is not a general identity.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic