GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 5

Invalid topological order

Algorithms · Graph Algorithms · Full GATE CSE 2007 paper

GATE 2007, Q5 1 mark · MCQ
Report issue

Graph Algorithms

Question 5, GATE 2007: The directed acyclic graph has V={1,2,3,4,5,6} and edges 1→2, 1→3, 2→4, 3→4, 2→5, 4→5, 3→6, 4→6. Which sequence is NOT a topological ordering?
Options:
(A) 1,2,3,4,5,6
(B) 1,3,2,4,5,6
(C) 1,3,2,4,6,5
(D) 3,2,4,1,6,5
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (4 options)

1. Approach. A topological ordering places the tail of every directed edge before its head. It suffices to find one violated edge to reject an ordering.

2. Derivation and interpretation. The figure has 1→2 and 1→3, then 2,3 preceding 4 and 4 preceding 5,6. A topological ordering must place 1 before 2 and 3. D begins 3,2,4,1 and violates both outgoing constraints from 1; A,B,C respect the displayed edges. Thus D.

Original paper, page 2