GATE / CS ARCHIVE

GATE CSE 2016 SET 1 / QUESTION 11

GATE CSE 2016 Set 1 Q11

Algorithms · Graph Algorithms · Full GATE CSE 2016 Set 1 paper

GATE 2016 Set 1, Q11 1 mark · NAT
Report issue

Graph Algorithms

Question 11, GATE 2016: Count the topological orders of the directed graph with vertices {a,b,c,d,e,f} and exactly the edges a→b, b→c, c→f, a→d, d→e, e→f. These two directed branches are the complete content of the source diagram.
Tap to enlarge
Answer & solution

Official answer: 6.0 : 6.0

Our answer: 6

Step through it (8 steps)

The graph consists of a→b→c→f and a→d→e→f. Vertex a must come first and f last. Interleave the two ordered middle chains(b, c) and(d, e), choosing their two positions among four: C(4, 2)=6.

After fixing a and f, the middle orders are bcde, bdce, bdec, dbce, dbec, debc. Each respects b before c and d before e. Choosing the two positions occupied by b,c determines the remaining positions for d,e, giving the binomial coefficient without listing all 4! permutations. A topological order need not follow a single path; it is any ordering in which every directed edge points forward.

Original paper, page 6 · Answer key