LightGraphs v1.3.3
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.