The GATE Grind

GATE 2022 CS – Question 37

Engineering Mathematics · Discrete Mathematics: Graphs (Connectivity, Matching, Colouring) · 2 marks · Multiple choice

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

  1. $A^3$
  2. $A^3$ divided by 2
  3. $A^3$ divided by 3
  4. $A^3$ divided by 6

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) $A^3$ divided by 6

Explanation

$tr(A^3)$ counts closed walks of length 3. Each triangle is counted 6 times (3 starting vertices × 2 directions), so the number of triangles is $tr(A^3)/6$.