GATE Computer ScienceVery hardGATE CSE

A directed acyclic graph on vertices 1–6 has edges 1→3, 2→3, 3→4, 2→5, 4→6, 5→6 and 1→5. How many distinct topological orderings does it have?

  1. A. 4
  2. B. 9
  3. C. 6
  4. D. 12

Correct answer: C. 6

Counting linear extensions of the partial order (brute-force over permutations) gives 6.

More Programming and Data Structures (GATE) questions

Exams that ask this topic