IAE Academy

GATE 2022 CS Q.37: solution and answer

GATE 2022 · CSQ.37 · 2 marks · MCQ

Consider a simple undirected unweighted graph with at least three vertices. If is the adjacency matrix of the graph, then the number of 3-cycles in the graph is given by the trace of

  1. (A)

  2. (B)

    divided by 2

  3. (C)

    divided by 3

  4. (D)

    divided by 6

See the question in the paper

Answer and solution

ANSWER

The number of 3-cycles equals , so the answer is option (D).

Official answer: DSource: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. The entry counts the closed walks of length that start and end at vertex , because counts walks of length from to .

  2. So is the total number of closed walks of length 3, summed over all starting vertices.

  3. In a simple graph there are no loops and no multi-edges. A closed walk then needs , and . So it is a triangle on three distinct vertices.

  4. Each triangle gives choices of starting vertex and directions of travel. That is closed walks.

  5. Hence .

  6. Check on : has eigenvalues . So , which is triangle times .

  7. The number of 3-cycles is , which is option (D).

KEY IDEA

counts closed walks of length 3. In a simple graph each triangle contributes exactly of them, so divide the trace by 6.

WATCH OUT FOR

Dividing by 3 and forgetting the two directions of travel. Dividing by 2 and forgetting the three choices of starting vertex. Both give the wrong count.

From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 14 Graph theory questions, with notes

More Graph theory questions