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
- (A)
- (B)
divided by 2
- (C)
divided by 3
- (D)
divided by 6
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
divided by 2
divided by 3
divided by 6
ANSWER
The number of 3-cycles equals , so the answer is option (D).
Official answer: DSource: Official answer key, GATE 2022 CS (IIT Kharagpur)
The entry counts the closed walks of length that start and end at vertex , because counts walks of length from to .
So is the total number of closed walks of length 3, summed over all starting vertices.
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.
Each triangle gives choices of starting vertex and directions of travel. That is closed walks.
Hence .
Check on : has eigenvalues . So , which is triangle times .
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