Skip to content

Conversation

@0xsatoshi99
Copy link
Contributor

Implements Tarjan's algorithm for finding strongly connected components in directed graphs.

Features:

  • O(V + E) time complexity using DFS
  • Multiple utility methods (InSameSCC, GetSCC, BuildCondensationGraph)
  • 14 comprehensive test cases

Contribution by Gittensor, learn more at https://gittensor.io/

@0xsatoshi99 0xsatoshi99 requested a review from siriak as a code owner November 6, 2025 00:58
@siriak
Copy link
Member

siriak commented Nov 6, 2025

Please fix 17 issues Codacy found

- Add curly braces to all single-statement blocks
- Fix naming conventions: GetSCCCount -> GetSccCount, InSameSCC -> InSameScc, GetSCC -> GetScc
- Add meaningful exception message to ArgumentOutOfRangeException
- Split multi-statement lines into separate lines
- Update all test method names to match renamed methods
@0xsatoshi99
Copy link
Contributor Author

@siriak I've fixed all issues what Codacy found, please check it again, Thanks.

@siriak
Copy link
Member

siriak commented Nov 10, 2025

Please check build errors

Graph has 3 SCCs not 2:
- SCC 1: {0, 1} (cycle 0→1→0)
- SCC 2: {2} (single node)
- SCC 3: {3, 4, 5} (cycle 3→4→5→3)
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 99.13043% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.88%. Comparing base (aba01fb) to head (15dce16).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...orithms/Graph/TarjanStronglyConnectedComponents.cs 99.13% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
+ Coverage   96.87%   96.88%   +0.01%     
==========================================
  Files         290      291       +1     
  Lines       11920    12035     +115     
  Branches     1720     1740      +20     
==========================================
+ Hits        11547    11660     +113     
  Misses        237      237              
- Partials      136      138       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xsatoshi99
Copy link
Contributor Author

@siriak Seems like all tests are gone correctly. Please check it.

@siriak siriak enabled auto-merge (squash) November 10, 2025 14:48
@siriak siriak merged commit 5bcbece into TheAlgorithms:master Nov 10, 2025
4 checks passed
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