Data Structures & AlgorithmsHardGATE CS · ICPC regional
An undirected graph has the vertices B, D, E, F, I, M, X and the edges M–E, M–X, M–D, M–B, M–F, E–X, E–D, E–I, X–D, X–B, D–F, B–I, F–I. What is its chromatic number, the least number of colours needed to colour the vertices so that adjacent vertices differ?
- A. 3
- B. 4
- C. 5
- D. 6
Correct answer: B. 4
Searching colour counts from 1 upward finds 4 colours suffice and one fewer does not. Greedy colouring in label order uses 4, and the maximum degree bound gives 6; the clique number 4 is only a lower bound.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- A directed weighted graph has the arcs u→v (weight): Y→K (14), Y→Q (6), K→L (4), K→T (5), L→Q (8), D→Y (3), D→Q (11), D→T (3), Q→Y (12)…
- Each cell of a grid with 3 rows and 4 columns has an arrow: R = right, L = left, U = up, D = down. UURD DLRU LRUU From a cell you may move…
- A grid has 3 rows and 4 columns with these values (top to bottom): 4179 9341 9892 A path moves between side-adjacent cells (up, down, left…
- Two unmarked jugs hold 4 litres and 5 litres. Allowed operations: fill a jug completely, empty a jug completely, or pour one jug into the…
- A directed graph has the vertices J, K, L, R, W and the arcs W→K, W→L, W→J, K→W, K→L, K→R, L→W, L→K, L→J, J→L, R→K, R→J. Count the…
- The directed acyclic graph has the vertices C, I, J, R, Y, Z and the arcs C→R, Z→J, R→Y, I→Z, Z→Y, C→Y, Z→C, Y→J, I→C, I→J, Z→R, R→J. How…