Talk:Kosaraju's algorithm

Confusion
"Aho, Hopcroft and Ullman credit it to an unpublished paper from 1978 by S. Rao Kosaraju" -- but Aho, Hopcroft and Ullman, as referenced in the article, was (apparently) published in 1974... &mdash; Matt Crypto 09:24, 16 February 2009 (UTC)

As far as I know, Kosaraju's algorithm first appeared in print in M. Sharir, "A strong-connectivity algorithm and its application in data flow analysis", Computer and Mathematics with Applications, vol 7 nr 1, pp. 67--72, 1981. Snudehygel (talk) 22:23, 8 May 2009 (UTC)
 * The source of confusion appears to be the following statement in Cormen et al. algoritms book (I have the 1990 edition of CLRS at hand). The chapter notes on "Elementary Graph Algorithms" says:
 * "The algorithm [...] is adapted from Aho, Hopcroft and Ullman [5], who credit it to S.R. Kosaraju and M. Sharir."
 * In the references section of CLRS, we find the following entry:
 * [4] Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley 1974.
 * [5] Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman. Data Structures and Algorithms. Addison-Wesley, 1983.
 * I would suggest that someone goes to a library and checks what is actually stated in reference [5]. (Sigh. I suppose that errors which cannot be verified with the aid of an internet search engine will actually never be fixed on wikipedia.) 134.176.28.77 (talk) 13:08, 10 August 2009 (UTC)
 * I checked reference 5, it says that Kosaraju discovered it in 1978 (unpublished) and that Sharir published it in the mentioned article from 1981. Nczempin (talk) 23:46, 28 January 2023 (UTC)

Text excised from 2-satisfiability
This description of the algorithm was included on the page on 2SAT, but was irrelevant there. I'll paste it here so bits of it could be integrated into this article if required. —Oliphaunt (talk) 13:21, 21 August 2013 (UTC)


 * Kosaraju's algorithm performs two depth first searches, but is very simple: the first search is used only to order the vertices, in the reverse of a postorder depth-first traversal. Then, the second pass of the algorithm loops through the vertices in this order, and for each vertex that has not already been assigned to a component, it performs a depth-first search of the transpose graph starting from that vertex, backtracking when the search reaches a previously assigned vertices; the unsassigned vertices reached by this search form a new component.

That actually gives a better description of the algorithm than the text currently in the article.130.243.83.63 (talk) 15:58, 26 November 2015 (UTC)

Incorrect claim in algo description
The article states: "so if there is a forward path from u to v then u will appear before v on the final list L (unless u and v both belong to the same strong component, in which case their relative order in L is arbitrary)."

This is not true. There is a weaker claim which is both true and sufficient to justify the algorithm correctness: If there is a path from u to v and u and v belong to different strongly connected components then there is some vertex from us strongly connected component that appears on the final list L before all vertices in vs strongly connected component. Importantly, not all vertices from us SCC need to appear on L before all vertices from vs SCC, which is implied by the original claim. Pilloff (talk) 19:13, 21 April 2022 (UTC)