\HeaderA{watts.strogatz.game}{The Watts-Strogatz small-world model}{watts.strogatz.game}
\keyword{graphs}{watts.strogatz.game}
\begin{Description}\relax
Generate a graph according to the Watts-Strogatz network
model.
\end{Description}
\begin{Usage}
\begin{verbatim}
watts.strogatz.game(dim, size, nei, p)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{dim}] Integer constant, the dimension of the starting lattice.
\item[\code{size}] Integer constant, the size of the lattice along each
dimension.
\item[\code{nei}] Integer constant, the neighborhood within which the
vertices of the lattice will be connected.
\item[\code{p}] Real constant between zero and one, the rewiring probability. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
First a lattice is created with the given \code{dim}, \code{size} and
\code{nei} arguments. Then the edges of the lattice are rewired
uniformly randomly with probability \code{p}.

Note that this function might create graphs with loops and/or multiple
edges. You can use \code{\LinkA{simplify}{simplify}} to get rid of these.
\end{Details}
\begin{Value}
A graph object.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{References}\relax
Duncan J Watts and Steven H Strogatz: Collective dynamics of
\sQuote{small world} networks, Nature 393, 440-442, 1998.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{graph.lattice}{graph.lattice}}, \code{\LinkA{rewire.edges}{rewire.edges}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- watts.strogatz.game(1, 100, 5, 0.05)
average.path.length(g)
transitivity(g, type="average")
\end{ExampleCode}
\end{Examples}

