Learn R Programming

netdiffuseR (version 1.16.2)

rgraph_ws: Watts-Strogatz model

Description

Generates a small-world random graph.

Usage

rgraph_ws(n, k, p, both.ends = FALSE, self = FALSE, multiple = FALSE)

Arguments

n
Integer scalar. Set the size of the graph.
k
Integer scalar. Set the initial degree of the ring (must be less than $n$).
p
Numeric scalar. 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.

Value

  • A random graph of size $n\times n$ following the small-world model. The resulting graph will have attr(graph, "undirected")=FALSE.

References

Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of "small-world" networks. Nature, 393(6684), 440–2. http://dx.doi.org/10.1038/30918

Newman, M. E. J. (2003). The Structure and Function of Complex Networks. SIAM Review, 45(2), 167–256. http://doi.org/10.1137/S003614450342480

See Also

Other simulation functions: rdiffnet, rewire_graph, rgraph_ba, rgraph_er