2,087 views
2 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 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.

Position:
Show:

Related questions

1 1 vote
1 1 answer
94
94 views
GO Classes asked Aug 19
94 views
Let $G=(V,E)$ be a dag, where each edge is annotated with some positive length. Let $s$ be a source vertex in $G$.Suppose we run Dijkstra's algorithm to compute the dista...
0 0 votes
1 1 answer
211
211 views
GO Classes asked Jan 28
211 views
Consider a Directed Acyclic Graph (DAG) with $n$ vertices and $e$ edges. If you perform a Topological Sort on this graph, which of the following is true?THERE IS ALWAYS E...
22 22 votes
2 answers 2 answers
8.5k
8.5k views
Lakshman Bhaiya asked Oct 16, 2018
8,492 views
Find the number of Topological order(sort) in the given graph?$(1)$$(2)$
1 1 vote
1 1 answer
902
902 views
monty asked Nov 18, 2016
902 views