dyad_census#
- graph_tool.clustering.dyad_census(g)[git][source]#
Return the dyad census of the graph.
- Parameters:
- g
Graph Graph to be used.
- g
- Returns:
- mutual
int Number of pairs of vertices connected in both directions.
- asymmetric
int Number of pairs of vertices connected in one direction only.
- null
int Number of pairs of vertices not connected.
- mutual
See also
triad_censusTriad census
motifsMotif counting
graph_tool.structure.edge_reciprocityEdge 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)