label_propagation_communities random_state default change for reproducible partitions
0 reputation · 02 Jan 2021, 03:27 UTC
NetworkX's label_propagation_communities partitions graphs by iteratively updating node labels, but its node visitation order is randomized. When random_state is left as None, repeated calls on the same graph can yield different community assignments, which complicates reproducible research workflows.
The documentation acknowledges this non-determinism and exposes a random_state parameter for seeding, yet it does not recommend a fixed default seed. This leaves an unresolved design boundary: whether the function should become deterministic by default—perhaps by seeding internally or fixing visitation order—or remain stochastic with reproducibility delegated entirely to the caller.
What is the intended compatibility boundary here? Should a future version change the default random_state to a fixed seed, or is stochastic behavior considered part of the API contract? How can users who need deterministic partitions across runs distinguish a supported configuration from an incidental side effect of the current implementation?