Add Articulation Points algorithm#574
Merged
siriak merged 4 commits intoTheAlgorithms:masterfrom Nov 12, 2025
Merged
Conversation
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)
- 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
- 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
Contributor
Author
|
@siriak Please check this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Features
Find()- Returns all articulation pointsIsArticulationPoint()- Checks specific vertexCount()- Counts total pointsTests (16 cases)
Use Cases
Files
Algorithms/Graph/ArticulationPoints.cs(133 lines)Algorithms.Tests/Graph/ArticulationPointsTests.cs(326 lines)Contribution by Gittensor, learn more at https://gittensor.io/