Skip to content
Official PYQ · 2022

GATE CS 2022 Q27 — Graphs: Connectivity, Matching, Colouring

Explain with AI

Consider a simple undirected unweighted graph with at least three vertices. If A\textit{A} is the adjacency matrix of the graph, then the number of 3–3–cycles in the graph is given by the trace of

Choose one option
View worked solution

Answer: D

For any adjacency matrix AA of a simple undirected graph, the (i,j)(i, j)-th entry of AkA^k represents the number of walks of length kk from vertex ii to vertex jj.

Consequently, the diagonal entry (A3)ii(A^3)_{ii} represents the number of closed walks of length 33 starting and ending at vertex ii. The trace of A3A^3 is the sum of these diagonal entries:

Tr(A3)=∑i=1n(A3)ii\text{Tr}(A^3) = \sum_{i=1}^{n} (A^3)_{ii}

Consider a single 33-cycle (triangle) containing the vertices {u,v,w}\{u, v, w\}. This cycle contributes to the following closed walks of length 33:

  • Starting at uu: u→v→w→uu \to v \to w \to u and u→w→v→uu \to w \to v \to u (22 walks)
  • Starting at vv: v→w→u→vv \to w \to u \to v and v→u→w→vv \to u \to w \to v (22 walks)
  • Starting at ww: w→u→v→ww \to u \to v \to w and w→v→u→ww \to v \to u \to w (22 walks)

Thus, each 33-cycle is counted exactly 66 times in the trace of A3A^3 (twice for each of its 33 vertices, corresponding to the two possible directions of traversal). Therefore, the number of 33-cycles is given by Tr(A3)\text{Tr}(A^3) divided by 66.

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

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