ring_lattice function

Ring lattice graph

Ring lattice graph

Creates a ring lattice with nn vertices, each one of degree (at most) kk

as an undirected graph. This is the basis of rgraph_ws.

ring_lattice(n, k, undirected = FALSE)

Arguments

  • n: Integer scalar. Size of the graph.
  • k: Integer scalar. Out-degree of each vertex.
  • undirected: Logical scalar. Whether the graph is undirected or not.

Returns

A sparse matrix of class dgCMatrix of size nnn * n.

Details

when undirected=TRUE, the degree of each node always even. So if k=3, then the degree will be 2.

References

Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of “small-world” networks. Nature, 393(6684), 440–2. tools:::Rd_expr_doi("10.1038/30918")

See Also

Other simulation functions: permute_graph(), rdiffnet(), rewire_graph(), rgraph_ba(), rgraph_er(), rgraph_ws()