newman_watts_strogatz_graph¶
- newman_watts_strogatz_graph(n, k, p, seed=None)[source]¶
Returns a Newman–Watts–Strogatz small-world graph.
- Parameters
- nint
The number of nodes.
- kint
Each node is joined with its
k
nearest neighbors in a ring topology.- pfloat
The probability of adding a new edge for each edge.
- seedinteger, random_state, or None (default)
Indicator of random number generation state. See Randomness.
See also
Notes
First create a ring over
nodes [1]. Then each node in the ring is connected with its nearest neighbors (or neighbors if is odd). Then shortcuts are created by adding new edges as follows: for each edge in the underlying “ -ring with nearest neighbors” with probability add a new edge with randomly-chosen existing node . In contrast withwatts_strogatz_graph()
, no edges are removed.References
- 1
M. E. J. Newman and D. J. Watts, Renormalization group analysis of the small-world network model, Physics Letters A, 263, 341, 1999. https://doi.org/10.1016/S0375-9601(99)00757-4