# reciprocity

From igraph v0.5.3
by Gabor Csardi

##### Reciprocity of graphs

Calculates the reciprocity of a directed graph.

- Keywords
- graphs

##### Usage

`reciprocity(graph, ignore.loops = TRUE)`

##### Arguments

- graph
- The graph object.
- ignore.loops
- Logical constant, whether to ignore loop edges.

##### Details

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.

##### Value

- A numeric constaint between zero and one.

##### concept

Reciprocity

##### Examples

```
g <- random.graph.game(20, 5/20, directed=TRUE)
reciprocity(g)
```

*Documentation reproduced from package igraph, version 0.5.3, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.