Skip to content
Official PYQ · 2002

GATE CS 2002 Q1.4 — Graphs: Connectivity, Matching, Colouring

Explain with AI

The minimum number of colours required to colour the vertices of a cycle with nn nodes in such a way that no two adjacent nodes have the same colour is

Choose one option
View worked solution

Answer: D

The problem asks for the chromatic number (the minimum number of colors required for vertex coloring) of a cycle graph CnC_n with nn vertices (n≥3n \ge 3).

For any cycle graph CnC_n:

  • If nn is even, we can alternate between 22 colors. Thus, the chromatic number is χ(Cn)=2\chi(C_n) = 2.
  • If nn is odd, alternating 22 colors will result in the first and last adjacent vertices having the same color. Thus, we need a third color, making the chromatic number χ(Cn)=3\chi(C_n) = 3.

Let us evaluate the expression in Option D: n−2⌊n2⌋+2n - 2 \left\lfloor \frac{n}{2} \right\rfloor + 2

  • Case 1: nn is even
    Let n=2kn = 2k for some integer kk.
    n−2⌊n2⌋+2=2k−2⌊2k2⌋+2=2k−2k+2=2n - 2 \left\lfloor \frac{n}{2} \right\rfloor + 2 = 2k - 2 \left\lfloor \frac{2k}{2} \right\rfloor + 2 = 2k - 2k + 2 = 2This matches the required 22 colors.

  • Case 2: nn is odd
    Let n=2k+1n = 2k + 1 for some integer kk.
    n−2⌊n2⌋+2=(2k+1)−2⌊2k+12⌋+2=2k+1−2k+2=3n - 2 \left\lfloor \frac{n}{2} \right\rfloor + 2 = (2k+1) - 2 \left\lfloor \frac{2k+1}{2} \right\rfloor + 2 = 2k + 1 - 2k + 2 = 3This matches the required 33 colors.

Since Option D correctly yields 22 for even nn and 33 for odd nn, it is the correct representation.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Graphs: Connectivity, Matching, Colouring questions