Consider the following directed graph:
The number of different topological orderings of the vertices of the graph is _____________.
GATE CSE 2016Algorithms › Graph AlgorithmsVerified
6
Treat the topological orderings as linear extensions of the directed graph's precedence constraints. The graph forces vertex a to precede all others and vertex f to follow all others, reducing the problem to interleaving the two ordered pairs (b < c) and (d < e).
The graph has two independent precedence chains among the middle vertices, b before c and d before e, with a forced first and f forced last. Their interleavings give 4!/(2!2!) = 6 topological orderings.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.