Data Structures & AlgorithmsHardGATE CS · ICPC regional

An undirected graph has the vertices C, D, F, K, W, Y and the edges D–W, D–F, D–Y, D–K, W–Y, C–Y, C–K, F–Y, Y–K. What is its chromatic number, the least number of colours needed to colour the vertices so that adjacent vertices differ?

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

Correct answer: A. 3

Searching colour counts from 1 upward finds 3 colours suffice and one fewer does not. Greedy colouring in label order uses 3, and the maximum degree bound gives 6; the clique number 3 is only a lower bound.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic