Creates a ring lattice with \(n\) vertices, each one of degree (at most) \(k\)
as an undirected graph. This is the basis of rgraph_ws
.
ring_lattice(n, k, undirected = FALSE)
Integer scalar. Size of the graph.
Integer scalar. Out-degree of each vertex.
Logical scalar. Whether the graph is undirected or not.
A sparse matrix of class dgCMatrix
of size
\(n\times n\).
when undirected=TRUE
, the degree of each node always
even. So if k=3
, then the degree will be 2
.
Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of <U+201C>small-world<U+201D> networks. Nature, 393(6684), 440<U+2013>2. http://doi.org/10.1038/30918
Other simulation functions: permute_graph
,
rdiffnet
, rewire_graph
,
rgraph_ba
, rgraph_er
,
rgraph_ws