GATE Computer ScienceHardGATE CS

A DAG has vertices 1 to 8 and edges 1→3, 2→3, 3→4, 3→5, 2→6, 6→5, 4→7, 5→7, 8→6, 1→8. How many different topological orderings does it have?

  1. A. 24
  2. B. 21
  3. C. 23
  4. D. 28

Correct answer: C. 23

Exhaustive enumeration of the 8! permutations that respect all ten edges yields 23.

More Algorithms questions

Exams that ask this topic