Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

LightGraphs v1.3.3

Compare
Choose a tag to compare
@sbromberger sbromberger released this 09 May 18:39
· 74 commits to master since this release

Hotfix for bug in core_number.

This is a bug in the correctness of core_number. The old version produced incorrect results when run on directed graphs with bidirectional edges. The reason is that the old code used all_neighbors to determine the set of neighbors to process; the issue is that all_neighbors ensures no duplicates: so if you had an edge from X -> Y and another from Y -> X, the neighbors of X would only include Y one time. This is not what the algorithm specifies.

So we fixed it by explicitly using outneighbors and inneighbors so that bidirectional edges are included. Fortuitously, this also resulted in a speedup as all_neighbors needed to deduplicate; and we explicitly do not want that behavior here.

So - if you’ve been using core_number results with directed graphs anywhere, (including with k_core and the other degeneracy functions), you will probably want to re-run your results with this fix applied.