rich_club_coefficient

rich_club_coefficient#

graph_tool.correlations.rich_club_coefficient(g, normalized=False, n_samples=10, n_iter=10)[git][source]#

Return the rich-club coefficient of an undirected graph.

Parameters:
gGraph

Undirected graph to be used.

normalizedbool (optional, default: False)

If True, the coefficient is divided by its average over random graphs with the same degrees.

n_samplesint (optional, default: 10)

Number of random graphs for the normalization.

n_iterint (optional, default: 10)

Number of rewiring sweeps (over all edges) used to generate every random graph.

Returns:
phinumpy.ndarray

The coefficient \(\phi(k)\) for \(k = 0, \dots, k_{\max} - 1\) (nan where fewer than two vertices have degree larger than \(k\)).

See also

assortativity

Assortativity coefficient

avg_neighbor_corr

Average nearest-neighbor correlation

graph_tool.generation.random_rewire

Degree-preserving randomization

Notes

The rich-club coefficient [colizza-detecting-2006] is the density of the subgraph induced by the vertices of degree larger than \(k\),

\[\phi(k) = \frac{2E_{>k}}{N_{>k}(N_{>k}-1)},\]

where \(N_{>k}\) is the number of vertices with degree larger than \(k\), and \(E_{>k}\) is the number of edges between them. Since it grows with \(k\) also in uncorrelated graphs, it is usually compared with its value \(\phi_\text{rand}(k)\) for random graphs with the same degree sequence, generated here with random_rewire() (configuration model, without parallel edges or self-loops), giving \(\rho(k) = \phi(k)/\langle\phi_\text{rand}(k)\rangle\). Parallel edges and self-loops of the graph are counted as in its degrees. The coefficient is computed in time \(O(V + E)\).

References

[colizza-detecting-2006]

Vittoria Colizza, Alessandro Flammini, M. Ángeles Serrano and Alessandro Vespignani, “Detecting rich-club ordering in complex networks”, Nature Physics 2, 110-115 (2006), DOI: 10.1038/nphys209 [sci-hub, @tor], arXiv: physics/0602134

Examples

>>> g = gt.collection.data["netscience"]
>>> rho = gt.rich_club_coefficient(g, normalized=True)
>>> print(rho[[1, 5, 10, 20]])
[1.0384772... 1.6256781... 2.9773869... 7.5       ]