Consider a simple undirected unweighted graph with at least three vertices. If A is the adjacency matrix of the graph, then the number of 3-cycles in the graph is given by the trace of:
A. A^3
B. A^3 divided by 2
C. A^3 divided by 3
D. A^3 divided by 6
GATE 2022 · Discrete Mathematics · Graph Connectivity · medium
Answer: Number of 3-cycles = trace(A^3) / 6
Closed-walk counting via trace: trace(A^3) = sum over all vertices i of (A^3)_{ii} = total number of closed walks of length 3.
Account for overcounting in each 3-cycle: A 3-cycle {u,v,w} generates 6 walks: u-v-w-u, u-w-v-u (two from u); v-w-u-v, v-u-w-v (two from v); w-u-v-w, w-v-u-w (two from w). So number of 3-cycles = trace(A^3) / 6.