Consider the DAG with shown below.

Which of the following is not a topological ordering?
View worked solution
Answer: D
In the given Directed Acyclic Graph (DAG), the directed edges are:
- and
- and
- and
A topological ordering of a DAG is a linear ordering of its vertices such that for every directed edge , vertex comes before in the ordering.
From the edge constraints:
- Since there are directed edges and , vertex must appear before both and .
- Since there are directed edges and , both and must appear before .
Looking at Option D: 3 2 4 1 6 5
Here, vertex appears after , , and . This violates the dependency constraints and . Therefore, this is not a valid topological ordering.
Free practice · Your answers on this page are not saved.
