Question

Let G(V,E)G(V, E) be an undirected and unweighted graph with 100 vertices. Let d(u,v)d(u, v) denote the number of edges in a shortest path between vertices uu and vv in VV. Let the maximum value of d(u,v)d(u, v), u,v∈Vu, v \in V such that u≠vu \ne v, be 3030. Let TT be any breadth-first-search tree of GG. Which ONE of the given options is CORRECT for every such graph GG?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2025 answer key

Solution

Apply the triangle inequality to the BFS root rr and a pair of diametrically opposite vertices x,yx, y with d(x,y)=30d(x, y) = 30.

Let x,y∈Vx, y \in V be two vertices that achieve the diameter of GG, so d(x,y)=30d(x, y) = 30. Let r∈Vr \in V be the root of the breadth-first-search (BFS) tree TT. Since BFS from rr finds shortest paths in an unweighted graph, the depth of any vertex vv in TT is d(r,v)d(r, v), and the height of TT is h(T)=max⁡v∈Vd(r,v)h(T) = \max_{v \in V} d(r, v).

By the triangle inequality:

30=d(x,y)≤d(r,x)+d(r,y)≤2max⁡(d(r,x),d(r,y))≤2h(T)30 = d(x, y) \le d(r, x) + d(r, y) \le 2 \max(d(r, x), d(r, y)) \le 2 h(T)

Dividing by 2 gives h(T)≥15h(T) \ge 15. (Depending on the choice of root rr, h(T)h(T) can be any integer from 1515 to 3030, e.g., 1515 when rr is the midpoint of a length-30 path, or 3030 when rr is an endpoint.) Thus the height of TT is at least 15.

Final answer

Option (C)

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
Question
43 of 65
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.