| igraph Reference Manual |
|---|
int igraph_reciprocity(const igraph_t *graph, igraph_real_t *res, igraph_bool_t ignore_loops);
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.
Arguments:
|
The graph object. |
|
Pointer to an |
|
Whether to ignore loop edges. |
Returns:
Error code:
|
Time complexity: O(|V|+|E|), |V| is the number of vertices, |E| is the number of edges.
<< 16.1. igraph_density — Calculate the density of a graph. |
16.3. igraph_is_mutual — Check whether the edges of a directed graph are mutual >> |