dynamics: assortativity and the expansion eigenvalue

Nicholas W. Landry∗ and Juan G. Restrepo† Department of Applied Mathematics, University of Colorado at Boulder, Boulder, Colorado 80309, USA (Dated: September 3, 2021) The largest eigenvalue of the matrix describing a network’s contact structure is often important in predicting the behavior of dynamical processes. We extend this notion to and motivate the importance of an analogous eigenvalue, the expansion eigenvalue, for hypergraph dynamical processes. Using a mean-field approach, we derive an approximation to the expansion eigenvalue and its associated eigenvector in terms of the sequence for uncorrelated hypergraphs. We introduce a generative model for hypergraphs that includes degree assortativity, and use a per- turbation approach to derive an approximation to the expansion eigenvalue and its corresponding eigenvector for assortative hypergraphs. We validate our results with both synthetic and empirical datasets. We define the dynamical assortativity, a dynamically sensible definition of assortativity for uniform hypergraphs, and describe how reducing the dynamical assortativity of hypergraphs through preferential rewiring can extinguish epidemics.

Complex social systems often exhibit assortative mix- hypergraph patterns to other dynam- ing [1, 2], where individuals with similar characteristics ical processes. connect with each other more often than it would be ex- Our approach is as follows: first, we define and moti- pected if they were connected at random. Assortativity vate the importance of the expansion eigenvalue on dy- has been extensively studied in [3] and namical processes; second, we derive a mean-field approx- found to have significant effects on synchronization [4], imation of this eigenvalue and its corresponding eigen- epidemic dynamics [5, 6], stability [7], game theory [8], vector for hypergraphs without assortativity; third, we and general diffusion processes [9]. present a generative model for assortative hypergraphs; Recently, there has been much work on using hyper- fourth, we employ a perturbation approach to derive the graphs to describe systems with interactions involving effect of degree-degree mixing on these quantities and de- multiple agents [10, 11]. Hypergraphs are useful to de- fine the dynamical assortativity; and lastly, we show how scribe multi-way interactions in biology [12], social conta- our results can be used to modify hypergraph dynamics gion [13–15], synchronization [16], opinion models, infec- through preferential rewiring of hyperedges. tious disease spread [17], and real data [18]. It has been We start by defining terminology. A hypergraph is shown that contagion on a hypergraph cannot be pro- a mathematical object that describes group interactions jected onto a pairwise network if the higher-order conta- among a set of nodes. We represent it as H = (V,E), gion function is non-linear [19]. Recently the pairwise no- where V is the set of nodes and E is the set of hyper- tion of assortativity has been extended to hypergraphs for edges, which are subsets of V and represent unordered categorical node labels [20–22] and continuous attributes interactions of arbitrary size. We call a hyperedge with [18]. Assortativity on hypergraphs can provide different cardinality m an m-hyperedge and a hypergraph with insights on the structure of the interactions than assorta- only m-hyperedges an m-uniform hypergraph. It is useful tivity on the pairwise network projection [18] and, as we to consider weighted hypergraphs, where each edge e has will show, affect the outcome of hypergraph dynamical an associated positive weight βe. We define the hyperde- processes. gree sequence as in Ref. [14], where the mth order hyper- degree of node i, k(m), is the number of m-hyperedges to A fundamental problem when studying dynamics on i which it belongs. networks is to determine how structural characteristics We now define the expansion eigenvalue and discuss of the network affect the dynamical behavior. Many dy- its relevance to dynamical processes on hypergraphs. For namical properties such as the onset of epidemic spread- a weighted hypergraph, the expansion eigenvalue λ and arXiv:2109.01099v1 [physics.soc-ph] 2 Sep 2021 ing [23], synchronization [24], and percolation [25] are de- associated eigenvector u are defined by the eigenvalue termined by the largest eigenvalue of the network’s ad- equation jacency matrix. In turn, this eigenvalue is affected by the network’s and assortative mixing X λui = βe(ui + ··· + ui ), (1) properties [26] as well as other structural characteristics. 1 m−1 e={i,i1,...,im−1}∈E In this paper we show how the expansion eigenvalue, a suitably generalized eigenvalue for hypergraphs, is simi- where λ and u are the Perron-Frobenius eigenvalue and larly modified by the assortative properties of the hyper- eigenvector of the associated nonnegative matrix. graph. This eigenvalue has been shown to determine the In the unweighted case (i.e., βe = 1 for every hyper- extinction threshold for the SIS model on hypergraphs edge e), the eigenvector u corresponds to the motif [27], and we believe it will also prove useful in relating Eigenvector [28]. Just as the largest eigenvalue 2

