make_SW: Makes a Small-World Network

View source: R/make_SW.R

make_SWR Documentation

Makes a Small-World Network

Description

Make an already existing network according to the Small-World mechanism.

Usage

make_SW(size, rewire, neighborhood, net_kind = "matrix", directed = FALSE)

Arguments

size

The number of nodes in the network. Must be a positive integer.

rewire

Small-World parameter specifying the probability each edge is randomly rewired, allowing for the possiblity of bridges between connected communities.

neighborhood

The range of nodes that form connected communities. Note: This implementation results in overlap of communities.

net_kind

The format of the network. Currently must be either 'matrix' or 'list'.x

directed

Binary variable determining if the network is directed, resulting in off-diagonal asymmetry in the adjacency matrix. Defaults to TRUE.

Details

Rewires a node in a network according to the Small-World mechanism.

Value

An adjacency matrix.

References

Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of ‘small-world’networks. nature, 393(6684), 440-442.

Examples

# Import netcom
library(netcom)

# Network size (number of nodes)
size <- 10

# Rewiring parameter
rewire <- 0.2

# Make network according to the Small-World mechanism
make_SW(size = size, net_kind = "matrix", rewire = rewire)


langendorfr/netcom documentation built on July 23, 2022, 5:19 p.m.