The smallworldness() function uses degree.sequence.game(deg.dist, method="simple.no.multiple") to sample random graphs with the same degree sequence as the input graph:
Note that "simple.no.multiple" does not sample uniformly, so the result will be biased. I recommend you use rewire(with=keeping_degseq(...)) instead, which does sample uniformly in the limit of a large number of rewiring steps. You should probably verify that the graph is simple before doing this.
Aside: the deg.dist variable name is a misnomer. Currently this variable holds the degree sequence, not the degree distribution.
Note that degree.sequence.game() has been renamed to sample_degseq(). The old name works but it's deprecated.
The
smallworldness()
function usesdegree.sequence.game(deg.dist, method="simple.no.multiple")
to sample random graphs with the same degree sequence as the input graph:https://github.com/SachaEpskamp/qgraph/blob/master/R/centralityFunctions.R#L336
Note that
"simple.no.multiple"
does not sample uniformly, so the result will be biased. I recommend you userewire(with=keeping_degseq(...))
instead, which does sample uniformly in the limit of a large number of rewiring steps. You should probably verify that the graph is simple before doing this.Aside: the
deg.dist
variable name is a misnomer. Currently this variable holds the degree sequence, not the degree distribution.Note that
degree.sequence.game()
has been renamed tosample_degseq()
. The old name works but it's deprecated.