\HeaderA{grg.game}{Geometric random graphs}{grg.game}
\keyword{graphs}{grg.game}
\begin{Description}\relax
Generate a random graph based on the distance of random
point on a unit square
\end{Description}
\begin{Usage}
\begin{verbatim}
grg.game(nodes, radius, torus=FALSE, coords=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{nodes}] The number of vertices in the graph.
\item[\code{radius}] The radius within which the vertices will be connected
by an edge.
\item[\code{torus}] Logical constant, whether to use a torus instead of a
square.
\item[\code{coords}] Logical scalar, whether to add the positions of the
vertices as vertex attributes called \sQuote{\code{x}} and
\sQuote{\code{y}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
First a number of points are dropped on a unit square, these points
correspond to the vertices of the graph to create. Two points will be
connected with an undirected edge if they are closer to each other in
Euclidean norm than a given radius. If the \code{torus} argument is
\code{TRUE} then a unit area torus is used instead of a square.
\end{Details}
\begin{Value}
A graph object. If \code{coords} is \code{TRUE} then with vertex
attributes \sQuote{\code{x}} and \sQuote{\code{y}}.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}, first version was
written by Keith Briggs \email{keith.briggs@bt.com}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{random.graph.game}{random.graph.game}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- grg.game(1000, 0.05, torus=FALSE)
g2 <- grg.game(1000, 0.05, torus=TRUE)
\end{ExampleCode}
\end{Examples}

