Skip to content

WattsStrogatz generation infinite loops if the ring lattice generated is complete #505

@finnbar

Description

@finnbar

Calling WattsStrogatzGenerator(5,2,p) for nonzero p will cause an infinite loop. This happens because RegularRingLatticeGenerator(5,2) generates a complete ring lattice, and thus the rewiring process of the Watts-Strogatz generator (https://github.com/networkit/networkit/blob/Dev/networkit/cpp/generators/WattsStrogatzGenerator.cpp#L42) never finds a suitable node to rewire to.

This happens for other complete lattices, such as WattsStrogatzGenerator(7,3,p). Confusingly, these are cases that RegularRingLatticeGenerator should check for (https://github.com/networkit/networkit/blob/Dev/networkit/cpp/generators/RegularRingLatticeGenerator.cpp#L12) but this does not seem to be being checked in practice.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions