NetworkX

Previous topic

networkx.algorithms.mixing.neighbor_connectivity

Next topic

networkx.algorithms.mixing.attribute_mixing_matrix

networkx.algorithms.mixing.degree_pearsonr

networkx.algorithms.mixing.degree_pearsonr(G)

Compute degree assortativity of graph.

Assortativity measures the similarity of connections in the graph with respect to the node degree.

Parameters :

G : NetworkX graph

Returns :

r : float

Assortativity of graph by degree.

Notes

This calls scipy.stats.pearsonr().

References

[R97]M. E. J. Newman, Mixing patterns in networks Physical Review E, 67 026126, 2003

Examples

>>> G=nx.path_graph(4)
>>> r=nx.degree_pearsonr(G) 
>>> r 
-0.5