Consider the following directed graph:

The number of different topological orderings of the vertices of the graph is _____________.
View worked solution
Answer: 6
The given directed graph consists of 5 vertices with the following directed edges:
To find the number of topological orderings, we analyze the dependency constraints:
- Vertex has an in-degree of 0 and must always appear first in any topological sort.
- Once is placed, we are left with two independent parallel chains: and .
The remaining 4 positions in the topological ordering must be filled by the elements of these two chains while preserving their internal order ( before , and before ).
The number of ways to choose 2 positions out of the remaining 4 for the chain is:
Once these 2 positions are chosen, the order of and is fixed. The remaining 2 positions must be filled by and in their fixed order. Thus, there are exactly 6 different topological orderings.
Free practice · Your answers on this page are not saved.