(0) of a network’s is determinant for net- By symmetry of the function fm , we get work dynamics, the expansion eigenvalue plays an impor- " # tant role in dynamical processes on hypergraphs. For ex- X P (k1) k1 uk λu = (m − 1) 1 k, (3) ample, consider an SIS process on a hypergraph, where a k Nhki healthy node can get infected via a hyperedge e to which k1 it belongs at rate βe if at least one other node in e is and multiplying both sides by kP (k)/(Nhki) and sum- infected (the case referred to as individual contagion in ming over k, we obtain for the uncorrelated case Ref. [14]) and heals spontaneously at rate γ. Then one can show (see Ref. [27] and Supplemental Material) that hk2i λ ≈ (m − 1) , (4) a sufficient condition for epidemic extinction is given by hki γ > λ. In addition, we can determine the relative impor- tance of a node i with respect to this contagion model and uk ∝ k from Eq. (3). For non-uniform hypergraphs, (in terms of its probability of infection at the onset of assuming that βe = β|e|, the expansion eigenvalue is the the epidemic) from the ith entry of the associated eigen- largest eigenvalue of K, the degree-size correlation ma- (i) (j) (i) vector. More generally, the importance of the expansion trix, with entries Kij = βi(i − 1)hk k i/hk i (see the eigenvalue in spreading processes can be understood from Supplemental Material for the derivation). the fact that in the unweighted case the number of nodes In contrast with the uncorrelated case, we now assume reachable via hyperedges from a given starting node in ` that nodes are connected with an arbitrary function fm steps grows asymptotically as λ` [28]. determining the connection probability. We define

(0) Having motivated the importance of the expansion fm(k1, . . . , km) = fm (k1, . . . , km) [1 + gm(k1, . . . , km)] , eigenvalue λ, we now focus on how it is affected by (5) assortative mixing by degrees in the hypergraph. In this paper we will consider random hypergraphs that where  is a parameter and gm an assortativity function are constructed from a prescribed hyperdegree sequence for m-uniform hypergraphs. The assortativity function gm(k1, . . . , km) determines how likely it is that nodes {k1,..., kN }, where N is the number of nodes, ki = (2) with degrees k , . . . , k are joined by a m-hyperedge; [k , . . . , k(M)] is the target hyperdegree of node i, 1 m i if g > 0 (g < 0) it is more (less) likely than it and M is the maximum hyperedge size. The hy- m m would be expected if they were connected at random. In pergraph is then constructed by creating a hyperedge order to preserve the degree sequence, g must satisfy {i , . . . , i } with probability f (k ,..., k ), where the m 1 m m i1 im P (0) fm (k1, . . . , km)gm(k1, . . . , km) = 0. functions fm specify the assortative mixing properties k1,...,km We present two examples of the assortativity function of the hypergraph. The function fm(ki1 ,..., kim ) = (0) (m) (m) (m) (m) m−1 gm: the aligned degrees and large degrees assortativity fm (k , . . . , k ) = (m − 1)!k . . . k /(Nhki) , i1 im i1 im functions. The aligned degrees function measures the PN where we define hxi = i=1 xi/N, corresponds to the average pairwise correlation on a hyperedge. It is defined case where nodes are connected with hyperedges com- as pletely at random if the hyperdegree of node i is ki (as 1 X (ki − hki) (kj − hki) in the hypergraph configuration model [14, 18, 29, 30]). g (k , . . . , k ) = We start by deriving a mean-field approximation for the m 1 m m hki hki 2 i

(0) 2 (0) where λ = (m − 1)hk i/hki and uk = αk, where α is an arbitrary constant. (0) Replacing fm on the right-hand side of Eq. (2) with the fm in Eq. (5), using Eq. (8), assuming symmetry of fm, multiplying by kP (k)/(Nhki), summing over k, and (b) canceling the zero-order terms, we obtain to first order

hki X λ(1) = (m − 1) P (k)P (k ) ...P (k )× hk2i 1 m−1 k,k1,...,km−1 k2k2 . . . k 1 m−1 g (k, k , . . . , k ). (9) (Nhki)m m 1 m−1

Removing the reference to gm using the relation in Eq. (5) we find

hkihkk i FIG. 1. An illustration of disassortative and assortative 3- λ(1) = (m − 1) 1 E − λ(0), (10) hk2i uniform hypergraphs. The color of the nodes indicates their degree, with low-degree nodes on the left and high-degree nodes on the right. For a given degree sequence, the term where hkk1iE is the mean pairwise product of degrees over all possible 2-node combina- hkk1iE (the average pairwise product) determines ρ and on average, (a) hyperedges containing nodes with dissimilar de- tions in each hyperedge in the hypergraph, P P m grees decrease this term leading to disassortative hypergraphs hkk1iE = e∈E {i,j}⊆e kikj/(|E| 2 ). and (b) hyperedges containing nodes of similar degree increase Therefore, the expansion eigenvalue can be written, to this term leading to assortative hypergraphs. first order, as hkihkk i λ = λ(0) + λ(1) = (m − 1) 1 E , swaps on the hypergraphs. For each dataset hypergraph hk2i H, we focus on an m-uniform partition Hm (i.e., we = λ(0)(1 + ρ), (11) only consider its hyperedges of size m). We set a tar- get dynamical assortativityρ ˆ and swap edges as fol- where we defined lows. We choose two hyperedges e1 = {i1, i2, . . . , im}, 2 e = {j , j , . . . , j } and a node from each uniformly at hki hkk1iE 2 1 2 m ρ = 2 2 − 1. (12) random, say i1 and j1. Then we consider the rewired hk i 0 hypergraph Hm obtained by replacing e1 and e2 with 0 0 We refer to ρ as the dynamical assortativity for its rela- e1 = {j1, i2, . . . , im} and e2 = {i1, j2, . . . , jm} respec- 0 0 tion to hypergraph dynamics. One can verify that the tively. If the assortativity of Hm with this edge swap, ρ , expected value of ρ for an uncorrelated hypergraph is 0. reduces the difference between the current assortativity, Interestingly, to first order the expansion eigenvalue does ρ, and the desired assortativity,ρ ˆ, the swap is accepted 0 not depend on the particular assortativity function gm and we set Hm = Hm. To ensure that the algorithm ex- used, but only on the average of pairwise products of the plores the space of possible hypergraphs, we accept edge degrees belonging to the same hyperedge. A schematic swaps which increase the difference between the desired of disassortative (ρ < 0) and assortative (ρ > 0) hyper- assortativity and the current assortativity with probabil- 2 0 2 graphs is shown in Fig. 1. ity e−[(ˆρ−ρ) −(ˆρ−ρ ) ]/T (we set T = 10−5). We terminate We validate our results with numerical simulations on the algorithm when |ρ−ρˆ| is smaller than a prescribed tol- both synthetic and empirical hypergraphs. For both erance or when a maximum number of edge swaps have types of data, we modify the dynamical assortativity been performed (we used a tolerance of 10−2 and 106 of the datasets by performing preferential double edge maximum edge swaps). 4

