assortativity
¶
Functions:
| Name | Description |
|---|---|
assortativity |
Computes the degree assortativity coefficient of a graph: the Pearson |
assortativity
¶
assortativity(edge_index: array) -> float
Computes the degree assortativity coefficient of a graph: the Pearson correlation between the out-degree of the source and the in-degree of the destination of every edge ("Mixing patterns in networks").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_index
|
array
|
a [2, num_edges] array representing the source and target nodes of each edge |
required |
Returns:
| Type | Description |
|---|---|
float
|
The assortativity coefficient, in |
float
|
the edges have the same degrees (e.g. a regular graph). |
Example:
Source code in mlx_graphs/utils/assortativity.py
from mlx_graphs.utils import assortativity · mlx_graphs/utils/assortativity.py