Complete Graphs.jl AbstractGraph interface for VNGraph#18
Conversation
- Implement edges iterator (VNGraphEdgeIterator) for memory-efficient edge traversal without collecting to array - Implement outneighbors/inneighbors returning sorted 1-based indices - Fix has_edge to convert 1-based Julia indices to 0-based C indices - Add rem_edge! using graph_del_edge from C library - Add add_vertex! using graph_add_node from C library - Add copy for independent graph duplication - Fix vertices return type annotation - Add GraphsInterfaceChecker.jl compliance tests - Add comprehensive tests for edges, neighbors, mutation, copy, and round-trip consistency with various graph types
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18 +/- ##
===========================================
+ Coverage 45.90% 79.31% +33.40%
===========================================
Files 1 1
Lines 61 116 +55
===========================================
+ Hits 28 92 +64
+ Misses 33 24 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
All CI test jobs pass across all platforms (ubuntu, windows, macOS x64, macOS aarch64). The only failing check is Documentation, which is a pre-existing issue — the repository does not have a |
|
/claim #448 |
|
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
Completes the
Graphs.jlAbstractGraphinterface forVNGraph, enabling it to work with all Graphs.jl algorithms that operate through the public API. This addresses several items from the bounty checklist in JuliaGraphs/Graphs.jl#448.Changes
New interface methods:
edges(g)— memory-efficient iterator (VNGraphEdgeIterator) over edges, emitting each undirected edge once withsrc < dstoutneighbors(g, v)/inneighbors(g, v)— return sorted 1-based neighbor vectors from the C adjacency listsrem_edge!(g, e)— delegates tograph_del_edgein the C libraryadd_vertex!(g)— delegates tograph_add_nodein the C librarycopy(g)— creates an independent deep copyBug fix:
has_edge(g, s, d)was passing 1-based Julia indices directly to the 0-based C functiongraph_has_edge. Now correctly converts withs-1, d-1.Testing:
GraphsInterfaceChecker.jlcompliance tests with 10 graph instances (empty, single-vertex, random regular, cycle, path)has_edgeindexing, vertex/edge mutation, copy independence, and round-trip consistencyAll 266 tests pass locally on Julia 1.11.
Bounty checklist progress (Graphs.jl#448)