Learn R Programming

memnet (version 0.1.0)

grow_ws: Watts & Strogatz (2002) network growth model

Description

Grow networks using Watts & Strogatz (1999) growth model, which constructs in-between regular lattices and random networks by re-wiring edges of a regular lattice with probability p.

Usage

grow_ws(n = 100L, k = 10L, p = 0.2)

Arguments

n

Integer. Number of nodes in the network.

k

Integer. Number of edges added for each incoming node. Can only be even.

p

Numeric. Proability that an edge e_ij is rewired to e_ik with k being randomly drawn from the set of nodes.

Value

n x n adjacency matrix.

References

Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of <U+2018>small-world<U+2019> networks. Nature, 393(6684), 440-442.

Examples

Run this code
# NOT RUN {
# generate small, mildly random graph
grow_ws(n = 6, k = 2, p = .2)

# }
# NOT RUN {
# generate large, mildly random graph
grow_ws(n = 100, k = 10, p = .1)

# generate large, highly random graph
grow_ws(n = 100, k = 10, p = 10)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab