chung_lu {fastRG} | R Documentation |
Create an undirected Chung-Lu object
Description
To specify a Chung-Lu graph, you must specify
the degree-heterogeneity parameters (via n
or theta
).
We provide reasonable defaults to enable rapid exploration
or you can invest the effort
for more control over the model parameters. We strongly recommend
setting the expected_degree
or expected_density
argument
to avoid large memory allocations associated with
sampling large, dense graphs.
Usage
chung_lu(
n = NULL,
theta = NULL,
...,
sort_nodes = TRUE,
poisson_edges = TRUE,
allow_self_loops = TRUE,
force_identifiability = FALSE
)
Arguments
n |
(degree heterogeneity) The number of nodes in the graph.
Use when you don't want to specify the degree-heterogeneity
parameters |
theta |
(degree heterogeneity) A numeric vector
explicitly specifying the degree heterogeneity
parameters. This implicitly determines the number of nodes
in the resulting graph, i.e. it will have |
... |
Arguments passed on to
|
sort_nodes |
Logical indicating whether or not to sort the nodes
so that they are grouped by block and by |
poisson_edges |
Logical indicating whether or not
multiple edges are allowed to form between a pair of
nodes. Defaults to |
allow_self_loops |
Logical indicating whether or not
nodes should be allowed to form edges with themselves.
Defaults to |
force_identifiability |
Logical indicating whether or not to
normalize |
Value
An undirected_chung_lu
S3 object, a subclass of dcsbm()
.
See Also
Other undirected graphs:
dcsbm()
,
erdos_renyi()
,
mmsbm()
,
overlapping_sbm()
,
planted_partition()
,
sbm()
Examples
set.seed(27)
cl <- chung_lu(n = 1000, expected_density = 0.01)
cl
theta <- round(stats::rlnorm(100, 2))
cl2 <- chung_lu(
theta = theta,
expected_degree = 5
)
cl2
edgelist <- sample_edgelist(cl)
edgelist