\HeaderA{reciprocity}{Reciprocity of graphs}{reciprocity}
\keyword{graphs}{reciprocity}
\begin{Description}\relax
Calculates the reciprocity of a directed graph.
\end{Description}
\begin{Usage}
\begin{verbatim}
reciprocity(graph, ignore.loops = TRUE) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The graph object.
\item[\code{ignore.loops}] Logical constant, whether to ignore loop edges.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A vertex pair (A, B) is said to be reciprocal if there are
edges between them in both directions. The reciprocity of a directed
graph is the proportion of all possible (A, B) pairs which are
reciprocal, provided there is at least one edge between A and B. The
reciprocity of an empty graph is undefined (results in an error
code). Undirected graphs always have a reciprocity of 1.0 unless they
are empty.
\end{Details}
\begin{Value}
A numeric constaint between zero and one.
\end{Value}
\begin{Author}\relax
Tamas Nepusz \email{ntamas@rmki.kfki.hu} and
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
g <- random.graph.game(20, 5/20, directed=TRUE)
reciprocity(g)
\end{ExampleCode}
\end{Examples}

