Data Structures & AlgorithmsVery hardGATE CS · Codeforces Div 2 B

A tree has the vertices B, E, F, G, N, O, Q, R, S, V and the edges F–V, F–O, F–Q, Q–G, F–S, O–E, V–R, E–B, S–N. A set D dominates the tree if every vertex is in D or adjacent to a vertex in D. What is the size of a smallest dominating set?

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

Correct answer: C. 4

A tree DP (or exhaustive search) gives domination number 4: {V, Q, S, E} dominates all 10 vertices, and no 3-vertex set does because the four leaves R, G, N, B have pairwise distinct neighbours. A minimum vertex cover has size 5, a different quantity.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic