xgi.algorithms.assortativity#
Algorithms for finding the degree assortativity of a hypergraph.
Functions
- dynamical_assortativity(H)[source]#
Computes the dynamical assortativity of a uniform hypergraph.
- Parameters:
H (xgi.Hypergraph) – Hypergraph of interest
- Returns:
The dynamical assortativity
- Return type:
float
See also
- Raises:
XGIError – If the hypergraph is not uniform, or if there are no nodes or no edges
References
Nicholas Landry and Juan G. Restrepo, Hypergraph assortativity: A dynamical systems perspective, Chaos 2022. DOI: 10.1063/5.0086905
- degree_assortativity(H, kind='uniform', exact=False, num_samples=1000)[source]#
Computes the degree assortativity of a hypergraph
- Parameters:
H (Hypergraph) – The hypergraph of interest
kind (str, optional) – the type of degree assortativity. valid choices are “uniform”, “top-2”, and “top-bottom”. By default, “uniform”.
exact (bool, optional) – whether to compute over all edges or sample randomly from the set of edges. By default, False.
num_samples (int, optional) – if not exact, specify the number of samples for the computation. By default, 1000.
- Returns:
the degree assortativity
- Return type:
float
- Raises:
XGIError – If there are no nodes or no edges
See also
References
Phil Chodrow, Configuration models of random hypergraphs, Journal of Complex Networks 2020. DOI: 10.1093/comnet/cnaa018