Skip to content

feat: Add Tarjan's strongly connected components algorithm #637

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
Mar 19, 2025

Conversation

TripleCamellya
Copy link
Contributor

Add Tarjan's strongly connected components algorithm.

Tarjan algorithm is another important algorithm for finding strongly connected components(SCCs) in directed graph. Comparing to Kosaraju algorithm, Tarjan doesn't need to generate transpose Graph.

Changes in PR:

  1. Implementation of Tarjan, add in strongly_connected_components.
  2. Add related tests for Tarjan.
  3. Modify original strongly_connected_components tests. I think there is no need to return components in a specific order.

@TripleCamellya
Copy link
Contributor Author

Fixes: #636

@czgdp1807 czgdp1807 enabled auto-merge (squash) March 19, 2025 05:50
@czgdp1807 czgdp1807 merged commit eb5fab1 into codezonediitj:main Mar 19, 2025
7 checks passed
@TripleCamellya TripleCamellya deleted the tarjan-scc branch March 19, 2025 05:58
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.

2 participants