4000 100 (a) Original ( , ) (b)

80 3000

60 2000 40 1000 20 (0) + (1) 0 0 0.1 0.0 0.1 0.2 0.3 0.3 0.2 0.1 0.0 0.1 0.2 0.3 0.4

400

(c) 1500 (d) 300

1000 200

100 500

0 0 0.4 0.2 0.0 0.2 0.4 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8

FIG. 2. A comparison of the actual expansion eigenvalue λ (connected triangles) to the first-order approximation of the eigenvalue λ(0) + λ(1) (connected circles) for (a) the configuration model, (b) the tags-ask-ubuntu dataset, (c) the congress- bills dataset, and (d) the Eu-Emails dataset. The square marker denotes the original (ρ, λ) value of the dataset.

For the synthetic hypergraph, we constructed a 3- λ to change abruptly as this structure is destroyed, and uniform configuration model (CM) hypergraph of size then to change slowly as the effects of changing the as- N = 105 according to the algorithm described in Ref. [14] sortativity dominate. We note that there appear to be with a degree sequence drawn from a truncated power- limitations to the extent to which ρ can be modified. This law distribution, P (k) ∝ k−3 on [10, 100]. We also used is similar to the limitations to the values of assortativity the Eu-Emails (EE), congress-bills (CB), and tags-ask- that networks and hypergraphs can achieve [34–37]. ubuntu (TAU) hypergraph datasets from Refs. [31–33], In all cases, we see that rewiring the hypergraph to filtered to only include hyperedges of size 3. increase the average value of hkk1iE (or, equivalently, ρ) has a dramatic effect on the expansion eigenvalue. For ex- In Fig. 2, the expansion eigenvalue λ calculated nu- ample, for the EE dataset λ can be reduced threefold by merically via the power method from Eq. (1) (connected the rewiring process. Thus, hypergraph rewiring might (0) (1) triangles) and the first-order approximation λ + λ be a useful theoretical tool to control dynamical processes (connected circles) are plotted as a function of ρ for the that depend on the expansion eigenvalue. four datasets mentioned above. For each dataset, the We can also use this perturbation approach to derive a starting point [i.e., the point (ρ, λ) for the original hy- first-order approximation to the eigenvector. Expanding pergraph] is shown with a square marker. For the syn- Eq. (3) to first order we obtain a nonhomogeneous linear thetic hypergraph (a), as expected, the first order ap- equation for the perturbation u(1) with solution proximation works well for small values of dynamical as- k sortativity. For the TAU dataset (b), surprisingly, the (1) hki X u = αk P (k ) ...P (k )× agreement is even better than for the synthetic dataset k hk2i 1 m−1 for larger values of ρ. Interestingly, for the CB (c) and k1,...,km−1 EE (d) datasets, and to a much lesser extent for the TAU k2 k . . . k 1 2 m−1 g (k, k , . . . , k ) + βk, (13) dataset, the value of λ changes sharply when first increas- (Nhki)m−1 m 1 m−1 ing (CB dataset and EE datasets), or both increasing and decreasing (TAU dataset) the assortativity. We hypoth- where the constants α and β are determined by the nor- (0) (0) (1) esize that initial edge swaps might be destroying other malization of uk and uk + uk . structure (such as , clustering, or Lastly, we show how modifying the dynamical assor- assortative mixing by unaccounted attributes), causing tativity by rewiring hypergraphs can extinguish an epi- 5

in the Supplemental Material). Therefore, reduction of 2.0 EPIDEMICS POSSIBLE c β3/β3 by preferential edge swaps should be attempted 1.5 REWIRING c c 3 (a) only when one can guarantee that β3/β3 can be reduced / 1.0 3 below 1 or when there is already an epidemic.

/ c 0.5 3 3 NO EPIDEMICS c In this paper, we have presented a novel definition of 3 = 3 0.0 assortativity for hypergraphs, related it to the expansion 0.3 0.2 0.1 0.0 0.1 0.2 0.3 0.4 eigenvalue, and motivated its use in relating assortative 2.5 Epidemic equilibrium given 3 structure in hypergraphs to the epidemic behavior. A 2.0 key limitation of our theoretical approach is that it as- (b) 1.5 sumes that connections between nodes are made prob- 1.0 abilistically based solely on nodal attributes, while real 0.5 networks are not necessarily constructed from such gener- % infected

