Consider the DAG with Consider V = {1, 2, 3, 4, 5, 6}, shown below. Which of the following is NOT a topological ordering?
(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
Answer: (D)
Explanation:
In option D, 1 appears after 2 and 3 which is not possible in Topological Sorting. In the given DAG it is directly visible that there is an outgoing edge from vertex 1 to vertex 2 and 3 hence 2 and 3 cannot come before vertex 1 so clearly option D is an incorrect topological sort. But for questions in which it is not directly visible, we should know how to find a topological sort of a DAG.
Hence Option(D) is the correct answer.
Quiz of this Question
Please comment below if you find anything wrong in the above post
Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing
Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.
Last Updated :
14 Feb, 2018
Like Article
Save Article