Consider the directed acyclic graph (DAG) below. Which of the following is/are valid vertex orderings that can be obtained from a topological sort of the DAG?
Tap to open full sizeFigure description
A DAG on seven labelled circular nodes P, R, Q, S, V, U, T. Directed edges: P -> Q, R -> Q (P and R sit at the top, both pointing down into Q); Q -> S and Q -> V (S on the lower left, V on the lower right); S -> U (U directly below S); V -> T (T directly below V). There are six edges in total.
- (A)
P Q R S T U V
- (B)
P R Q V S U T
- (C)
P Q R S V U T
- (D)
P R Q S V T U