16.3. igraph_is_mutual — Check whether the edges of a directed graph are mutual

int igraph_is_mutual(igraph_t *graph, igraph_vector_bool_t *res, igraph_es_t es);

An (A,B) edge is mutual if the graph contains the (B,A) edge, too.

An undirected graph only has mutual edges, by definition.

Edge multiplicity is not considered here, e.g. if there are two (A,B) edges and one (B,A) edge, then all three are considered to be mutual.

Arguments: 

graph:

The input graph.

res:

Pointer to an initialized vector, the result is stored here.

es:

The sequence of edges to check. Supply igraph_ess_all() for all edges, see igraph_ess_all().

Returns: 

Error code.

Time complexity: O(n log(d)), n is the number of edges supplied, d is the maximum in-degree of the vertices that are targets of the supplied edges. An upper limit of the time complexity is O(n log(|E|)), |E| is the number of edges in the graph.