qpRndGraph(p=6, d=2, labels=1:p, exclude=NULL, verbose=FALSE, return.type=c("adjacency.matrix", "edge.list", "graphBAM", "graphNEL"), R.code.only=FALSE)
FALSE
then the faster C implementation is used
(default); if TRUE
then only R code is executed.This function is provided in order to generate a random undirected graph
as input to the function qpG2Sigma
which samples a random
covariance matrix whose inverse (aka, precision matrix) has zeroes on those
cells corresponding to the missing edges in the input graph. d-regular
graphs are useful for working with synthetic graphical models for two
reasons: one is that d-regular graph density is a linear function of d and
the other is that the minimum connectivity degree of two disconnected vertices
is an upper bound of their outer connectivity (see Castelo and Roverato,
2006, pg. 2646).
Steger, A. and Wormald, N.C. Generating random regular graphs quickly, Combinatorics, Probab. and Comput., 8:377-396.
qpG2Sigma
set.seed(123)
A <- qpRndGraph(p=50, d=3)
summary(apply(A, 1, sum))
Run the code above in your browser using DataLab