IAE Academy

GATE 2022 CS Q.52: solution and answer

GATE 2022 · CSQ.52 · 2 marks · MSQ

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

  1. (A)

    The diagonal entries of are the degrees of the vertices of the graph.

  2. (B)

    If the graph is connected, then none of the entries of can be zero.

  3. (C)

    If the sum of all the elements of is at most , then the graph must be acyclic.

  4. (D)

    If there is at least a 1 in each of 's rows and columns, then the graph must be connected.

See the question in the paper

Answer and solution

ANSWER

Only option (A) holds: the diagonal entries of are the vertex degrees.

Official answer: ASource: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. (A) For a simple undirected graph, is symmetric with entries or and zero diagonal. So , which is the number of neighbours of vertex , i.e. its degree. True.

  2. (B) counts walks of exactly edges, not of at most edges. In a bipartite graph the parity of a walk's length between two vertices is fixed by which sides they lie on.

  3. Counterexample for (B): the path has and is connected. Every walk from to has odd length, so . Also , so . A zero entry exists, so (B) is False.

  4. (C) The sum of all entries of is , so the condition says . This does not force acyclicity: a triangle plus one isolated vertex has and , yet it contains a cycle. False.

  5. (D) A in every row means no vertex is isolated. It does not imply connectivity: two disjoint edges on vertices have no zero row or column, but the graph has components. False.

  6. Only (A) holds.

KEY IDEA

counts walks of exactly edges. counts closed walks of length 2, which are the edges at , so it equals the degree. The other three statements each fail on a small graph.

WATCH OUT FOR

Reading as "walks of at most edges" and so concluding that connected means no zero entries. only counts walks of exactly edges, so parity can leave zeros (for example in a path). Another slip is treating "at most edges" or "no isolated vertex" as enough for acyclic or connected.

From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 14 Graph theory questions, with notes

More Graph theory questions