Data Structures & AlgorithmsVery hardCodeforces Div 2 C · GATE CS

An undirected graph has the vertices B, C, D, E, I, M, R, S, V and the edges S–B, I–M, I–V, R–M, R–D, R–V, R–C, D–C, V–C, E–B, B–C. What is the size of a maximum independent set (a largest set of vertices with no edge between any two of them)?

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

Correct answer: D. 5

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic