ring_lattice: Ring lattice graph

Description Usage Arguments Details Value References See Also

View source: R/RcppExports.R

Description

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.

Usage

1
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.

Details

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

Value

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

References

Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of <e2><80><9c>small-world<e2><80><9d> networks. Nature, 393(6684), 440<e2><80><93>2. http://doi.org/10.1038/30918

See Also

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


netdiffuseR documentation built on May 19, 2017, 6:39 p.m.

Search within the netdiffuseR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.