GateAI
Graph Traversals

GATE CSE 2025 Set 1 · Q43

MCQ2 marksMedium

Time

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 \neq v, be 30. Let TT be any breadth-first-search tree of GG. Which ONE of the given options is CORRECT for every such graph GG?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) The height of T is at least 15.

Graph Traversals

The diameter of the graph GG is given as:

diam(G)=max⁡u,v∈Vd(u,v)=30\text{diam}(G) = \max_{u, v \in V} d(u, v) = 30

Let rr be the root vertex chosen to start the Breadth-First Search (BFS). In a BFS tree TT rooted at rr, the depth (level) of any vertex vv corresponds to the shortest path distance from rr to vv, i.e., d(r,v)d(r, v).

The height of the BFS tree TT is the maximum distance from the root rr to any vertex in the graph:

h(T)=max⁡v∈Vd(r,v)h(T) = \max_{v \in V} d(r, v)

By the triangle inequality for shortest path distances in an undirected graph, for any pair of vertices u,v∈Vu, v \in V:

d(u,v)≤d(u,r)+d(r,v)d(u, v) \le d(u, r) + d(r, v)

Since d(u,r)≤h(T)d(u, r) \le h(T) and d(r,v)≤h(T)d(r, v) \le h(T), we have:

d(u,v)≤2h(T)d(u, v) \le 2 h(T)

Taking the maximum over all pairs (u,v)(u, v):

diam(G)≤2h(T)  ⟹  30≤2h(T)  ⟹  h(T)≥15\text{diam}(G) \le 2 h(T) \implies 30 \le 2 h(T) \implies h(T) \ge 15

Depending on the choice of the root rr, the height h(T)h(T) can range from ⌈30/2⌉=15\lceil 30/2 \rceil = 15 (if rr is a central vertex) up to 3030 (if rr is an eccentric peripheral vertex). Thus, the height of TT is always at least 1515.

Hence, option C is correct.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Graph Traversals previous year question is Q43 of the GATE CSE 2025 Set 1 paper. Find more GATE CSE PYQs on Graph Traversals in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Graph Traversals PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Graph Traversals in GATE CSE

Graph Traversals has 16 GATE CSE PYQs across 12 papers from 2014 to 2026. 2 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2025 Set 1.

How GATE tests Graph Traversals

More from GATE CSE 2025 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 1 · Q43 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.