in Databases retagged by
165 views
0 votes
0 votes

Can anyone explain how the answer is 10?

in Databases retagged by
165 views

1 Answer

0 votes
0 votes

To find TS we can break the graph into 2 parts $ABCDEF$ as one part and $FHIJ$ as the second part.

in graph $ABCDEF$ after visiting vertex $A$ we have two choice either we can visit $B,D$.if we select the vertex $B$ we have another two choice as $C,D$. now we have only 3 vertexes remaining that is $D, E,F$ out of which f comes in the last position. so 2 possibilities. in the same way if we select vertex $D$ we have only one choice that is $B$. at $B$ we have again 2 choice that  is $C,E$ we can calculate it.

 in another graph $F,H,I,J$ first and last position can be filled in one way, second and third position we have 2 choice that is either $F,H,I,J$ or $F,I,H,J$

So the number of topological sorts is as follows:

  1. $A,B,C,D,E,F,H,I,J$
  2. $A,B,C,D,E,F,I,H,J$
  3. $A,B,D,C,E,F,H,I,J$
  4. $A,B,D,C,E,F,I,H,J$
  5. $A,B,D,E,C,F,H,I,J$
  6. $A,B,D,E,C,F,I,H,J$
  7. $A,D,B,C,E,F,H,I,J$
  8. $A,D,B,C,E,F,I,H,J$
  9. $A,D,B,E,C,F,H,I,J$
  10. $A,D,B,E,C,F,I,H,J$