NetworkX

Previous topic

networkx.neighbor_connectivity

Next topic

networkx.attribute_mixing_matrix

networkx.degree_pearsonr

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

[R48]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