pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 87 forks source link

BUG: Potentially endless while loops in experimental methods `Network.GrowPreferentially` #229

Closed fkuehlein closed 3 weeks ago

fkuehlein commented 3 months ago

More specifically, core.Network.GrowPreferentially_old() will erraneaously run into an endless while-loop at

https://github.com/pik-copan/pyunicorn/blob/d63cbb7a3dccf96de1cf48eb376c7658880aefa3/src/pyunicorn/core/network.py#L1021-L1024

_(does the _old-postfix imply that it may eventually be removed? Is it fully covered by GrowPreferentially()?)_

The same happens with core.Network.GrowPreferentially(nsi=False) at

https://github.com/pik-copan/pyunicorn/blob/d63cbb7a3dccf96de1cf48eb376c7658880aefa3/src/pyunicorn/core/network.py#L1200-L1205

Discovered this when adding tests for both methods, which are currently being skipped as of 03eaad08c75857a8b0b382ab3cdc391c353a42fe and 17e0d1ac258f7db432d7be9d6d5e21d5427d800a because they would cause builds to time out. Reproduce by running those tests, especially with high values of n_nodes.