Skip to content

Complete Graphs.jl AbstractGraph interface for VNGraph#18

Closed
nenadilic84 wants to merge 1 commit into
JuliaGraphs:masterfrom
nenadilic84:feat/complete-graphs-api
Closed

Complete Graphs.jl AbstractGraph interface for VNGraph#18
nenadilic84 wants to merge 1 commit into
JuliaGraphs:masterfrom
nenadilic84:feat/complete-graphs-api

Conversation

@nenadilic84
Copy link
Copy Markdown

Summary

Completes the Graphs.jl AbstractGraph interface for VNGraph, 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 with src < dst
  • outneighbors(g, v) / inneighbors(g, v) — return sorted 1-based neighbor vectors from the C adjacency lists
  • rem_edge!(g, e) — delegates to graph_del_edge in the C library
  • add_vertex!(g) — delegates to graph_add_node in the C library
  • copy(g) — creates an independent deep copy

Bug fix:

  • has_edge(g, s, d) was passing 1-based Julia indices directly to the 0-based C function graph_has_edge. Now correctly converts with s-1, d-1.

Testing:

  • GraphsInterfaceChecker.jl compliance tests with 10 graph instances (empty, single-vertex, random regular, cycle, path)
  • Manual tests for edge iteration, neighbor access, has_edge indexing, vertex/edge mutation, copy independence, and round-trip consistency

All 266 tests pass locally on Julia 1.11.

Bounty checklist progress (Graphs.jl#448)

  • Complete Graph API support for VNGraph types
  • Use GraphsInterfaceChecker.jl in the test suite
  • Fast conversion and/or views (existing slow converters unchanged for now)
  • Dispatch from operations to very_nauty implementation (planned for follow-up PR)
  • Declare missing algorithms in Graphs.jl (planned for follow-up PR)

- 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
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.31%. Comparing base (b1faf64) to head (0b1eaf8).
⚠️ Report is 12 commits behind head on master.

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

@nenadilic84
Copy link
Copy Markdown
Author

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 docs/make.jl file for Documenter.jl. This is unrelated to the changes in this PR.

@nenadilic84
Copy link
Copy Markdown
Author

/claim #448

@Krastanov
Copy link
Copy Markdown
Member

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.

@Krastanov Krastanov closed this Apr 21, 2026
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