Builds an undirected Bernoulli (Erdos-Renyi) graph
object and returns the result in the form of an edgelist matrix.
Usage
buildER(N, p)
Arguments
N
number of nodes in the graph.
p
probability of presence of an edge between two nodes.
Value
A 2 column matrix contains a list of
all edges in the generated graph.
Details
Creates a random graph with N nodes. Generates edges
according to a Bernoulli random variable. Each potential edge
will exist with probability p. Uses an algorithm from Batagelj
and Brandes (2005). Partially based on C code from Butts (2008)
References
Batagelj, V. and Brandes, U. 2005. Efficient Generation of
Large random Networks,Physical Review E,71-3
Butts, C. 2008. network: A Package for Managing Relational
Data in R, Journal of Statistical Software, 24-2Erdos, P. and Renyi, A. 1959. On random graphs,
Publicationes Mathematicae, 6, 290-297.