k: Integer scalar. Set the initial degree of the ring (must be less than n).
p: Numeric scalar/vector of length T. Set the probability of changing an edge.
both.ends: Logical scalar. When TRUE rewires both ends.
self: Logical scalar. When TRUE, allows loops (self edges).
multiple: Logical scalar. When TRUE allows multiple edges.
undirected: Logical scalar. Passed to ring_lattice
Returns
A random graph of size n∗n following the small-world model. The resulting graph will have attr(graph, "undirected")=FALSE.
Details
Implemented as in Watts and Strogatz (1998). Starts from an undirected ring with n vertices all with degree k (so it must be an even number), and then rewire each edge by setting the endpoint (so now you treat it as a digraph) randomly any vertex in Ni
avoiding multiple links (by default) using the rewiring algorithm described on the paper.