Question
Let be an undirected unweighted connected graph. The diameter of is defined as:
Let be the adjacency matrix of .
Define graph on the same set of vertices with adjacency matrix , where
Which one of the following statements is true?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2021 answer key
Solution
Relate the shortest path lengths in G2 to the shortest path lengths in G based on paths of length at most 2.
In the graph , an edge is present if (an edge exists between and in ) OR (there is a path of length 2 between and in ).
Thus, a single edge in can traverse up to 2 edges of . If the shortest path distance between any two vertices and in is , then in one can traverse that same path taking hops of size up to 2 edges. Consequently, the shortest path distance in satisfies:
Taking the maximum over all pairs of vertices :
Hence, , which matches option A.
A
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology (CS, Set-1)
- Question
- 46 of 65, printed as CS Q.36
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.