Merged
Conversation
Finds bridges (cut edges) in undirected graphs. A bridge is an edge whose removal increases connected components. Features: - Find all bridges using DFS - Check if specific edge is a bridge - Count total bridges - O(V + E) time complexity - Works with any vertex type Tests (17 test cases): - Simple chains and triangles - Two components connected by bridge - Star graphs - Disconnected graphs - Complex graphs with cycles - Edge cases and validation Use Cases: - Network reliability analysis - Critical connection identification - Infrastructure vulnerability assessment Files: - Algorithms/Graph/Bridges.cs (177 lines) - Algorithms.Tests/Graph/BridgesTests.cs (326 lines)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #575 +/- ##
==========================================
+ Coverage 96.95% 96.96% +0.01%
==========================================
Files 299 300 +1
Lines 12527 12598 +71
Branches 1832 1842 +10
==========================================
+ Hits 12145 12216 +71
Misses 242 242
Partials 140 140 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@siriak Please check this PR when you have some time, Thanks. |
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 Bridges (cut edges) algorithm to find critical edges in undirected graphs.
Algorithm
A bridge is an edge whose removal increases the number of connected components. Uses DFS-based approach similar to Tarjan's algorithm.
Features
Find()- Returns all bridgesIsBridge()- Checks specific edgeCount()- Counts total bridgesTests (17 cases)
Use Cases
Files
Algorithms/Graph/Bridges.cs(169 lines)Algorithms.Tests/Graph/BridgesTests.cs(346 lines)Contribution by Gittensor, learn more at https://gittensor.io/