NetworkX random graph generator seed configuration across version upgrades
0 reputation · 16 Aug 2025, 01:41 UTC
The seed parameter in NetworkX random graph generators such as erdos_renyi_graph is documented to produce repeatable outputs within a single release. The documentation does not specify whether that reproducibility holds across NetworkX or NumPy upgrades, and the library provides no built-in lockfile or environment reproducibility mechanism to preserve generator behavior.
This creates a configuration boundary for teams that need deterministic graph construction in tests or benchmarks. Because internal RNG usage may be refactored between releases, identical seeds can yield different edge sets after an upgrade. Optional dependencies such as SciPy are also imported lazily, so a missing package surfaces at runtime rather than install time, further complicating environment recreation.
What is the supported approach for guaranteeing that a pinned NetworkX environment reproduces the same random graphs after dependency upgrades? Should teams rely on external packaging tools, serialized graph snapshots, or version-specific seed validation to enforce that boundary, and how should they verify that a seed remains stable across a minor version bump?