IAE Academy

GATE 2023 CS Q.55: solution and answer

GATE 2023 · CSQ.55 · 2 marks · MSQ

Let be a simple, finite, undirected graph with vertex set . Let denote the maximum degree of and let denote the set of all possible colors. Color the vertices of using the following greedy strategy:

for

Which of the following statements is/are TRUE?

  1. (A)

    This procedure results in a proper vertex coloring of .

  2. (B)

    The number of colors used is at most .

  3. (C)

    The number of colors used is at most .

  4. (D)

    The number of colors used is equal to the chromatic number of .

See the question in the paper

Answer and solution

ANSWER

Statements (A) and (B) are TRUE; (C) and (D) are FALSE.

Official answer: A, BSource: Official answer key, GATE 2023 CS (IIT Kanpur)

  1. The algorithm processes vertices in a fixed order, assigning each vertex the smallest color not already used by any of its already-colored neighbours (those earlier in the order).

  2. (A) Properness: for any edge with , when is colored, is already colored, so 's rule explicitly excludes . Hence no edge is ever monochromatic, for any vertex order — the coloring produced is always proper. (A) is TRUE.

  3. (B) Bound : when is colored, its already-colored neighbours number at most (its total degree bound), so at most colors are forbidden. A color from is therefore always available, so greedy never uses more than colors. (B) is TRUE.

  4. (C) Tightness of the bound: take , so . Every vertex is adjacent to all others, so each new vertex needs a brand-new color: colors are all used, i.e. colors. So 'at most ' fails in general. (C) is FALSE.

  5. (D) Order-dependence vs. chromatic number: greedy's color count depends on the chosen vertex ordering . A bipartite graph (e.g. a crown graph, minus a perfect matching) has , but a poor ordering can force greedy to use strictly more than 2 colors. Since the number of colors used is not guaranteed to equal , (D) is FALSE.

  6. Hence the TRUE statements are exactly (A) and (B).

KEY IDEA

Sequential greedy coloring always produces a proper coloring, and it never uses more than colors — but this bound is not always tight ( alone can fail), and the actual number of colors greedy uses depends on the vertex order, so it need not equal .

WATCH OUT FOR

Confusing the proved greedy bound with a tighter, unproven bound of , and assuming the greedy result equals the chromatic number just because the algorithm is "optimal-looking" — the number of colors greedy uses is order-dependent and can exceed .

From the GATE 2023 CS paper. Every question of this paper · Download the full paper · All 8 Design techniques questions, with notes

More Design techniques questions