random_reference(G, niter=1, connectivity=True, seed=None)¶
Compute a random graph by swapping edges of a given graph.
An undirected graph with 4 or more nodes.
- niterinteger (optional, default=1)
An edge is rewired approximately
- connectivityboolean (optional, default=True)
When True, ensure connectivity for the randomized graph.
- seedinteger, random_state, or None (default)
Indicator of random number generation state. See Randomness.
The randomized graph.
The implementation is adapted from the algorithm by Maslov and Sneppen (2002) .
Maslov, Sergei, and Kim Sneppen. “Specificity and stability in topology of protein networks.” Science 296.5569 (2002): 910-913.