Consider the directed graph below given.

Which one of the following is TRUE?
View worked solution
Answer: C
The given directed graph has the following vertices and directed edges:
- Vertices:
- Edges: , , , , and
We can determine the topological orderings by analyzing the in-degrees of the vertices:
- (incoming from and )
- (incoming from , , and )
Since a topological sort must begin with a vertex of in-degree , we have two possible starting choices:
- Start with : After removing , the vertex is the only remaining vertex with an in-degree of . Removing leaves with an in-degree of , and finally is left. This gives the sequence PSRQ.
- Start with : After removing , the vertex is the only remaining vertex with an in-degree of . Removing leaves with an in-degree of , and finally is left. This gives the sequence SPRQ.
Thus, both PSRQ and SPRQ are valid topological orderings.
Free practice · Your answers on this page are not saved.
