powered by
Function to generate a Watts-Strogats network
WattsStrogatz(N, K, Prw)
the number of nodes
the number of neighbors to which each node is connected so degree = 2*K
the rewiring probability
An object of class CM (contact matrix)
# NOT RUN { cm2=WattsStrogatz(N=20, K=4, Prw=.3) # }
Run the code above in your browser using DataLab