Data Structures & AlgorithmsModerateGATE CS · ICPC regional
Simple undirected graph on vertices 0 to 5 with edges: 1–5, 3–4, 4–5, 0–5, 2–5, 1–3, 2–3, 3–5, 0–1. What is its chromatic number, the fewest colours that colour every vertex so that adjacent vertices get different colours?
- A. 4
- B. 6
- C. 5
- D. 3
Correct answer: D. 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.
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
- Simple undirected graph on vertices 0 to 6 with edges: 4–6, 0–4, 0–6, 3–5, 1–6, 5–6, 3–6, 1–2, 2–4. What is its chromatic number, the…
- Simple undirected graph on vertices 0 to 6 with edges: 0–4, 0–1, 1–4, 2–5, 2–4, 2–6, 4–6, 1–5, 1–6, 3–4. What is its chromatic number, the…
- Simple undirected graph on vertices 0 to 6 with edges: 5–6, 0–1, 1–2, 4–6, 1–6, 0–5, 1–5, 1–4, 0–3. What is its chromatic number, the…
- Simple undirected graph on vertices 0 to 6 with edges: 2–4, 5–6, 4–5, 3–5, 1–3, 0–3, 2–6, 2–3, 3–6, 0–5. What is its chromatic number, the…
- Simple undirected graph on vertices 0 to 5 with edges: 1–4, 1–5, 3–5, 0–5, 3–4, 2–5, 2–4, 0–3, 0–1, 4–5. What is its chromatic number, the…
- Simple undirected graph on vertices 0 to 6 with edges: 2–4, 4–5, 0–6, 1–4, 0–5, 0–2, 1–2, 3–5, 2–3, 2–5. What is its chromatic number, the…