Data Structures & AlgorithmsVery hardGATE CS · Codeforces Div 2 B
An undirected graph has the vertices F, J, M, N, T, W and the edges J–F, J–W, J–T, F–W, N–T, W–M, W–T, M–T. What is its chromatic number, the least number of colours needed to colour the vertices so that adjacent vertices differ?
- A. 5
- B. 4
- C. 3
- D. 2
Correct answer: C. 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 5; the clique number 3 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 acyclic graph has the vertices B, F, M, Q, R, V, W, X and the directed edges F→M, B→F, W→M, V→R, M→Q, F→Q, V→Q, B→V, B→X, B→R…
- A tree has vertices with values in brackets: B[8], C[0], L[-3], G[-1], N[3], V[5]. The edges are B–C, B–L, C–G, G–N, B–V. A path is any…
- On an 6×6 chessboard, rows and columns are numbered 0 to 5, and squares are written (row, column). A knight moves in the usual L-shape…
- The directed acyclic graph has the vertices C, E, J, K, L, M, Q, Z and the arcs Q→C, Q→M, C→J, L→J, L→K, Q→K, E→J, M→C, M→L, M→E, Q→E…
- Starting from the integer 4, one operation either adds 1, subtracts 1, or doubles the current value. Values may be any non-negative…
- A directed graph has the vertices A, M, O, V and the arcs O→M, O→A, M→O, M→A, A→O, A→V, V→O, V→A. Count the directed Hamiltonian paths…