Skip to content
GATEiit

GATE CSE 2022 Q37: Counting triangles from the trace of A³

Question

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

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: D (official GATE 2022 final answer key)

Concept used: (A3)ii(A^3)_{ii} counts closed walks of length 3 from vertex ii.

First step: Count how many closed 3-walks one triangle produces: 3 starting vertices × 2 directions.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2022 CS question paper and final answer key, organised by IIT Kharagpur. Question paper · Answer key