0.0 ative models. Despite these limitations, our results pro- 0.3 0.2 0.1 0.0 0.1 0.2 0.3 0.4 vide a way to connect various measures of hypergraph structure with dynamical processes in a systematic way and for a large class of tunable null models. We be- FIG. 3. (a) The solid line with markers denotes the fixed lieve that exploring the role of the expansion eigenvalue c value of β3 as a fraction of the extinction threshold, β3/β3. in other dynamical processes on hypergraphs will be a The dashed line indicates β /βc = 1, below which epidemics 3 3 fruitful research direction. are not possible. (b) The epidemic equilibrium (percentage of the population infected) for each hypergraph given the fixed Nicholas Landry would like to acknowledge a helpful value of β3. conversation with Phil Chodrow. demic. As an example, consider a hypergraph SIS conta- gion spreading amongst groups of size m at a fixed rate ∗ β . In Ref. [27], the authors derive a sufficient condition [email protected] m † [email protected] for epidemic extinction for such models. For m-uniform [1] M. E. J. Newman, Assortative Mixing in Networks, Phys- hypergraphs and βe = βm, the extinction threshold for ical Review Letters 89, 208701 (2002). c the individual contagion model is βm < βm = γ/λ. By [2] M. E. J. Newman, Mixing patterns in networks, Physical decreasing λ through hyperedge swaps and thus increas- Review E 67, 026126 (2003). c c ing βm so that βm > βm, the epidemic can be extin- [3] S. Boccaletti, V. Latora, Y. Moreno, M. Chavez, and guished. (Note, however, that this is a sufficient condi- D. U. Hwang, Complex networks: Structure and dynam- tion; β > βc may not lead to an epidemic.) ics, Physics Reports 424, 175 (2006). m m [4] J. G. Restrepo and E. Ott, Mean-field theory of assor- We present an example based on the CB dataset, and tative networks of phase oscillators, EPL (Europhysics additional cases in the Supplemental Material. In this Letters) 107, 60006 (2014). −3 case, we consider m = 3, γ = 1, and β3 = 7.9 × 10 . In [5] M. Bogu˜n´aand R. Pastor-Satorras, Epidemic spreading Fig. 3(a), we plot the chosen value of β3 as a fraction of in correlated complex networks, Physical Review E 66, c 047104 (2002). the extinction threshold, β3/β3 (solid line with markers), c [6] Y. Moreno, J. B. G´omez,and A. F. Pacheco, Epidemic which decreases as β3 is increased by hyperedge swaps, c incidence in correlated complex networks, Physical Re- and the threshold for extinction (dashed line) β3/β3 = 1. view E 68, 035103(R) (2003). Below the dashed line, epidemics are impossible. Above [7] M. Brede and S. Sinha, Assortative mixing by de- the dashed line, they may be possible. In Fig. 3(b), we gree makes a network more unstable, arXiv:cond- plot the percentage of the population infected as a func- mat/0507710 (2005), arXiv:cond-mat/0507710. tion of ρ (averaged over 10 realizations of the epidemic). [8] Z. Rong, X. Li, and X. Wang, Roles of mixing patterns c in cooperation on a scale-free networked game, Physical For all values of ρ such that β3/β3 < 1, no epidemics occur. For large enough values of ρ, however, we see that Review E 76, 027101 (2007). [9] G. D’Agostino, A. Scala, V. Zlati´c,and G. Caldarelli, Ro- epidemics occur. bustness and assortativity for diffusion-like processes in We caution, however, that decreasing λ via edge swaps scale-free networks, EPL (Europhysics Letters) 97, 68006 c (2012). might not necessarily suppress epidemics if β3/β3 is not reduced below 1. In principle, epidemics will occur for [10] F. Battiston, G. Cencetti, I. Iacopini, V. Latora, M. Lu- values of β larger than a threshold β∗ ≥ βc which de- cas, A. Patania, J.-G. Young, and G. Petri, Networks 3 3 3 beyond pairwise interactions: Structure and dynamics, pends on the hypergraph structure. If the edge swaps c ∗ Physics Reports Networks beyond Pairwise Interactions: modify this threshold in such a way that β3 < β3 < β3, Structure and Dynamics, 874, 1 (2020). c ∗ when originally β3 < β3 < β3 , epidemics can actually be [11] A. R. Benson, D. F. Gleich, and D. J. Higham, Higher- promoted by the rewiring process (we show an example order Network Analysis Takes Off, Fueled by Classical 6

Ideas and New Data, arXiv:2103.05031 [physics] (2021), (2017). arXiv:2103.05031 [physics]. [30] O. T. Courtney and G. Bianconi, Generalized network [12] J. Grilli, G. Barab´as, M. J. Michalska-Smith, and structures: The configuration model and the canonical S. Allesina, Higher-order interactions stabilize dynamics ensemble of simplicial complexes, Physical Review E 93, in competitive network models, Nature 548, 210 (2017). 062311 (2016). [13] G. F. de Arruda, G. Petri, and Y. Moreno, Social conta- [31] A. Benson, Data!, https://www.cs.cornell.edu/˜arb/data/ gion models on hypergraphs, Physical Review Research (2021). 2, 023032 (2020). [32] J. H. Fowler, Connecting the Congress: A Study of [14] N. W. Landry and J. G. Restrepo, The effect of het- Cosponsorship Networks, Political Analysis 14, 456 erogeneity on hypergraph contagion models, Chaos: An (2006). Interdisciplinary Journal of Nonlinear Science 30, 103117 [33] J. H. Fowler, Legislative cosponsorship networks in the (2020). US House and Senate, Social Networks 28, 454 (2006). [15] I. Iacopini, G. Petri, A. Barrat, and V. Latora, Simplicial [34] N. Veldt, A. R. Benson, and J. Kleinberg, Higher- models of social contagion, Nature Communications 10, order is Combinatorially Impossible, 2485 (2019). arXiv:2103.11818 [cs] (2021), arXiv:2103.11818 [cs]. [16] P. S. Skardal and A. Arenas, Abrupt Desynchronization [35] N. Litvak and R. van der Hofstad, Uncovering disassor- and Extensive Multistability in Globally Coupled Oscil- tativity in large scale-free networks, Physical Review E lator Simplexes, Physical Review Letters 122, 248301 87, 022801 (2013). (2019). [36] R. van der Hofstad and N. Litvak, Degree-Degree Depen- [17] G. St-Onge, V. Thibeault, A. Allard, L. J. Dub´e,and dencies in Random Graphs with Heavy-Tailed Degrees, L. H´ebert-Dufresne, Social confinement and mesoscopic Internet Mathematics 10, 1560 (2014). localization of epidemics on networks, Physical Review [37] M. Cinelli, L. Peel, A. Iovanella, and J.-C. Delvenne, Net- Letters 126, 098301 (2021), arXiv:2003.05924. work constraints on the mixing patterns of binary node [18] P. S. Chodrow, Configuration models of random hyper- metadata, Physical Review E 102, 062310 (2020). graphs, Journal of Complex Networks 8, 10.1093/com- [38] N. Landry, nwlandry/hypergraph-assortativity: v0.4, net/cnaa018 (2020). Zenodo (2021). [19] L. Neuh¨auser,A. Mellor, and R. Lambiotte, Multibody interactions and nonlinear consensus dynamics on net- worked systems, Physical Review E 101, 032310 (2020). [20] B. Kami´nski, V. Poulin, P. Pra lat, P. Szufel, and F. Th´eberge, Clustering via hypergraph , PLOS ONE 14, e0224307 (2019). [21] I. Amburg, N. Veldt, and A. Benson, Clustering in graphs and hypergraphs with categorical edge labels, in Proceed- ings of The Web Conference 2020 , WWW ’20 (Associ- ation for Computing Machinery, New York, NY, USA, 2020) pp. 706–717. [22] P. Chodrow and A. Mellor, Annotated hypergraphs: Models and applications, Applied Network Science 5, 1 (2020). [23] Y. Wang, D. Chakrabarti, C. Wang, and C. Falout- sos, Epidemic spreading in real networks: An eigenvalue viewpoint, in 22nd International Symposium on Reliable Distributed Systems, 2003. Proceedings. (2003) pp. 25– 34. [24] J. G. Restrepo, E. Ott, and B. R. Hunt, Onset of synchro- nization in large networks of coupled oscillators, Physical Review E 71, 036151 (2005). [25] J. G. Restrepo, E. Ott, and B. R. Hunt, Weighted Per- colation on Directed Networks, Physical Review Letters 100, 058701 (2008). [26] J. G. Restrepo, E. Ott, and B. R. Hunt, Approximat- ing the largest eigenvalue of network adjacency matrices, Physical Review E 76, 056119 (2007). [27] D. J. Higham and H.-L. de Kergorlay, Epidemics on hy- pergraphs: Spectral thresholds for extinction, Proceed- ings of the Royal Society A: Mathematical, Physical and Engineering Sciences 477, 20210232 (2021). [28] A. R. Benson, Three Hypergraph Eigenvector Centrali- ties, SIAM Journal on Mathematics of Data Science 1, 293 (2019). [29] J.-G. Young, G. Petri, F. Vaccarino, and A. Patania, Construction of and efficient sampling from the simpli- cial configuration model, Physical Review E 96, 032312 7

SUPPLEMENTAL MATERIAL FOR HYPERGRAPH DYNAMICS: ASSORTATIVITY AND THE EXPANSION EIGENVALUE

In this Supplemental Material we present calculations not included in the main text, including the derivation of the extinction threshold, the mean-field approximation for the expansion eigenvalue for non-uniform hypergraphs, the perturbed eigenvalue and associated eigenvector, and the null values of the assortativity functions on an uncorrelated hypergraph. We also present additional properties of the dynamical assortativity and derive a relationship between the assortativity functions gm, the dynamical assortativity ρ, and the parameter  using our generative model.

EPIDEMIC THRESHOLD

Consider the individual contagion process for the hypergraph susceptible-infected-susceptible (SIS) model defined in Ref. [14] on an undirected hypergraph of size N. We denote γ as the healing rate and βe as the infection rate of a hyperedge e. As discussed in Ref. [27] in Theorem 9.1 (c1 = c2 = 1 in our case), the extinction threshold for the exact stochastic process can be bounded above by that for the mean-field dynamics. The mean-field equation for xi, the probability that node i is infected, is given by

dxi X = −γx + (1 − x ) β [1 − (1 − x ) ... (1 − x )]. (14) dt i i e i1 im−1 e={i,i1,...,im−1}∈E

By inspection, xi = 0 is always a fixed point of this equation. We write an ODE for linear perturbations around this equilibrium to derive conditions for the system’s stability. To first order, the equation for the perturbations, δxi, are

d(δxi) X = −γ(δx ) + β (δx + ··· + δx ), (15) dt i e i1 im−1 {i,i1,...,im−1}∈E

rt If we assume δxi = uie , then X (r + γ)ui = λui = βe(ui1 + ··· + uim−1 ), (16)

{i,i1,...,im−1}∈E where λ is the expansion eigenvalue and so, r = λ − γ. Therefore, a sufficient condition for epidemic extinction is γ > λ [27]. For an m-uniform hypergraph with βe = βm, the extinction threshold is βm/γ < 1/λ, where λ is the expansion eigenvalue of the unweighted hypergraph. If we rewrite the last term of Eq. (15) as a sum over uniform hypergraphs, then to first order

M d(δxi) X  (m)  = −γ(δxi) + (m − 1) W δx , (17) dt i m=2

(m) where W is the weighted version of the clique motif matrix defined in Ref. [28] and δx = [δx1, . . . , δxN ]. We can PM (m) define W = m=2(m−1)W as a linear operator with eigenvalue λ and as before, the extinction threshold is γ > λ.

DERIVATION OF THE NON-UNIFORM UNCORRELATED EXPANSION EIGENVALUE

We consider an uncorrelated hypergraph with edges of sizes m = 2,...,M and edge weights of the form βe = β|e|. The expansion eigenvalue equation can be written

M X X λui = βm (ui1 + ··· + uim−1 ). (18)

m=2 {i,i1,...,im−1}∈E

The degree-based mean-field eigenvalue equation, where we assume ui = uki , can be written as

M X 1 X λu = β P (k ) ...P (k )f (k, k ,..., k )(u + ··· + u ). (19) k m (m − 1)! 1 m−1 m 1 m−1 k1 km−1 m=2 k1,...,km−1 8

Focusing on the uncorrelated case, we assume that (m − 1)!k(m)k(m) . . . k(m) f (k, k ,..., k ) = f (0)(k(m), k(m), . . . , k(m) ) = 1 m−1 m 1 m−1 m 1 m−1 (Nhk(m)i)m−1 so M (m) (m) X X k(m)k . . . k λu = β P (k ) ...P (k ) 1 m−1 (u + ··· + u ), k m 1 m−1 (Nhk(m)i)m−1 k1 km−1 m=2 k1,...,km−1 and from symmetry,

M (m) X X P (k1)k uk λu = k(m)β (m − 1) 1 1 . (20) k m Nhk(m)i m=2 k1

(m) From Eq. (20), we can see that uk must be a linear combination of k . We assume an ansatz of the form

M X (m) T uk = αmk = k α, (21) m=2 where α = (α1, . . . , αM ) is an unknown vector of nonnegative weights. Renaming the summation indices and evalu- ating this ansatz in the eigenvalue equation, M M (i) (i) PM (j) X X X P (k1 )k1 j=2 αjk1 λ α k(j) = k(i)β (i − 1) . j i Nhk(i)i j=2 i=2 k1 Changing the order of summation,

M M (i) (i) (j) X X βi(i − 1) X P (k )k k λkT α = k(i) α 1 1 1 , hk(i)i j N i=2 j=2 k1 M M (i) (j) X X βi(i − 1)hk k i = k(i) α , hk(i)i j i=2 j=2 = kT Kα,

(i) (j) (i) We call K the degree-size correlation matrix, with entries Kij = βi(i − 1)hk k i/hk i which we call the inter-size correlations. Generically (when k is not orthogonal to the range of K − λI), this equation has a solution if and only if λ and α solve the eigenvalue equation λα = Kα. Notice that in the m-uniform case, we recover the expression we previously derived. Since K is a nonnegative matrix, we can use the Perron-Frobenius theorem and choose the non-negative eigenvalue with a corresponding non-negative eigenvector. If K is primitive, then λ is the eigenvalue of K with largest magnitude.

MORE DETAILED DERIVATION OF THE PERTURBED EIGENVALUE

We start with the expansion of Eq. (2) in the main text to first order (we recall that we are considering an m-uniform hypergraph), which is

(0) (0) (1) (1) αλ k + λ uk + αλ k X k k1 . . . km−1 = α P (k ) ...P (k ) (k + ··· + k ) 1 m−1 (Nhki)m−1 1 m−1 k1,...,km−1

X k k1 . . . km−1 (1) (1) (22) +  P (k1) ...P (km−1) (u + ··· + u ) (Nhki)m−1 k1 km−1 k1,...,km−1

X k k1 . . . km−1 + α P (k ) ...P (k ) g (k, k , . . . , k )(k + ··· + k ). 1 m−1 (Nhki)m−1 m 1 m−1 1 m−1 k1,...,km−1 9

From the 0th order approximation, the first terms on both sides of the equation are equal and we can cancel them. Secondly, assuming symmetry of fm and gm, we can simplify the right-hand side as

(0) (1) (1) λ uk + αλ k (1) X k1P (k1)uk = (m − 1)k 1 Nhki k1 2 X k k k2 . . . km−1 + α(m − 1) P (k ) ...P (k ) 1 g (k, k , . . . , k ). 1 m−1 (Nhki)m−1 m 1 m−1 k1,...,km−1

We multiply both sides by kP (k)/(Nhki) and sum over k which yields

(1) X kP (k)u X k2P (k) λ(0) k + αλ(1) Nhki Nhki k k 2 (1) X k P (k) X k1P (k1)uk = (m − 1) 1 Nhki Nhki k k1 2 2 X k k k2 . . . km−1 + α(m − 1) P (k)P (k ) ...P (k ) 1 g (k, k , . . . , k ). 1 m−1 (Nhki)m m 1 m−1 k,k1,...,km−1

Because λ(0) = (m − 1)hk2i/hki, the first terms on both sides are equal and we cancel them, yielding

2 2 hki X k k . . . km−1 λ(1) = (m − 1) P (k)P (k ) ...P (k ) 1 g (k, k , . . . , k ). (23) hk2i 1 m−1 (Nhki)m m 1 m−1 k,k1,...,km−1

m−1 We can use the relation that fm(k1, . . . , km) = (m − 1)!k1 . . . km/(Nhki) [1 + gm(k1, . . . , km)] to remove the reference to gm, obtaining

(m − 1) hki X k k1 λ(1) = P (k)P (k ) ...P (k ) f (k, k , . . . , k ) (m − 1)! hk2i 1 m−1 Nhki m 1 m−1 k,k1,...,km−1 hki X k2 k2 − (m − 1) P (k)P (k ) 1 . hk2i 1 (Nhki)2 k,k1

The term 1 X P (k)P (k ) ...P (k )kk f (k, k , . . . , k ) 2!(m − 2)! 1 m−1 1 m 1 m−1 k,k1,...,km−1 represents the expected sum of all products of degrees for pairs of nodes belonging to the same hyperedge (where the factors 2! and (m − 2)! correct for overcounting permutations of k, k1 and k2, k3, . . . , km−1 respectively). Since the number of possible pairwise products in a hypergraph is given by

X m Nhki m(m − 1) (m − 1)Nhki 1 = |E| = = , (24) 2 m 2 2 k,k0∈E,k6=k0 letting |E| be the number of edges, we can express λ(1) in terms of

1 X k k1 hkk i = P (k)P (k ) ...P (k ) f (k, k , . . . , k ), 1 E (m − 1)! 1 m−1 Nhki m 1 m−1 k,k1,...,km−1 the average of pairwise degree products over pairs of connected nodes, as

hkihkk i λ(1) = (m − 1) 1 E − λ(0). hk2i 10

Therefore,

hkihkk i λ = λ(0) + λ(1) = (m − 1) 1 E = λ(0)(1 + ρ), (25) hk2i where

hki2hkk i ρ = 1 E − 1. (26) hk2i2

DERIVING THE PERTURBED EIGENVECTOR

With the 0th order terms canceled, Eq. (22) becomes

(0) (1) (1) λ uk + αλ k (1) X k1P (k1)uk = (m − 1)k 1 Nhki k1 2 X k k2 . . . km−1 + α(m − 1)k P (k ) ...P (k ) 1 g (k, k , . . . , k ), 1 m−1 (Nhki)m−1 m 1 m−1 k1,...,km−1 and we can substitute the expressions for λ(0) and λ(1) derived above, yielding the nonhomogeneous linear equation (1) for uk

2 2 2 hk i (1) hki X k k . . . km−1 (m − 1) u + α(m − 1) k P (k)P (k ) ...P (k ) 1 g (k, k , . . . , k ) hki k hk2i 1 m−1 (Nhki)m m 1 m−1 k,k1,...,km−1 (1) X k1P (k1)uk = (m − 1)k 1 Nhki k1 2 X k k2 . . . km−1 + α(m − 1) k P (k ) ...P (k ) 1 g (k, k , . . . , k ). (27) 1 m−1 (Nhki)m−1 m 1 m−1 k1,...,km−1

The following expression, where the first term is a particular solution of (27) and the second a solution of the corresponding homogeneous equation,

2 (1) hki X k k2 . . . km−1 u = αk P (k ) ...P (k ) 1 g (k, k , . . . , k ) + βk, (28) k hk2i 1 m−1 (Nhki)m−1 m 1 m−1 k1,...,km−1 is the general solution of Eq. (27), where α and β are determined by the chosen normalization.

RELATING THE VALUE OF EPSILON TO OTHER QUANTITIES

m−1 When we write fm(k1, . . . , km) = (m − 1)!k1 . . . km/(Nhki) [1 + gm(k1, . . . , km)], we can use the mean-field approximation to derive a relation that allows us to infer the value of  from the empirically observed average of the assortativity function over hyperedges, hgmi. We derive this relation for the large degrees assortativity function, 11 although we can use the same approach to derive a similar relation for the aligned degrees assortativity function. 1 X hg i = P (k ) ...P (k )f (k , . . . , k )g (k , . . . , k )/(Nhki/m), m m! 1 m m 1 m m 1 m k1,...,km

1 X (m − 1)!k1 . . . km = P (k ) ...P (k ) [1 + g (k , . . . k )]g (k , . . . , k ), Nhki(m − 1)! 1 m (Nhki)m−1 m 1 m m 1 1 k1,...,km X k1 . . . km =  P (k ) ...P (k ) g (k , . . . k )2, 1 m (Nhki)m m 1 m k1,...,km   2 m2 X k1 . . . km k1 . . . km hk i =  P (k ) ...P (k ) − , 1 m (Nhki)m hkim hki2 k1,...,km " # hk3im hk2i2m =  − , hki3 hki2 and so,

hgmi  = m 2m .  hk3i   hk2i  hki3 − hki2

Assuming the same generative model described above, we can relate the value of  to ρ given a particular choice of assortativity function. We derive this relation for the large degrees assortativity function, although we can use the same approach to derive a similar relation for the aligned degrees assortativity function. In the mean field approximation, the hkk1iE term is

2 2 2 2   2 m hk i X k k k2 . . . km−1 k k1 . . . km−1 hk i hkk i = −  P (k)P (k ) ...P (k ) 1 − , 1 E hki2 1 m−1 (Nhki)m hkim hki2 k,k1,...,km−1 hk2i2 hk2im−2hk3i2 hk2i2 hk2im = −  − , hki2 hki2m hki2 hki2 and hki2hkk i hk2im hki2hk3i2  ρ = 1 E  − 1 = − 1 . hk2i2 hki2 hk2i4 One can easily verify that the expected value of ρ on an uncorrelated hypergraph is 0 by setting  = 0.

CALCULATING THE NULL VALUE OF ASSORTATIVITY FUNCTIONS

For each assortativity function, we derive the expected value for a null-model (the uncorrelated case) as

1 P (m−1)!k1...km m! P (k1) ...P (km) (Nhki)m−1 gm(k1, . . . , km) k ,...,k hg i = 1 m . (29) m Nhki m For the large degrees case,

m X k1 . . . km Y ki hg i = P (k ) ...P (k ) , m 1 m (Nhki)m hki k1,...,km i=1 1 X k2 . . . k2 = P (k ) ...P (k ) 1 m , hkim 1 m (Nhki)m k1,...,km hk2im = . hki2m 12

For the aligned degrees case,

    X k1 . . . km 1 X ki − hki kj − hki hg i = P (k ) ...P (k ) , m 1 m (Nhki)m m hki hki k1,...,km 2 i

SUPPRESSING EPIDEMICS THROUGH PREFERENTIAL REWIRING

In this Section, we include additional plots of the effect of disassortative rewiring on the epidemic extent. We consider the CM and EE datasets described in the main text. The following plots have the same structure as that in the main text so we omit the legend for simplicity.

In Fig. 4, we see the same behavior as that of the CB dataset. We comment that, as we expect, the epidemic threshold is fairly close to the predicted extinction threshold. In Figs. 5 and 7, we see behavior that differs from that of the CB dataset, but is consistent with our theoretical approach. In Fig. 5, we see that the epidemic extent is roughly less than 0.25% for all values of ρ. This does not contradict the bounds we derived because there is no epidemic below the extinction threshold. The behavior in Fig. 7 indicates that additional structure is present in the original hypergraph that seems to be suppressing the epidemic as well and warrants further study.

c As discussed in the text, it is possible that if edge swaps do not bring β3/β3 below 1 as in Fig. 7, the process results in an epidemic. While we only see this for the EE dataset, one should be cautious of rewiring the hypergraph unless c one can guarantee that β3/β3 < 1 can be achieved.

2.5

2.0 c 3 (a) REWIRING

/ 1.5 EPIDEMICS POSSIBLE 3 1.0 0.5 NO EPIDEMICS 0.0 0.1 0.2 0.3 0.4

3.0

2.5 2.0 (b) 1.5

1.0

% infected 0.5

0.0 0.1 0.2 0.3 0.4

−2 FIG. 4. CM dataset, β3 = 1.78 × 10 13

2.0 EPIDEMICS POSSIBLE

1.5

c (a) 3

/ 1.0 3

0.5 NO EPIDEMICS REWIRING 0.0 0.4 0.2 0.0 0.2 0.4

1.0

0.8 (b) 0.6

0.4

0.2 % infected

0.0 0.4 0.2 0.0 0.2 0.4

−3 FIG. 5. EE dataset, β3 = 1.3 × 10

EPIDEMICS POSSIBLE 3

c (a) 3 2

/ REWIRING 3

1 NO EPIDEMICS 0 0.4 0.2 0.0 0.2 0.4

1.0

0.8 (b) 0.6

0.4

0.2 % infected

0.0 0.4 0.2 0.0 0.2 0.4

−3 FIG. 6. EE dataset, β3 = 2.1 × 10

5

4 c 3 3 REWIRING

/ (a) 3 2 EPIDEMICS POSSIBLE 1 NO EPIDEMICS 0 0.4 0.2 0.0 0.2 0.4

8

6

4 (b)

2 % infected

0 0.4 0.2 0.0 0.2 0.4

−3 FIG. 7. EE dataset, β3 = 3.2 × 10 14

DATA AVAILABILITY

All code used in our analysis can be found at https://github.com/nwlandry/hypergraph-assortativity [38].