JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
459 stars 91 forks source link

Use GenericGraph for testing biconnectivity algorithms #270

Closed simonschoelly closed 1 year ago

simonschoelly commented 1 year ago

This PR changes the biconnectivity algorithms so that they test with GenericGraph instead of SimpleGraph.

With this, I discovered an error, where we incorrectly assumed that the result of outneighbors(g, v) is indexable. To work around this without , I added a function collect_if_not_vector that converts the result of outneighbors to a vector unless it is already one. In the future we might think, if we either should adjust these algorithms, or instead require the neighbor functions to always return an indexable collection.

codecov[bot] commented 1 year ago

Codecov Report

Merging #270 (85e97f1) into master (3c97457) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
+ Coverage   97.17%   97.19%   +0.01%     
==========================================
  Files         114      114              
  Lines        6656     6658       +2     
==========================================
+ Hits         6468     6471       +3     
+ Misses        188      187       -1     
gdalle commented 1 year ago

@etiennedeg interesting insight here

simonschoelly commented 1 year ago

Good eye! This looks fine to me so I'm merging, but @simonschoelly maybe we should put a progress tracker in issue #224 so that we know where generic graphs are used in testing already?

Right, I will do that after my next PR