Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@0xsatoshi99
Copy link
Contributor

Summary

Adds Articulation Points (cut vertices) algorithm to find critical vertices in undirected graphs.

Algorithm

An articulation point is a vertex whose removal increases the number of connected components. Uses DFS-based approach:

  • Time: O(V + E)
  • Space: O(V)

Features

  • Find() - Returns all articulation points
  • IsArticulationPoint() - Checks specific vertex
  • Count() - Counts total points
  • Generic type support

Tests (16 cases)

  • Simple chains, triangles, star graphs
  • Bridge and disconnected graphs
  • Complex graphs with multiple points
  • Edge cases and validation

Use Cases

  • Network reliability
  • Infrastructure analysis
  • Social networks

Files

  • Algorithms/Graph/ArticulationPoints.cs (133 lines)
  • Algorithms.Tests/Graph/ArticulationPointsTests.cs (326 lines)

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

Finds articulation points (cut vertices) in undirected graphs.
An articulation point is a vertex whose removal increases connected components.

Features:
- Find all articulation points using DFS
- Check if specific vertex is articulation point
- Count total articulation points
- O(V + E) time complexity
- Works with any vertex type

Tests (16 test cases):
- Simple chains and triangles
- Star graphs
- Bridge graphs
- Disconnected graphs
- Complex graphs
- Edge cases and validation

Use Cases:
- Network reliability analysis
- Critical infrastructure identification
- Social network analysis

Files:
- Algorithms/Graph/ArticulationPoints.cs (134 lines)
- Algorithms.Tests/Graph/ArticulationPointsTests.cs (305 lines)
@0xsatoshi99 0xsatoshi99 requested a review from siriak as a code owner November 12, 2025 06:40
- Fix SA1202: Move private methods after public methods
- Fix Codacy: Rename DFS to Dfs (PascalCase)
- Fix Codacy: Reduce parameters from 8 to 4 using DfsState class
- Fix Codacy: Add else comment for back edge case
- Improve code organization and readability

All build errors and Codacy issues resolved
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.92%. Comparing base (9cf588d) to head (a1beca3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #574      +/-   ##
==========================================
+ Coverage   96.91%   96.92%   +0.01%     
==========================================
  Files         296      297       +1     
  Lines       12208    12287      +79     
  Branches     1770     1781      +11     
==========================================
+ Hits        11831    11909      +78     
  Misses        239      239              
- Partials      138      139       +1     

☔ 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.

- Add class-level documentation
- Add documentation for all properties
- Improves code documentation and resolves Codacy issue
Add explicit else clause with comment explaining no action needed for parent edges
@0xsatoshi99
Copy link
Contributor Author

@siriak Please check this PR.

@siriak siriak enabled auto-merge (squash) November 12, 2025 17:16
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 52e4ef3 into TheAlgorithms:master Nov 12, 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