Data Structures & AlgorithmsHardGATE CS · ICPC regional

Simple undirected graph on vertices 0 to 6 with edges: 1–4, 3–4, 4–6, 0–2, 4–5, 0–3, 2–4, 2–3, 1–5, 2–6. What is its chromatic number, the fewest colours that colour every vertex so that adjacent vertices get different colours?

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

Correct answer: C. 3

An exhaustive search finds 3 colours suffice and are necessary. Colouring greedily in index order uses 4 colours, and the clique number 3 gives only a lower bound.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic