Learn R Programming

fastnet (version 1.0.0)

net.erdos.renyi.gnp: Directed / Undirected Erdos-Renyi \(G(n,p)\) network

Description

Simulate a random network with n nodes and a link connecting probability of p, according to Edos and Renyi (1959).

Usage

net.erdos.renyi.gnp(n, p, ncores = detectCores(), d = TRUE)

Arguments

n

Number of nodes of the network.

p

Connecting probability.

ncores

Number of cores, by default detectCores() from parallel.

d

A logical value determining whether is a network directed (default) or indirected.

Value

A list containing the nodes of the network and their respective neighbors.

Details

In this (simplest) random network, each edge is formed at random with a constant probability. When d = TRUE is a directed network.

References

Erdos, P. and Renyi, A., On random graphs, Publicationes Mathematicae 6, 290-297 (1959).

Examples

Run this code
# NOT RUN {
x <- net.erdos.renyi.gnp(1000, 0.01)
# }

Run the code above in your browser using DataLab