sample_smallworld {igraph} | R Documentation |
Generate a graph according to the Watts-Strogatz network model.
sample_smallworld(dim, size, nei, p, loops = FALSE, multiple = FALSE)
smallworld(...)
dim |
Integer constant, the dimension of the starting lattice. |
size |
Integer constant, the size of the lattice along each dimension. |
nei |
Integer constant, the neighborhood within which the vertices of the lattice will be connected. |
p |
Real constant between zero and one, the rewiring probability. |
loops |
Logical scalar, whether loops edges are allowed in the generated graph. |
multiple |
Logical scalar, whether multiple edges are allowed int the generated graph. |
... |
Passed to |
First a lattice is created with the given dim
, size
and
nei
arguments. Then the edges of the lattice are rewired uniformly
randomly with probability p
.
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.
Gabor Csardi csardi.gabor@gmail.com
Duncan J Watts and Steven H Strogatz: Collective dynamics of ‘small world’ networks, Nature 393, 440-442, 1998.
Random graph models (games)
erdos.renyi.game()
,
sample_bipartite()
,
sample_correlated_gnp_pair()
,
sample_correlated_gnp()
,
sample_degseq()
,
sample_dot_product()
,
sample_fitness_pl()
,
sample_fitness()
,
sample_forestfire()
,
sample_gnm()
,
sample_gnp()
,
sample_grg()
,
sample_growing()
,
sample_hierarchical_sbm()
,
sample_islands()
,
sample_k_regular()
,
sample_last_cit()
,
sample_pa_age()
,
sample_pa()
,
sample_pref()
,
sample_sbm()
,
sample_traits_callaway()
,
sample_tree()
,
sample_()
Random graph models (games)
erdos.renyi.game()
,
sample_bipartite()
,
sample_correlated_gnp_pair()
,
sample_correlated_gnp()
,
sample_degseq()
,
sample_dot_product()
,
sample_fitness_pl()
,
sample_fitness()
,
sample_forestfire()
,
sample_gnm()
,
sample_gnp()
,
sample_grg()
,
sample_growing()
,
sample_hierarchical_sbm()
,
sample_islands()
,
sample_k_regular()
,
sample_last_cit()
,
sample_pa_age()
,
sample_pa()
,
sample_pref()
,
sample_sbm()
,
sample_traits_callaway()
,
sample_tree()
,
sample_()
g <- sample_smallworld(1, 100, 5, 0.05)
mean_distance(g)
transitivity(g, type = "average")