dyad_census

Contents

dyad_census#

graph_tool.clustering.dyad_census(g)[git][source]#

Return the dyad census of the graph.

Parameters:
gGraph

Graph to be used.

Returns:
mutualint

Number of pairs of vertices connected in both directions.

asymmetricint

Number of pairs of vertices connected in one direction only.

nullint

Number of pairs of vertices not connected.

See also

triad_census

Triad census

motifs

Motif counting

graph_tool.structure.edge_reciprocity

Edge reciprocity

Notes

The pairs of distinct vertices are classified according to the edges between them [holland-method-1976], ignoring parallel edges and self-loops; for undirected graphs, every connected pair is mutual. The algorithm runs in time \(O(V + E)\).

References

[holland-method-1976]

Paul W. Holland and Samuel Leinhardt, “Local structure in social networks”, Sociological Methodology 7, 1-45 (1976), DOI: 10.2307/270703 [sci-hub, @tor]

Examples

>>> g = gt.collection.data["celegansneural"]
>>> print(gt.dyad_census(g))
(197, 1951, 41808)