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
|
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