in Graph Theory
131 views
1 vote
1 vote


In the above figure, how many topological sorts are possible,
I tried the following method,
if we include 5 _ _ _ _ _ for 5 space 5c3 for (2,3,1) then 2 position is 4,0 so a total of 10
if we do like 4 5 _ _ _ _ then only 4c3 
so the total is 10+4=14 but in GFG the total possible sorts are 13 can someone why this difference is coming ?
 

https://www.geeksforgeeks.org/all-topological-sorts-of-a-directed-acyclic-graph/

in Graph Theory
131 views

1 Answer

0 votes
0 votes

For the second part your logic is correct, but for case 1 i.e taking 5 before all,  you are having 1 case extra. It should be 9 cases only. 1 can not be executed before executing 4, I think that one case where 1 is executed before 4 is included in your first assumption.

1 comment

Thank you...got it
0
0
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true