1,033 views
2 votes
2 votes
Will the topological order for acyclic graph through indegree Elimination method and DFS method be same.

Please answer the above question ?

1 Answer

3 votes
3 votes

Take this  graph, in this if we apply topological ordering, then 0 can't come before 4 or 5, BUT if we apply DFS 0 can come before them. What i mean is if we start topological ordering with vertex 5 then one of many order will be, 5,4,0,2,3,1

But if we apply DFS with 5 as start vertex then one of order  may be  5,0,2,3,1,4

So, for this graph they are not same, may be for other graph it will be same.

Related questions

20 votes
20 votes
1 answer
1
Lakshman Bhaiya asked Oct 16, 2018
5,173 views
Find the number of Topological order(sort) in the given graph?$(1)$$(2)$
1 votes
1 votes
1 answer
2
monty asked Nov 18, 2016
611 views
5 votes
5 votes
2 answers
3
imnitish asked Jul 14, 2018
841 views
Please describe in detail.
2 votes
2 votes
0 answers
4
h4kr asked Jan 10, 2023
353 views