gives the reciprocity of a graph g.


uses rules vw to specify the graph g.

Details and Options

  • The reciprocity of a graph g is the fraction of reciprocal edges over all edges of g.
  • For a directed graph, the edges and are reciprocal and form a cycle of length 2.
  • For an undirected graph, all edges are reciprocal.
  • GraphReciprocity works with undirected graphs, directed graphs, and weighted graphs.


open allclose all

Basic Examples  (2)

Compute the reciprocity of a directed graph:

Distribution of graph reciprocity:

Scope  (6)

GraphReciprocity works with undirected graphs:

Directed graphs:

Weighted graphs:


Use rules to specify the graph:

GraphReciprocity works with large graphs:

Applications  (3)

GraphReciprocity measures the number of directed edges that are bidirectional:

Test whether a square matrix is structurally symmetric:

Distribution of reciprocity in UniformGraphDistribution[n,m,DirectedEdges->True]:

The expected value is (m-1)/(n(n-1)-1):

Properties & Relations  (3)

The graph reciprocity is between 0 and 1:

A bidirectional directed graph has reciprocity 1:

An undirected graph also has reciprocity 1:

Wolfram Research (2012), GraphReciprocity, Wolfram Language function, (updated 2015).


Wolfram Research (2012), GraphReciprocity, Wolfram Language function, (updated 2015).


Wolfram Language. 2012. "GraphReciprocity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015.


Wolfram Language. (2012). GraphReciprocity. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_graphreciprocity, author="Wolfram Research", title="{GraphReciprocity}", year="2015", howpublished="\url{}", note=[Accessed: 22-July-2024 ]}


@online{reference.wolfram_2024_graphreciprocity, organization={Wolfram Research}, title={GraphReciprocity}, year={2015}, url={}, note=[Accessed: 22-July-2024 ]}