Data Structures & AlgorithmsHardCodeforces Div 2 C · GATE CS

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

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

Correct answer: D. 3

Exhaustive search over subsets gives 3. Picking the currently lowest-degree vertex and deleting its neighbourhood (a common heuristic) gives 2, 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