igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] rewire


From: Szabolcs Horvát
Subject: Re: [igraph] rewire
Date: Fri, 11 Sep 2015 11:07:58 +0200



On 10 September 2015 at 15:21, Qunawei Zhang <address@hidden> wrote:
Hello:

I have some questions about rewire, would you please explain to me? Thanks
(1) Each iteration, two edges are randomly selected right? And the new edges (which generated by the rewiring) can also be selected and to be rewire again?

The following is based on my understanding, and may not be fully accurate.  The igraph authors will correct me if necessary.

In each step you select two disjoint edges and swap the endpoints if possible.  E.g., A-B, C-D can be swapped to A-C, B-D or to A-D, B-C, if those edges do not already exist.
 
(2) If I set  niter = 100, does it mean 100 edge pairs will be rewired?

No, it means that 100 attempts will be made.  Some may be unsuccessful.
 
Is there a probability that controls whether to rewire each selected edge pairs?

Sorry, I don't understand this question.
 
Some times a randomly selected edge pair can not be rewired, will this counted a trial or only successfully rewired ones will be counted as a trail?

"Trial" means "attempt".  Not all attempts will be successful.
 
Ensuring that precisely 100 swaps will be performed is rather problematic to implement in a useful (and fast) way because it would involve checking whether any edges can be swapped at all.

(3) Sometimes, the rewired network will be divided into several components, even when the original network is one connected component. Is there is a way to control the rewire process make the network connected? I tried to just selected the connected random network, but I can only get a few from 1000 random network, and I need much more.

Rewiring many times creates a random graph with the same degree sequence as your starting point.  You can check out the degree sequence game function with the Viger-Latapy method, which creates connected graphs.
 

 rewire(graph, mode = c("simple", "loops"), niter = 100) 
niter

Number of rewiring trials to perform.



Thanks.

Best
Quanwei

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

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