robins_alexander_clustering

robins_alexander_clustering#

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

Return the bipartite clustering coefficient of Robins and Alexander.

Parameters:
gGraph

Graph to be used, typically bipartite. If it is directed, it is treated as undirected.

Returns:
cfloat

Bipartite clustering coefficient.

See also

butterflies

Number of butterflies

latapy_clustering

Local bipartite clustering coefficient

global_clustering

Global clustering coefficient

Notes

The bipartite clustering coefficient of [robins-small-2004] is

\[c = \frac{4C_4}{L_3},\]

where \(C_4\) is the number of cycles of length four (see butterflies()) and \(L_3\) the number of paths of length three, i.e. with four distinct vertices, each counted once irrespective of its orientation, so that \(L_3 = \sum_{\{u,v\}\in E}[(k_u-1)(k_v-1) - t_{uv}]\), where \(k_u\) is the number of neighbors of \(u\) and \(t_{uv}\) is the number of triangles that contain the edge \(\{u,v\}\). Since every cycle of length four contains four such paths, \(c\) is the fraction of paths of length three that are closed into a cycle of length four, in the same way as global_clustering() is the fraction of paths of length two closed into a triangle. The value is zero if there are no paths of length three. Parallel edges and self-loops are ignored.

The algorithm runs in time \(O(\sum_v k_v^2)\).

Parallel implementation.

If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.

References

[robins-small-2004]

Garry Robins and Malcolm Alexander, “Small worlds among interlocking directors: network structure and distance in bipartite graphs”, Computational & Mathematical Organization Theory 10, 69-94 (2004), DOI: 10.1023/B:CMOT.0000032580.12184.c0 [sci-hub, @tor]

Examples

>>> g = gt.collection.ns["davis_southern_women"]
>>> print(gt.robins_alexander_clustering(g))
0.467764060...