Skip to content
Official PYQ · 2022

GATE CS 2022 Q42 — Graphs: Connectivity, Matching, Colouring

Explain with AI

Which of the properties hold for the adjacency matrix AA of a simple undirected unweighted graph having nn vertices?

Choose one option
View worked solution

Answer: A

Let us analyze each option for a simple undirected unweighted graph with nn vertices and adjacency matrix AA:

  1. Option A is correct: The (i,i)(i, i)-th diagonal entry of A2A^2 is given by:(A2)ii=∑k=1nAikAki(A^2)_{ii} = \sum_{k=1}^{n} A_{ik} A_{ki}Since the graph is undirected, AA is symmetric (Aik=AkiA_{ik} = A_{ki}). Since it is unweighted, Aik∈{0,1}A_{ik} \in \{0, 1\}, which means Aik2=AikA_{ik}^2 = A_{ik}. Thus:(A2)ii=∑k=1nAik2=∑k=1nAik=deg(vi)(A^2)_{ii} = \sum_{k=1}^{n} A_{ik}^2 = \sum_{k=1}^{n} A_{ik} = \text{deg}(v_i)This represents the degree of vertex viv_i.
  2. Option B is incorrect: For a path graph P3P_3 on n=3n=3 vertices (1−2−31 - 2 - 3), the graph is connected. Here, An−1+In=A2+I3A^{n-1} + I_n = A^2 + I_3. The entry (A2+I3)1,2=0(A^2 + I_3)_{1,2} = 0 because there is no walk of length 22 or 00 between vertex 11 and vertex 22.
  3. Option C is incorrect: Let n=4n=4. Consider a graph consisting of a triangle C3C_3 and one isolated vertex. The number of edges is 33, so the sum of all elements of AA is 2×3=6≤2(4−1)=62 \times 3 = 6 \le 2(4-1) = 6. However, the graph contains a cycle.
  4. Option D is incorrect: Consider a disconnected graph consisting of two disjoint edges K2∪K2K_2 \cup K_2 (n=4n=4). Every vertex has degree 11, so every row and column of AA contains exactly one 11, yet the graph is disconnected.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Graphs: Connectivity, Matching, Colouring questions