GateAI
Graph Traversals

GATE CSE 2014 Set 1 · Q13

MCQ1 markEasy

Time

Consider the directed graph given below. Which one of the following is TRUE?

GATE CSE 2014 Set 1 Q13 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) Both PSRQ and SPRQ are topological orderings.

Graph Traversals

Let us analyze the dependencies (directed edges) in the given DAG:

  • Edges from PP: P→QP \to Q, P→RP \to R

  • Edges from SS: S→QS \to Q, S→RS \to R

  • Edges from RR: R→QR \to Q

In-degrees of vertices:

  • in-degree(P)=0\text{in-degree}(P) = 0

  • in-degree(S)=0\text{in-degree}(S) = 0

  • in-degree(R)=2\text{in-degree}(R) = 2 (predecessors: P,SP, S)

  • in-degree(Q)=3\text{in-degree}(Q) = 3 (predecessors: P,S,RP, S, R)

For a valid topological ordering:

  1. Both PP and SS must precede RR and QQ.

  2. RR must precede QQ.

Therefore, the first two vertices must be PP and SS in either order:

  • If PP is first, then SS must follow before RR, yielding: PSRQ.

  • If SS is first, then PP must follow before RR, yielding: SPRQ.

Thus, both PSRQ and SPRQ are valid topological orderings, making option (C) 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 Q13 of the GATE CSE 2014 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. 5 of them are 1-mark MCQs like this one, and GATE CSE 2014 Set 1 has 3.

How GATE tests Graph Traversals

More from GATE CSE 2014 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2014 Set 1 · Q13 · MCQ

Consider the directed graph given below. Which one of the following is TRUE?

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.