Warning
This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
newman_watts_strogatz_graph¶

newman_watts_strogatz_graph
(n, k, p, seed=None)[source]¶ Return a Newman–Watts–Strogatz smallworld graph.
Parameters: Notes
First create a ring over
n
nodes. Then each node in the ring is connected with itsk
nearest neighbors (ork  1
neighbors ifk
is odd). Then shortcuts are created by adding new edges as follows: for each edge(u, v)
in the underlying “n
ring withk
nearest neighbors” with probabilityp
add a new edge(u, w)
with randomlychosen existing nodew
. In contrast withwatts_strogatz_graph()
, no edges are removed.See also
References
[1] M. E. J. Newman and D. J. Watts, Renormalization group analysis of the smallworld network model, Physics Letters A, 263, 341, 1999. http://dx.doi.org/10.1016/S03759601(99)007574