Am 30.04.22 um 06:49 schrieb Snehal Shekatkar:
However, if any of the degree value is greater than "n-1", the size of the graph, clearly a simple graph cannot be generated from such sequence, and it should be immediately changed by re-generating degrees for such vertices. This happens a lot when the degrees are sampled from a right-skewed distribution. But I don't see anything like this in the code. My question is, isn't it inefficient to keep randomly choosing vertices one at a time and change their degrees until the vertices with degree greater than n-1 are reassigned degrees? Is it being done for correctly sampling from a given degree distribution? Or am I missing something?
This can be implemented in a trivial way simply by rejecting these large numbers already in the `deg_sampler` function that you supply to random_graph(). -- Tiago de Paula Peixoto <tiago@skewed.de>