[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] question about "degree.sequence.game()"

From: Tamás Nepusz
Subject: Re: [igraph] question about "degree.sequence.game()"
Date: Mon, 9 Sep 2013 15:45:22 +0200

> Would you please briefly describe the basic ideas of the method and how did 
> you do to avoid the multiple and loop edges?
See the documentation:


Basically, it generates a long list containing each vertex ID exactly as many 
times as the number of desired edges, then shuffles the list and starts taking 
pairs from the front -- these will be the endpoints of the generated edges. If 
it gets stuck, it skips the pair and moves on to the next one. When the list is 
exhausted and there are any skipped pairs, the skipped pairs are re-shuffled 
and the process starts again. If all the pairs in the list are skipped, it 
means that the algorithm got stuck, so it simply restarts the entire graph 
generation from a new list.

Source code is here for the undirected case:


and this is the directed case:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]