igraph-help
[Top][All Lists]

## Re: [igraph] Watts-Strogaz not converging

 From: Tamás Nepusz Subject: Re: [igraph] Watts-Strogaz not converging Date: Tue, 28 Jan 2014 11:10:31 +0100

```> I am simulating a network using Watts-Strogaz as follows:
>
> modelGraph = igraph.Graph.Watts_Strogatz(1, g.vcount(), x, prob)
>
> I need a node a vertex eccentricity value <=6
Okay, let me know if I understand this correctly. Do you want to generate a
graph with the Watts-Strogatz model and ensure that at least one vertex has an
eccentricity value less than 6?

> I don't know what values to specify for x for each give probability value.

“x” in your code is in the place of the “nei” parameter, which specifies the
maximum distance within which two vertices will be connected in the initial
lattice from which the Watts-Strogatz model starts. Judging by the fact that
you specified dim=1 in the parameters, you want to start out from a ring graph.
In this case, if x=1, it means that each node will be connected to its nearest
neighbors in the ring only, and the rewiring (with the given probability)
starts from there. If x=2, if means that each node will be connected to its
nearest neighbors on the ring plus the next ones. In general, if you have a
ring with vertices 0, 1, 2, …, n-1, then vertex i will be connected to vertices
(i-x), (i-x+1), …, (i+x-1), (i+x), of course modulo n since this is a ring with
n nodes. (And of course vertex i will not be connected to itself).

Try plotting Graph.Watts_Strogatz(1, n, x, 0) for x=1, x=2, x=3 and so on,
with, say, n=15 to understand how the initial graph is generated and use the
“circle” layout (e.g, plot(Graph.Watts_Strogatz(1, 15, 2, 0), layout=“circle”)).

T.

```