Talk:Tarjan's strongly connected components algorithm

This is an old revision of this page, as edited by 211.25.51.200 (talk) at 07:05, 23 April 2008 (Created page with '== Pseudocode is not good == In this reference [http://web.cecs.pdx.edu/~herb/cs410f99/scc.htm web.cecs.pdx.edu] we see that TarjanDfs is called ''not only'' for f...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Latest comment: 17 years ago by 211.25.51.200 in topic Pseudocode is not good

Pseudocode is not good

In this reference web.cecs.pdx.edu we see that TarjanDfs is called not only for first node v0, but all nodes that are not visited. This should be fixed, I am not expert, but here is suggestion.

index = 0                       // DFS node number counter 
S = empty                       // An empty stack of nodes
for each vertex v
 if v.index is undefined
  tarjan(v)                      // Start a DFS at the start node

--211.25.51.200 (talk) 07:05, 23 April 2008 (UTC)Reply