Repository navigation
Implement outneighbors and inneighbors - #34
singhharsh1708 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #34 +/- ##
===========================================
+ Coverage 45.90% 60.56% +14.66%
===========================================
Files 1 1
Lines 61 71 +10
===========================================
+ Hits 28 43 +15
+ Misses 33 28 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
One design question I should raise rather than decide. Graphs.jl 1.14 made |
|
For the record, #14 defines |
1330cfe to
355fe10
Compare
355fe10 to
58dc959
Compare
|
LLM work from new contributors is not acceptable for bounties |
Fills in the
Graphs.outneighborsandGraphs.inneighborsTODOs.degree,connected_components,gdistancesandis_connectedall work on aVNGraphafter this and agree with theSimpleGraphconversion, where before they errored.very_nautystores each adjacency list in insertion order, not sorted, so this returns a fresh sortedVector{Cuint}rather than exposing the C array.VNGraphis anAbstractSimpleGraph, and the inherited methods assume sorted adjacency:SimpleEdgeItercallssearchsortedfirst(fadj(g, u), u)to skip the lower triangle. Definingfadjover the raw array would makeedgesandissubsetreturn wrong answers instead of erroring.A self loop is stored twice in the vertex's own adjacency list where
SimpleGraphlists it once, so the repeat is collapsed after sorting. The C adjacency is read underGC.@preserve g, since the raw pointer is held across the allocation of the result. An out-of-range vertex would be an out-of-bounds read on a C pointer, so it throwsBoundsError, matchingSimpleGraph.Verified against the
SimpleGraphconversion over every vertex of 20 random regular graphs, plus sortedness, element type, the empty neighbourhood, out-of-range, a self loop, and shuffled insertion order: 703 new checks, 815 passing. Revertingsrc/VNGraphs.jlturns those 703 into 6 failures and 697 errors.Part of JuliaGraphs/Graphs.jl#448. #35 builds on this one; the rest are independent.
AI Disclosure: Claude assisted with the code. Testing and review by @singhharsh1708.