\HeaderA{is.mutual}{Find mutual edges in a directed graph}{is.mutual}
\keyword{graphs}{is.mutual}
\begin{Description}\relax
This function checks the reciproc pair of the supplied edges.
\end{Description}
\begin{Usage}
\begin{verbatim}
is.mutual(graph, es = E(graph))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The input graph.
\item[\code{es}] Edge sequence, the edges that will be probed. By default is
includes all edges in the order of their ids.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
In a directed graph an (A,B) edge is mutual if the graph also includes
a (B,A) directed edge.

Note that multi-graphs are not handled properly, i.e. if the graph
contains two copies of (A,B) and one copy of (B,A), then these three
edges are considered to be mutual.

Undirected graphs contain only mutual edges by definition.
\end{Details}
\begin{Value}
A logical vector of the same length as the number of edges supplied.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{reciprocity}{reciprocity}}, \code{\LinkA{dyad.census}{dyad.census}} if you
just want some statistics about mutual edges.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- erdos.renyi.game(10,50,type="gnm",directed=TRUE)
reciprocity(g)
dyad.census(g)
is.mutual(g)
sum(is.mutual(g))/2 == dyad.census(g)$mut
\end{ExampleCode}
\end{Examples}

