Consider a simple undirected unweighted graph with at least three vertices. If is the adjacency matrix of the graph, then the number of cycles in the graph is given by the trace of
View worked solution
Answer: D
For any adjacency matrix of a simple undirected graph, the -th entry of represents the number of walks of length from vertex to vertex .
Consequently, the diagonal entry represents the number of closed walks of length starting and ending at vertex . The trace of is the sum of these diagonal entries:
Consider a single -cycle (triangle) containing the vertices . This cycle contributes to the following closed walks of length :
- Starting at : and ( walks)
- Starting at : and ( walks)
- Starting at : and ( walks)
Thus, each -cycle is counted exactly times in the trace of (twice for each of its vertices, corresponding to the two possible directions of traversal). Therefore, the number of -cycles is given by divided by .
Free practice · Your answers on this page are not saved.
