Generating random directed acyclic graphs (DAGs) with fixed expected number of neighbours. Several different methods are provided, each intentionally biased towards certain properties. The methods are based on the analogue *.game functions in the igraph package.
n: integer, at least 2, indicating the number of nodes in the DAG.
d: a positive number, corresponding to the expected number of neighbours per node, more precisely the expected sum of the in- and out-degree.
method: a string, specifying the method used for generating the random graph. See details below.
par1, par2: optional additional arguments, dependent on the method. See details.
DAG: logical, if TRUE, labelled graph is directed to a labelled acyclic graph.
weighted: logical indicating if edge weights are computed according to wFUN.
wFUN: a function for computing the edge weights in the DAG. It takes as first argument a number of edges m for which it returns a vector of length m containing the weights. Alternatively, wFUN can be a list
consisting of the function in the first entry and of further arguments of the function in the additional entries. The default (only if weighted is true) is a uniform weight in c("[0.1,\n", "1]"). See the examples for more.
Details
A (weighted) random graph with n nodes and expected number of neighbours d is constructed. For DAG=TRUE, the graph is oriented to a DAG. There are eight different random graph models provided, each selectable by the parameters method, par1 and par2, with method, a string, taking one of the following values:
regular:: Graph where every node has exactly d
incident edges. `par1` and `par2` are not used.
watts:: Watts-Strogatz graph that interpolates between the regular (par1->0) and Erdoes-Renyi graph (par1->1). The parameter par1 is per default 0.5 and has to be in (0,1). par2 is not used.
er:: Erdoes-Renyi graph where every edge is present independently. par1 and par2 are not used.
power:: A graph with power-law degree distribution with expectation d.par1 and par2 are not used.
bipartite:: Bipartite graph with at least par1*n
nodes in group 1 and at most `(1-par1)*n` nodes in group 2. The argument `par1` has to be in `[0,1]` and is per default `0.5`. `par2` is not used.
barabasi:: A graph with power-law degree distribution and preferential attachement according to parameter par1. It must hold that par1 >= 1 and the default is par1=1. par2 is not used.
geometric:: A geometric random graph in dimension par1, where par1 can take values from {2,3,4,5} and is per default 2. If par2="geo"
and `weighted=TRUE`, then the weights are computed according to the Euclidean distance. There are currently no other option for `par2` implemented.
interEr:: A graph with par1 islands of Erdoes-Renyi graphs, every pair of those connected by a certain number of edges proportional to par2 (fraction of inter-connectivity). It is required that n/s be integer and par2 in (0,1). Defaults are par1=2 and par2=0.25, respectively.
Returns
A graph object of class graphNEL.
References
These methods are mainly based on the analogue functions in the igraph package.