Open szhorvat opened 1 year ago
Actually, with reference to #69, you may be interested in the vl
method of sample_degseq()
, which samples connected graphs with a given degree sequence approximately uniformly. You'll find an overview of the issues around sampling connected graphs with given degrees in Section 2.1 of my paper here: http://dx.doi.org/10.1088/2632-072X/abced5
smallworldness()
samples a large set of graphs with the same degree sequence as the input graph. Some of these will be disconnected, andaverage.path.length()
will return infinity for them. The comment here is no longer valid starting with igraph 1.3:https://github.com/SachaEpskamp/qgraph/blob/master/R/centralityFunctions.R#L344
The distance between unconnected vertices is now taken to be infinity. See here for more details: https://r.igraph.org/reference/distances.html
Also note that the function name
average.path.length()
is deprecated in favour ofmean_distance()
.Ref: https://stackoverflow.com/q/75575906/695132