Add VNAlgorithm dispatch for very_nauty C library algorithms#19
Open
nenadilic84 wants to merge 2 commits intoJuliaGraphs:masterfrom
Open
Add VNAlgorithm dispatch for very_nauty C library algorithms#19nenadilic84 wants to merge 2 commits intoJuliaGraphs:masterfrom
nenadilic84 wants to merge 2 commits intoJuliaGraphs:masterfrom
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
- Add VNAlgorithm dispatch type for routing algorithms to very_nauty - Dispatch is_connected(g, VNAlgorithm()) via graph_connected - Dispatch connected_components(g, VNAlgorithm()) via graph_nclusters with cluster label extraction - Add chromatic_number(g, VNAlgorithm()) for exact chromatic number - Add edge_chromatic_number(g, VNAlgorithm()) for exact edge chromatic number - Add clique_number(g, VNAlgorithm()) for exact clique number - Auto-conversion: all methods accept any AbstractGraph, converting to VNGraph internally when needed - Comprehensive tests for all algorithms with known graph properties
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19 +/- ##
===========================================
+ Coverage 45.90% 86.52% +40.62%
===========================================
Files 1 1
Lines 61 141 +80
===========================================
+ Hits 28 122 +94
+ Misses 33 19 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
All CI test jobs pass across all platforms (ubuntu, windows, macOS x64, macOS aarch64). The only failing check is Documentation — same pre-existing issue as PR #18 (no |
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 a
VNAlgorithmdispatch type that routes graph algorithms to the very_nauty C library implementation, following the pattern specified in JuliaGraphs/Graphs.jl#448.New API
Design
VNAlgorithmis an exported dispatch typeAbstractGraphand auto-convert toVNGraphinternally when neededis_connectedandconnected_componentsextend existingGraphs.jlfunctionschromatic_number,edge_chromatic_number, andclique_numberare new functions exported from VNGraphs (these algorithms don't exist in Graphs.jl yet)Algorithms dispatched
Graphs.is_connected(g, ::VNAlgorithm)graph_connectedGraphs.connected_components(g, ::VNAlgorithm)graph_nclusters+ cluster labelsVector{Vector{Int}}chromatic_number(g, ::VNAlgorithm; timeout=0)graph_chromatic_numberedge_chromatic_number(g, ::VNAlgorithm; timeout=0)graph_edge_chromatic_numberclique_number(g, ::VNAlgorithm)graph_clique_numberBounty checklist progress (Graphs.jl#448)
VNAlgorithmAll 307 tests pass locally on Julia 1.11.