Skip to content
Official PYQ · 2021

GATE CS 2021 Set 1 Q36 — Graphs: Connectivity, Matching, Colouring

Explain with AI

Let G=(V,E)G=(V, E) be an undirected unweighted connected graph. The diameter of GG is defined as:

diam(G)=max⁡u,v∈V{the length of shortest path between u and v}\text{diam}(G)=\displaystyle \max_{u,v\in V} \{\text{the length of shortest path between $u$ and $v$}\}

Let MM be the adjacency matrix of GG.

Define graph G2G_2 on the same set of vertices with adjacency matrix NN, where 

Nij={1if  Mij>0 or Pij>0, where P=M20otherwiseN_{ij}=\left\{\begin{array} {lll} 1 &\text{if}\; M_{ij}>0 \text{ or } P_{ij}>0, \text{ where }P=M^2\\0 &\text{otherwise} \end{array}\right.

Which one of the following statements is true?

Choose one option
View worked solution

Answer: A

The adjacency matrix NN of the graph G2G_2 is defined such that Nij=1N_{ij} = 1 if Mij>0M_{ij} > 0 or Pij>0P_{ij} > 0 (where P=M2P = M^2).

  • Mij>0M_{ij} > 0 means there is a path of length 11 between vertices ii and jj in GG.
  • Pij>0P_{ij} > 0 means there is a path of length 22 between vertices ii and jj in GG.

Thus, an edge exists between ii and jj in G2G_2 if and only if the shortest path distance between them in GG is at most 22.

Let dG(u,v)d_G(u, v) and dG2(u,v)d_{G_2}(u, v) denote the shortest path distances between any two vertices uu and vv in GG and G2G_2, respectively. If dG(u,v)=kd_G(u, v) = k, we can traverse this path in G2G_2 by taking leaps of distance 22 at each step. This requires at most ⌈k/2⌉\lceil k/2 \rceil steps. Therefore:

dG2(u,v)≤⌈dG(u,v)2⌉d_{G_2}(u, v) \le \left\lceil \frac{d_G(u, v)}{2} \right\rceil

Taking the maximum over all pairs u,v∈Vu, v \in V to find the diameter:

diam(G2)=max⁡u,v∈VdG2(u,v)≤⌈max⁡u,v∈VdG(u,v)2⌉=⌈diam(G)2⌉\text{diam}(G_2) = \max_{u, v \in V} d_{G_2}(u, v) \le \left\lceil \frac{\max_{u, v \in V} d_G(u, v)}{2} \right\rceil = \left\lceil \frac{\text{diam}(G)}{2} \right\rceil

Hence, diam(G2)≤⌈diam(G)/2⌉\text{diam}(G_2) \le \lceil \text{diam}(G)/2 \rceil.

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

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