The Watts-Strogatz small-world model
Generate a graph according to the Watts-Strogatz network model.
watts.strogatz.game(dim, size, nei, p)
- Integer constant, the dimension of the starting lattice.
- Integer constant, the size of the lattice along each dimension.
- Integer constant, the neighborhood within which the vertices of the lattice will be connected.
- Real constant between zero and one, the rewiring probability.
First a lattice is created with the given
nei arguments. Then the edges of the lattice are rewired
uniformly randomly with probability
Note that this function might create graphs with loops and/or multiple
edges. You can use
simplify to get rid of these.
- A graph object.
Duncan J Watts and Steven H Strogatz: Collective dynamics of
g <- watts.strogatz.game(1, 100, 5, 0.05) average.path.length(g) transitivity(g, type="average")