8000 feat: Add kosajura algorithm for finding strong connected components by caojoshua · Pull Request #218 · TheAlgorithms/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

feat: Add kosajura algorithm for finding 8000 strong connected components #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2023

Conversation

caojoshua
Copy link
Contributor

See https://en.wikipedia.org/wiki/Kosaraju%27s_algorithm

I found a couple of articles online that suggest that the space complexity is O(V), for creating a the visited array and priority stack. I think it should actually be O(V + E), because the transposed graph needs to hold E edges. I think my analysis is correct, but have not found any sources online to confirm it.

Copy link
Contributor
@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution. Your space complexity analysis is correct, the transposed graph requires O(V + E) space in this implementation. (Other graph data structures might store both in- and out-edges for each node, hence not needing auxiliary space for the transposition.)

@raklaptudirm raklaptudirm merged commit 6e78b6c into TheAlgorithms:master Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0