Add IGraphAlg dispatch for connectivity algorithms#36
Add IGraphAlg dispatch for connectivity algorithms#36nenadilic84 wants to merge 2 commits intoJuliaGraphs:masterfrom
Conversation
New IGraphAlg methods that dispatch to the igraph C library:
- connected_components: returns component membership as Vector{Vector{Int}}
matching the Graphs.jl return format
- is_connected: checks weak connectivity via igraph_is_connected
- articulation: finds articulation points via igraph_articulation_points,
returns sorted 1-based vertex IDs
- bridges: finds bridges via igraph_bridges, converts edge IDs to
SimpleEdge pairs
All new methods accept any AbstractGraph and convert to IGraph internally,
matching the pattern of the existing diameter/radius/has_isomorph dispatch.
Tests verify output matches Graphs.jl for path, cycle, and disconnected
graphs. All 281 tests pass.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #36 +/- ##
=========================================
+ Coverage 5.29% 5.95% +0.66%
=========================================
Files 8 8
Lines 4310 4330 +20
=========================================
+ Hits 228 258 +30
+ Misses 4082 4072 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Added CHANGELOG.md entry in the latest push. Note: several CI checks fail on this PR but they are all pre-existing issues unrelated to this PR's changes:
All actual test jobs pass on all platforms and on Julia 1.10. |
|
There were a few other PRs by you on projects for which we have bounties. Some of them have received full or partial reviews over the last few month or two without a follow up from you. Of course, as a volunteer you do not owe us anything, and we are always grateful when someone contributes to our packages. However, given the lack of response, and the fact that the PRs seem to have been generated by an LLM, reviewing more of these PRs creates a very significant burden on the reviewers. Thus, I will proceed to close this PR. It is certainly possible you just happen to be too busy to respond to those PR comments right now. If that is the case, please feel free to reopen PRs you would like to pursue whenever you find some free time -- humans jumping on board to help is always appreciated. |
Summary
Adds
IGraphAlgdispatch methods for four commonly-used graph algorithms, allowing users to leverage the igraph C library's implementations via the same API pattern as the existingdiameter/radius/has_isomorphdispatches.New dispatches
connected_components(g, IGraphAlg())igraph_connected_componentsVector{Vector{Int}}is_connected(g, IGraphAlg())igraph_is_connectedBoolarticulation(g, IGraphAlg())igraph_articulation_pointsVector{Int}bridges(g, IGraphAlg())igraph_bridgesVector{SimpleEdge}All methods accept any
AbstractGraphand convert toIGraphinternally. Return types match the Graphs.jl conventions.Tests
Each new dispatch is tested against the Graphs.jl reference implementation on path graphs, cycle graphs, and disconnected graphs. All 281 tests pass.
Motivation
This addresses part of JuliaGraphs/Graphs.jl#446: "Dispatch from operations defined in Graphs to igraph implementation."