key: cord-0314306-ppqyub4v authors: Sanhedrai, Hillel; Havlin, Shlomo title: Epidemics on evolving networks with varying degrees date: 2022-01-07 journal: nan DOI: 10.1088/1367-2630/ac64b8 sha: c1c71c72a9ec1c8ecc423c5d77c421dc8ab9078d doc_id: 314306 cord_uid: ppqyub4v Epidemics on complex networks is a widely investigated topic in the last few years, mainly due to the last pandemic events. Usually, real contact networks are dynamic, hence much effort has been invested in studying epidemics on evolving networks. Here we propose and study a model for evolving networks based on varying degrees, where at each time step a node might get, with probability $r$, a new degree and new neighbors according to a given degree distribution, instead of its former neighbors. We find analytically, using the generating functions framework, the epidemic threshold and the probability for a macroscopic spread of disease depending on the rewiring rate $r$. Our analytical results are supported by numerical simulations. We find surprisingly that the impact of the rewiring rate $r$ has qualitative different trends for networks having different degree distributions. That is, in some structures, such as random regular networks the dynamics enhances the epidemic spreading while in others such as scale free the dynamics reduces the spreading. In addition, for scale-free networks, we reveal that fast dynamics of the network, $r=1$, changes the epidemic threshold to nonzero rather than zero found for $r<1$, which is similar to the known case of $r=0$, i.e., a static network. Finally, we find the epidemic threshold also for a general distribution of the recovery time. Following the fundamental works on epidemic processes [1] [2] [3] [4] , the study of epidemics on complex networks [5] [6] [7] has attracted significantly the network science community, and yielded many studies [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] , that look mainly for the epidemic threshold for a major outbreak for a variety of static networks and for several epidemic models. However, real networks of epidemiological contacts are usually not stationary but show significant dynamic patterns, which challenge the theory for epidemics on static networks [19] [20] [21] [22] . Hence, many studies have investigated epidemic processes on temporal networks [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] . Few temporal contact network models have been proposed and studied in the context of epidemic spread. Volz and Meyers [25] examined the effect of social mixing on SIR disease. They considered neighbor exchanges, in which pairs of edges are selected uniformly randomly and swapped, at a fixed mixing rate. Thus, each individual maintains a fixed number of concurrent contacts while the identities of the contacts change stochastically over time. They found that the epidemic threshold depends also on the rate at which the network changes over time, in addition to the properties of the disease and the network topology. Further studies [28] [29] [30] assumed, rather than an exchange between two random edges, that one side of an edge might be rewired to a random node, or that the edge might be deleted, resulting in non-stationary degrees. Perra et al. [31] introduced the activity-driven network model, where each node is assigned a time-invariant activity rate. Then, at each time step, each node becomes active with its activity rate, and forms fixed m connections with random nodes. All connections are cleared between time steps. Several works have been done on epidemics on the activity-driven network model and its extensions. [32] [33] [34] Prakash et al. [35] examined the epidemic threshold under SIS dynamics for arbitrary temporal networks, represented by a sequence of T static network snapshots with adjacency matrices A = {A 1 , A 2 , ...A T }. They showed that the epidemic threshold is then characterized by the maximal eigenvalue of the product of T matrices. Here, we propose and analyze a model of temporal network based on any degree distribution, where with some rewiring rate, r, each node samples new neighbors according to a new degree sampled from the given degree distribution. This assumption represents a real scenario where people change, at some points of time, their neighbors and number of neighbors when e.g. they take part in different events which might have remarkable different sizes and different participants. We study on this evolving network model the SIR model. Using an analytical approach based on the generating functions framework, we find the epidemic threshold and the probability of a major outbreak, depending on the rewiring rate r, as well as the properties of the network and the infection rate β. One of the main questions we address is: does the dynamics in the connections enhance the capability of the epidemic to spread, or the opposite, mitigate it? We find that the answer changes for different structures of the network, which implies two opposite effects of the rewiring on the pandemic as we discuss below. We derived analytical theory which predicts quantitatively these surprising phenomena. Another interesting result that we obtain, is about scale-free networks. They are known, in the static case, to be extremely vulnerable to epidemics, such that for any non-zero infection rate the epidemic will spread, that is, β c = 0 [36, 8] . However, in the dynamic case, we find that if r = 1, that is, the network changes fast relative to the infection time, then β c becomes nonzero, namely the evolving network is dramatically more robust against epidemics for this case. We also discuss the relation between epidemics and directed percolation [37, 38] which can be regarded as the inspiration for our model. We find that the SIR model on evolving networks can be rigorously mapped to a modification of the directed percolation model. Finally, we further explore the case of a general nonuniform recovery time and particularly where there is a recovery rate γ, instead of taking the recovery time to be a single time step. We find for this case the phase diagrams that show the conditions for an epidemic spread depending on the rewiring, infection, and recovery rates, (r, β, γ) and the degree distribution p k . We consider the stochastic Susceptible-Infectious-Recovered (SIR) model in discrete time. According to this model, if an agent is susceptible and it has a contact with an infectious node at some time step, then it is infected by the infective node with probability β. Once it is infected, it can infect others at the following time step. For simplicity, we analyze first the case in which an infected node can infect others only at the next time, and then it is recovered and cannot infect nor become infected anymore. Below, we further analyze the more complicated case that an infected node is recovered with probability γ at each time step. We present here our model for the evolving network on which the SIR epidemic process takes place. Initially, we build a random network with some degree distribution p k . Then, at each time step, each node is chosen with probability r to switch its degree and neighbors. Next, we shuffle the neighbors of these chosen nodes in the following way. First, we shuffle the degrees of these nodes, hence each node gets randomly a new degree from the pool of degrees of all chosen nodes, thus the degree distribution is conserved. This is since the nodes not selected preserve their degree and the chosen nodes just exchange degrees. Next, we shuffle the neighbors of the chosen nodes, such that each one gets random neighbors according to its new degree from the pool of the neighbors of the chosen nodes. See Fig. 1 for a demonstration of our model for the evolution of the network. Next, we describe how the epidemic process and the evolution process of the network integrate with each other. The infections take place at each time step according to SIR model, whereas the rewiring occurs between time steps. We also assume the recovery occurs between time steps. To summarize, we have the following parameters governing the system behavior. β -infecting rate, r -rewiring rate, and for the case that the recovery time is not one, γ -recovery rate. Figure 1 : Illustration of our evolving network model. When rewiring, first we choose randomly r nodes (in orange) to switch neighbors and degree, while other nodes (purple) conserve their degree. Here r = 0.3, hence, the outgoing links from the three chosen nodes (orange) are rewired while other links remain. The degrees of the chosen nodes are shuffled randomly, and also their neighbors are shuffled randomly between them. One can see that the degrees of the chosen nodes changed while the degrees of the other nodes were preserved. In such a way, the degree distribution p k is conserved, and a fraction r of nodes samples new degrees and neighbors. However, notice that also other nodes get some changes in the identities of their neighbors, since if they have a neighbor which is a chosen node, it abandons and leaves someone else instead. The red circles and arrows demonstrate an effect of the rewiring on the pandemic spread. At time t there are two infectious people (red circles). The red arrows represent actual infections. A person with many neighbors is more likely to get infected by one of them. Here comes a major difference between static and dynamic networks. While in the former, the infected node preserves its degree, which tends to be high, in the latter it gets a new degree which is probably smaller. This reduces the epidemic capability to be spread. An opposite effect is that the parent of the infected node is now immunized (green circles) and thus cannot spread the disease, thus switching neighbors has some advantage for spreading. We take all these considerations into account and provide formulas to predict the epidemic spread. For simplicity, we consider first the case in which a node can infect only at the following time after it gets infected, then it gets recovered. That is, the recovery time is τ = 1. We look for the probability P inf that a random node infected from outside the system will lead to a macroscopic infection, namely, at the end of the process, an infinite number of nodes have been infected in an infinite network. We further look for the critical infection rate β c for the spread of disease, which represents the transition from zero probability of infinite infection to a nonzero probability. The probability P inf that a random infected node will lead to an outbreak, that is, spreads the pandemic to an infinite group is the likelihood that it infects at least one of its neighbors and the latter will spread the contagion to infinite. Clearly, it depends on its degree k. Thus, the probability, 1 − P inf , that the infectious node will not spread the epidemic to an infinite number of nodes is, The RHS means that the infectious node does not spread the epidemic to infinity through anyone of its k neighbors, nor if it preserves its neighbors after it infects (1 − r), neither if it switches its neighbors just after it infects (r). Here, p k is the degree distribution. The quantity v p is the probability that the epidemic does not spread to an infinite group through a random neighbor, given the parent node was not chosen to switch immediately after it had the chance to infect its neighbors. The quantity v np is the same except that the parent node did switch its neighbors the moment after it had the chance to infect its neighbors, leaving its children with no parent (np) and with another node instead. The reason we separate this likelihood into two cases, is that otherwise the chances to spread through each neighbor are dependent via the question of whether their parent was chosen to switch or not, since the parent is not susceptible, unlike others. Defining the generating function [39, 40] of the degree distribution p k we obtain Note that we do not consider whether the infectious node performed neighbors-switch before it infected, since it does not have any impact. Next, we find v p and v np . Note first that if the parent does not infect its random neighbor (with probability 1 − β) then obviously the disease will not spread through this neighbor. Then we analyze what happens if the neighbor got infected. In this case, we distinguish between if it does not switch neighbors (with likelihood 1 − r) before it infects or it does. When switching neighbors it gets the degree distribution of a random node p k , while when not switching it preserves its neighbor degree distribution which is kp k / k . We also separate between the case it switches neighbors after it infects and the case it does not. Switching af ter infecting leaves its former neighbors with no parent, consequently gives them the chances v np , while not switching gives its neighbors the probability v p for not spreading the pandemic to infinity. Finally, The difference between v p and v np is where the neighbor did not switch before it infected, then if the parent node was replaced by a random node, there are k susceptible contacts, while if the parent was not replaced, there are k − 1 susceptible contacts, since the parent is recovered. Thus, we obtain two self consistent equations, and where G 1 and G 2 , the generating functions of the residual degree and the neighbor degree distributions correspondingly, are defined by The RHS of Eqs. (4) and (5) consider in fact four options regarding switching before and after infecting others. For each option, there is the corresponding degree distribution (before-switch determines) and the corresponding variable v p or v np (after -switch determines). Note that in Eqs. (4) and (5) we assume that all random neighbors (except the parent node) are susceptible because we look on the very first steps of the spread, and at this point, in a large network the probability to catch randomly the recovered or infectious nodes is negligible. Notice that the SIS model is different from the SIR model considered here, even at the first steps of the pandemic. The difference is that in SIS the parent node becomes susceptible when its "child" infects others, instead of recovered in SIR. This fact has an impact since there is a non-negligible chance of 1 − r 2 that they are still connected at the time after the parent infected the child. However, for r = 1 SIS and SIR are equivalent at the very beginning of the process since the parent is not anymore a neighbor of its child after one step and random nodes are susceptible. We further mention that for r < 1, the SIS model is not solvable by our analysis [41, 8] since the presence of the susceptible parent makes all its "children" dependent on each other, what prevents us from writing equations such as Eqs. (3)-(5). Solving Eqs. (4) and (5) and substituting v p and v np in Eq. (3) we obtain the probability that a random infectious node spreads the epidemic to an infinite group. Fig. 2 shows the analytical results of P inf vs. β according to Eqs. (3)-(5) compared with simulations, showing excellent agreement. One can see that below β c the chance of infinite infection is negligible, while above β c there is a nonzero probability for it. Below the criticality (β < β c ), only the single solution (P inf = 0, v p = 1, v np = 1) satisfies Eqs. (3)-(5), representing no outbreak of the contagion. Above criticality, in contrast, there is another solution representing the existence of a major outbreak, in which P inf > 0, in addition to the P inf = 0 solution. At criticality, there exists a phase transition between the two states described above, a single solution and a pair of solutions. This determines (see SI Section 1.2) that the derivative of both sides of Eq. (4) with respect to v p are equal, leading to, where k = G 0 (1) is the average degree, and κ = k 2 / k = G 2 (1) is the average neighbor degree. The last equation is pretty intuitive because the denominator represents the average number of susceptible contacts which are in touch with an infected node. Thus, it is equivalent to the known condition [3] of the critical reproductive ratio R 0 = 1. We can further recognize in this equation that in fact there are two effects of the rewiring. One, the second term in the denominator, r k , is a change of the degree from a typical degree of a neighbor to that of a random node. The second, the adding of r to κ − 1 in the first term, is that the parent node, which infected the current node, might be switched, and replaced by a susceptible node rather than recovered. Notice that the limit case r = 0 recovers the well known result [36, 42, 8] for a static network β c = 1/(κ−1). The other limit of full rewiring, r = 1, gives β c = 1/ k which recovers the result of branching process since a new degree and neighbors are sampled at each time as in branching process. The above results, Eqs. (1)- (7), are general for any degree distribution. Next, we analyze this result for several model networks. We are interested in the dependence of β c on the rewiring rate r. This behavior changes qualitatively for different networks since the relation between κ and k varies. For random regular network (RR), κ = k = k, and substituting this in Eq. (7) gives, which implies that β c decreases when r increases (see Fig. 2d ). This happens because it is better for mitigating the spread of the disease not to switch neighbors, since when switching, the infectious node is exposed to more susceptible nodes. For Erdős-Rényi network (ER), κ − 1 = k , hence which interestingly exhibits a non-monotonic behavior (see Fig. 2e ). The reason is that increasing r, on one hand, increases the chance that the parent recovered node was replaced by a susceptible node, but on the other hand, it enlarges the probability that the infectious node switches its degree and neighbors, resulting in reduced degree on average. The most interesting case is scale-free network (SF) whose degree distribution is p k = Ak −λ for k ≥ k 0 with λ ≤ 3. This distribution has a divergent second moment, and therefore κ → ∞. If λ ≤ 2 then also the first moment diverges, k → ∞. Thus, The reason that β c = 0 for a static SF network is that when spreading the epidemic the infection goes through neighbors. This leads the disease very fast to the hubs, whose degrees are very large, therefore they spread the contagion even if the infection rate β is very small. However, in evolving network, when the rewiring rate is one, once an hub gets infected it immediately switches its neighbors and samples a new degree from p k , such that at the moment it comes to infect it is no more a hub. Hence β c becomes nonzero. This phenomenon exists in reality when people are likely infected in large events when they have a contact with many potential infectious people, however, only few days later (e.g. in Covid-19), they can infect, but at this time, they probably do not take part in a mass event. Interestingly, this finite value of β c is also valid for SIS on evolving networks with r = 1 as for SIR. This is since for r = 1, both SIR and SIS are identical at the beginning of the epidemic spreading, see above discussion after Eq. (6). Notice that β SF c = 0 since κ → ∞ for N → ∞. However, for a finite system, β SF c given by Eq. (7) is finite and dependent of N as shown in Fig. 2 , and in SI Fig. S1 . For SF, switching neighbors helps a lot to curb the epidemic, because then the infectious node has a typical degree of a random node which is much lower than the typical degree of neighbors which tend to be hubs. Therefore, when r increases β c also increases in contrast to RR, see Fig. 2 . It was shown [9] that SIR model (with immediate recovery) on static network is mapped exactly to bond percolation, where the chance p of a link to be occupied replaces the probability β to infect. The disease will spread to the whole connected component of the source node. Thus, the chance of a major outbreak equals to the relative size of the giant connected component. SIS model, on the contrary, cannot be mapped to a percolation since a link can be traversed many times. This feature cannot be captured by the single probability p of a link occupation in percolation. However, SIS model can be rigorously mapped to directed percolation, [38] where each time step gets a layer in which a copy of the network [37] , see Fig. 3 . Between the layers there reside the edges of the network at the corresponding time. Each link is traversed with chance p = β. This mapping covers both static and evolving networks. If the network is static the links between all the layers are identical, while for an evolving network the connections between layers might be different. Of course all links have one direction representing the flow of time. The only case without mapping to percolation is the SIR model on an evolving network, which can be described nor by percolation since the latter is static, neither by directed percolation in which a node can be traversed many times in contrary to SIR model where an agent can be infected one single time. Thus, the SIR model on evolving networks proposed in this manuscript, is actually a modification of directed percolation with the additional following condition. When tracking the cluster reachable from a source, one can go through each node only once. This is since once a node is traversed (infected) it is recovered and immunized and cannot be traversed again. In our model, the connections from a layer to the next layer are rewired such that each node changes randomly its neighbors and degree with rate r. See in Fig. 3 an illustration of the classic directed percolation compared to our modified directed percolation which represents the SIR model on an evolving network. , and the blue links indicate contacts that were not traversed (DP) or did not lead to infection (SIS). A link is traversed randomly with likelihood β. Note that the same node can be infected again and again, allowing the spread of disease. Also the same node might have different degree and neighbors at different times due to the network dynamics. On the right, we show our model (SIR on evolving network) which is identical to the model on left, except that an infectious node recovers after one step and cannot be infected anymore. While on the left (SIS or directed percolation) the epidemic is spread by going through the same nodes few times, on the right the epidemic stops due to the recovery of the spreaders. Our model is like directed percolation modified to SIR. (b) A table showing the mapping from the four epidemic models on static/dynamic networks to percolation models. Next we consider a general distribution for the recovery time τ , and particularly the case in which the probability of an infected node to recover before each time step is γ. In contrast to the case we analyzed above in which the infectious time was fixed τ = 1, now the infectious time is random, distributed exponentially as Note that also τ = 0 is a possible option capturing the scenario of immediate recovery after being infected before infecting others. The mean of this distribution, Eq. (11), is τ = (1 − γ)/γ, ranging from 0 to infinity depending on γ. The generating function of φ(τ ) is Because of the complexity of this case, we find as above the outbreak probability P inf analytically in the extremes of static (r = 0) and fast-evolving (r = 1) networks. For the range in between, we solve only the critical conditions for a major pandemic in the 3D (r, γ, β) space. An infectious node spends a time τ in contact with its constant neighbors. The chance to infect each neighbor, p, depends on τ as which is the complementary probability of no infection in any time during the contact. The infection probabilities of neighbors are dependent on each other through the recovery time of their parent τ , requiring us to separate between different values of τ . The probability P inf of a major outbreak starting with a random infectious node is where the sum is over all time τ and requiring that any neighbor does not get infected (1 − p) or does not spread the pandemic to infinity (v) even though it got infected. The probability v that an infected neighbor does not spread the epidemic to a macroscopic group is obtained by Here G 0 is replaced by G 1 which corresponds to the residual degree distribution (for v) rather than the degree distribution (for P inf ). Eqs. (14) and (15) which is valid for any recovery time distribution φ(τ ). For our case of recovery probability γ in every step, using Eq. (12), we obtain, The above case of uniform τ = 1, is recovered since G τ is simply the identity function, therefore, β c = 1/(κ − 1). For the general case of uniform τ , G τ (x) = x τ , thus β c = 1 − [1 − 1/(κ − 1)] 1/τ . We recognize from Eq. (17) the value of γ c that makes β c = 1. That is for γ > γ c there is no macroscopic outbreak, for any infection rate β, where γ c = (κ − 2)/(κ − 1). For the case of fully temporal networks, r = 1, the probability of infecting a neighbor is just β independent on τ since the parent switches its neighbors at each time step. However, the recovery time τ determines how many neighbors the parent meets before it recovers. Let q be the number of neighbors that an infectious node meets until it recovers. This number, q, satisfies q = τ i=1 k i , where k i are sampled from p k and τ is sampled from φ(τ ). Even if the infectious node is a random neighbor, its degree distribution is p k when it comes to infect, since r = 1, namely it has new random degree and neighbors. Thus, as a sum of random variables [43] , q has the average q = τ k = (1 − γ)/γ k , and using Eq. (12), its generating function is (see SI Section 2.2) Due to the fully switching, it does not matter if the spreader is a random node or a random infected neighbor. Hence, which yields at criticality, The above case of fixed recovery time τ = 1 is included by substituting τ = 1 to get β c = 1/ k . Here γ c = k /( k + 1), above which there can not be a major outbreak for any β. Comparing Eqs. (17) and (20) for nonuniform recovery time, we recognize that for ER network where κ = k + 1, it follows that β ER c (r = 0) > β ER c (r = 1), implying that the contagion is spread better in fully-evolving network, rather than in a static network. It is interesting that this result is in contrast to the fixed recovery time τ = 1, for which β ER c is symmetric for substituting 1 − r instead of r (Eq. (9)). That is, not fixed unit recovery time, causes the dynamics of the network to enhance more the spread of the pandemic. The reason can be understood as follows. Suppose that a node is infectious for a time longer than one unit, then if it switches neighbors it has the opportunity to infect more nodes, while if it stays with the same neighbors it can at most infect all of them, it cannot infect the same node twice. This effect of rewiring does not appear of course at fixed recovery time τ = 1. However, Eqs. (24) and (25) imply that also fixed recovery time for any τ > 1 and recovery rate γ show for ER a specific value of r between 0 < r < 1 at which β c is minimal similar to the case of τ = 1, see Fig. 4d . No pandemic Figure 4 : Epidemic spread on evolving networks for nonuniform recovery time. (a)-(c) The likelihood of a major outbreak, P inf , versus the infection rate, β, for different rewiring rates r. Lines represent the theory for r = 0, 1 using Eqs. (14) , (15) and (19) , and symbols represent simulations results. The recovery rate is presented for values, (a) γ = 0.2 (b) γ = 0.5 and (c) γ = 0.67. In our simulations, we constructed ER networks with average degree k = 3 and size of N = 10 4 . We averaged the results over 10 3 realizations. Since the recovery rate γ = 0.5 yields τ = 1, it is comparable to the above case of fixed τ = 1, Fig. 2b . Note that for γ = 0.67 and r = 0 there is no transition since P inf = 0 for any value of β, see panel (e). (d) The critical infection rate, β c for a major outbreak, versus the rewiring rate, r, for different values of γ using Eqs. (24) and (25) and simulations. (e)-(f) Eqs. (24) and (25) provide a 3D phase diagram in (r, γ, β) space which splits into the outbreak phase and the no-outbreak phase. R 0 determines the boarders of these phases, R 0 > 1 is the condition for an outbreak. (e) β c below which there is no macroscopic pandemic. Note that in the blue area β c = 1 i.e. there is no pandemic for any β. (f)-(h) Cross-sections in the sub-spaces of (r, γ, β) for one fixed value (blue -no pandemic, yellow -pandemic). In SI Figs. S2 and S3, we present the results also for RR and SF networks. For the partial temporal network, 0 < r < 1, we calculate directly the critical conditions for a macroscopic outbreak. To this end, we track the reproductive ratio, R 0 , defined as the average number of neighbors that a random infected node infects until it recovers. Let us denote by I the random variable of the number of infections that a random infected node performs. I satisfies where I j is the number of infections our node acts at time j after it was infected. We seek for R 0 , which is just To this end, we write a recurrence relation for the degree, k j , and the number of susceptible neighbors, S j , of the infectious node at time j after it got infected (see details in SI Section 2.3), for 1 < j ≤ τ . These equations are based on considering both the possibility that our node switches neighbors just before time j, and the possibility that it does not. Even if not, each one of its neighbors might switch and get replaced by another node. We assume as above that any random new neighbor is susceptible since we look at the very first steps of the disease, thus the amount of infectious and recovered nodes is negligible. Solving this recurrence relation, we manage to obtain an expression for the reproductive ratio (see details in SI Section 2.3), where λ 1 = 1−r, λ 2 = (1−r) 2 (1−β), α = r(2−r) k /(1−(1−r) 2 (1−β)), α 1 = (1−r)(κ− k )/(1−(1− r)(1 − β)), α 2 = y 1 − rα 1 , and y 1 = (1 − r)(κ − 1 + r) + r k − α. Thus, R 0 captures all the parameters of the problem. It includes the structure-related attributes as well as the epidemic-related characteristics. The structure is represented by k and κ coming from the static pattern of the network and also by the rewiring rate r governing the network dynamics. The epidemic properties are the infection and recovery rates, β and γ. Next, we use the well-known [3] critical condition, to get the equation for the critical transition from P inf = 0 to P inf > 0, Note that Eqs. (24) and (25) converge, for fixed τ = 1, to Eq. (7) since for this case G τ (x) = x, and τ = 1, thus For a general fixed τ , to obtain R 0 , we just have to substitute in Eq. (24) G τ (x) = x τ . In Fig. 4 we show the results for the case of nonuniform recovery time with recovery rate γ for ER network (see SI Figs. S2 and S3 for RR and SF networks). Using Eqs. (14) , (15) and (19) , we show the probability of a macroscopic spread, P inf , depending on the recovery rate β for r = 0, 1, showing a good agreement with computer simulations results. For other values of r only computer simulations are presented. Note that larger γ gives smaller β c as expected (Fig. 4a-c) , and for large enough γ, and certain values of r, there is no macroscopic pandemic spread for any β (Fig. 4c) . The dependence of β c on r, for different γ values (Fig. 4d) , is different from the dependence for the fixed one unit recovery time, τ = 1, shown in Fig. 2e . While the latter shows non-monotonic and symmetric behavior, the former shows a monotonic increasing pattern except for γ close to one. The reason is related, as explained above, to the additional effect of the rewiring when the infectious time is larger than one unit. For the full range of 0 < r < 1, we present (Fig. 4e-f ), using Eqs. (24) and (25) the 3D phase diagram in (r, γ, β) space which splits into the outbreak phase and the no-outbreak phase. This 3D space combines the structure sub-space (r) and the epidemic sub-space (γ, β). R 0 is the parameter predicting the borders of these phases, R 0 > 1 leads to an outbreak, while if R 0 < 1 the epidemic will not spread macroscopically. A heat map of β c below which there is no a macroscopic pandemic reveals a region (Fig. 4e, in blue) in which β c = 1 i.e. there is no pandemic for any β. We further present some cross sections of the above mentioned phases in the sub-spaces of (r, γ, β) where one is fixed (Fig. 4f-g) . We explored how an evolving network in which the degree of each node changes randomly according to a fixed degree distribution, responds to epidemics. We found that different network structures show cardinal distinguished behaviors regarding the question: does dynamics in network structure aid the epidemic spread or restrain it? We also found that the well-known character of scale-free networks, the existence of a major outbreak under any infection probability, is broken in a fast enough evolving network, in which the epidemic does not occur for small infection rates. We further found an equation giving the critical condition for a major outbreak depending on all the parameters both of the structure and of the epidemic. Further study can explore epidemics on evolving networks with some non-homogeneous characters representing better realistic networks. For instance, an evolving network which comprises of few classes of people having different degree distributions. Each person preserves its degree distribution during all the epidemic process though its degree varies in time. These distributions can share the same shape but differ in the mean or std, or they can even be of completely different shapes. Moreover, the infection rate might be nonuniform among the population e.g. since part of the people are vaccinated while the rest not as happened in the last waves of the Covid-19 pandemic during 2020-2021. Another interesting direction to explore is the impact of the evolving structure on the efficiency of different vaccinating strategies. In this section, we consider the case in which the recovery time is fixed for each infected node, τ = 1. In Eqs. (3)-(5) in the main text, we present the equations for the probability of outbreak in evolving networks, G 0 , G 1 and G 2 , are the generating functions of the degree, residual degree, and the neighbor degree distributions correspondingly, defined by Below criticality (β < β c ), only the single solution (P inf = 0, v p = 1, v np = 1) satisfies Eqs. where G 0 (1) = k is the average degree, G 2 (1) = κ ≡ k 2 / k is the average neighbor degree, and G 1 (1) = κ − 1 is the average residual degree. As a fundamental character of a probability generating function, it satisfies G 0 (1) = G 1 (1) = G 2 (1) = 1. Dividing the second equation in (1.5) by the first one, we get plugging this into the first equation in (1.5) gives which finally yields Eq. (7) in the main text, (1.6) For scale-free networks (SF) whose degree distribution is p k = Ak −λ for k ≥ k 0 with λ ≤ 3, the second moment diverges, and therefore κ → ∞. If λ ≤ 2 then also the first moment diverges, k → ∞. Thus, from Eq. (1.6) we get Eq. (10) in the main text, Notice that β SF c = 0 since κ → ∞ for N → ∞. However, for a finite system, β c given by Eq. (1.6) is finite and dependent of N . However, β c approaches zero as N increases except the singular point r = 1 at which β c is non-zero, and equals 1/ k . In Fig. S1 we show this for λ = 2.5. Figure S1 : The critical infection rate for evolving SF networks. We show that when N increases the epidemic threshold, β c , approaches zero according to Eq. (10) in the main text, except at r = 1, where β c converges to a non-zero value. This is since for λ = 2.5, k converges when N increases, while κ → ∞. Here we constructed 500 scale free networks with k 0 = 2 and λ = 2.5 to get the mean k and the mean κ of them. We have done this for three sizes, N = 10 3 , N = 10 4 and N = 10 5 to. In this section we consider a general distribution for the recovery time τ , and particularly the case in which before each time unit the probability of an infected node to recover is γ. In contrast to the case we analyzed above in which the infectious time was fixed τ = 1, now the infectious time is random, distributed exponentially as The mean of this distribution is (2. 2) The generating function of φ(τ ) which we use in the main text and below is Because of the complexity of this case, we analyze P inf analytically for the extremes of static (r = 0) and fast-evolving (r = 1) networks. For the range 0 < r < 1 we find the critical condition for the epidemic spread. Here we analyze the case of static network, represented by r = 0. In this case the chance to infect a neighbor depends on the time of recovery, τ , of the infectious node. We denote this chance by p, and find that it depends on τ of the infectious node as Note that the recovery time, τ , of an infectious node makes the chances that it infects each of its neighbors dependent. Hence, the equations in this case are which yields which is Eq. (16) in the main text. For our case of recovery rate γ, let us find the inverse function of G τ , Substituting this in Eq. (2.6), we get which is Eq. (17) in the main text. For uniform τ , the generating function of τ is G τ (x) = x τ , thus the inverse function is G −1 τ (y) = y 1/τ , which leads to β c = 1 − (1 − 1/(κ − 1)) 1/τ , covering also the fixed one unit time τ = 1, for which β c = 1/(κ − 1). In this section all the network is redistributed at each time step. Now the probability of infection a neighbor is just β independent on τ since the parent switches its neighbors at each time step. However, the recovery time τ determines how many neighbors the parent meets before it recovers. Let q be the number of neighbors that an infectious node meets until it recovers. q satisfies where k i are sampled from p k and τ is sampled from φ(τ ). Even if the infectious node is a random neighbor, its degree distribution is p k when it comes to infect, since r = 1, namely it has new random degree and neighbors. Thus, as a sum of random variables [1] , q has the average The generating function of q is [1] , (2.11) which is Eq. (18) in the main text. Due to the fully switching it does not matter if the spreader is a random node or a random infected neighbor. Hence, P inf = 1 − v, and v = G q (1 − β + βv). (2.12) At criticality, as above in Eq. (2.5), we equalize the derivative of both sides of Eq. (2.12), Finally ,we obtain Eq. (20) in the main text, 2.3 Partial temporal network (0 < r < 1) In this interval, we calculate only the critical condition for a macroscopic outbreak. We look on random infected node, and calculate R 0 , the average number of infections it acts until it recovers. Let us denote by I the number of infections a random infected node performs. I satisfies where I j is the number of infections our node acts at time j after it was infected. We seek for R 0 which is just To find R 0 , we have to find first I j . Thus, we track the values of some relevant quantities related to our infectious node along the time until it recovers, for 1 < j ≤ τ . j captures the time after our infectious node got infected. k j is the degree at time j. S j represents the number of susceptible neighbors just before the infections of time j, I j is the number of infections done by our node at time j, and s j is the number of susceptible neighbors just after the infections at time j. The two first equations in Eq. (2.16) are based on the separation for the possibility that our node switches neighbors just before time j, and the possibility that it does not. Even if not, each one of its neighbors might switch and get replaced by another node. We assume as above that any random new neighbor is susceptible since we look at the very first steps of the disease, thus the amount of infectious and recovered nodes is microscopic. The last two equations in Eq. (2.16) use the infection rate to determine how many nodes, on average, become infectious rather than susceptible. To complete the picture, we add the state at time j = 1, (2.17) The reason is that the degree of our infectious node while it gets infected is the typical one of a neighbor, which is on average κ. The degree after one unit time depends on whether our node performs a switch and gets a random degreewith mean k or stays with κ. This explains the first equation. The second equation is different since we assume that all the neighbors are susceptible except the parent node which infected our node. However, there is a chance that the parent switched neighbors meanwhile. Thus, instead of κ there is κ−1+r. To summarize, we got a recurrence relation for k j and S j , (2.18) To solve this, we substitute . (2.20) The new recurrence relation obtained for the new variables x j and y j is and in vectors language, Let us denote this equation by where u j = (x j , y j ) T . The sign ( ) T represents the transpose operator. The eigenvalues of the matrix A are The corresponding eigenvectors are Given the initial conditions x 1 and y 1 , providing Taking only the second row of the last equation, we obtain Holding this solution for the recurrence relation we move to calculate a quantity leading us towards the desired R 0 , which is the average number of infections that an infected node does given it takes time τ until its recovery. (2.29) For R 0 , we average over all possibilities of τ , to get Eq. (24) in the main text, (2.30) For criticality we use the known critical condition [2] R 0 = 1. (2.31) λ 1 , λ 2 , and α which appear in R 0 are given in Eqs. (2.24) and (2.20) . We still have to find α 1 and α 2 using the initial condition and the eigenvectors, Eq. (2.25). Since we solve The solution is , . (2.33) The initial conditions, using Eqs. (2.17) and (2.19) , are Therefore, the explicit expressions for α 1 and α 2 are finally (2.35) In Fig. S2 we show the results for the case of nonuniform recovery time with recovery rate γ, for random regular network (RR), and in Fig. S3 for scale-free network (SF). This is in addition to the results for Erdős-Rényi network (ER) presented in Fig. 4 in the main text. No pandemic Figure S2 : Epidemic spread with recovery rate on evolving RR networks. (a)-(c) The likelihood of a major outbreak, P inf , versus the infection rate, β, for different rewiring rates r. Lines represent the theory for r = 0 and 1 using Eqs. (14) , (15) and (19) in the main text, and symbols represent simulations results. The recovery rate was set to be different values, (a) γ = 0.2 (b) γ = 0.5 and (c) γ = 0.7. In our simulations, we constructed RR networks with uniform degree k = 3 and size of N = 10 4 . We averaged the results over 10 3 realizations. For γ = 0.7 and r = 1 there is no transition since P inf = 0 for any β, see panel (e). (d) The critical infection rate, β c for a major outbreak, versus the rewiring rate, r, for different values of γ using Eqs. (24) and (25) in the main text and simulations. (e)-(f) Eqs. (24) and (25) in the main text provide the 3D phase diagram in (r, γ, β) space which splits into the outbreak phase and the no-outbreak phase. R 0 determines the borders of these phases, R 0 > 1 is the condition for an outbreak. (e) β c below which there is no macroscopic pandemic. Note that in the blue area β c = 1 i.e. there is no pandemic for any β. (f)-(h) Slices in the sub-spaces of (r, γ, β) for one fixed value (blue -no pandemic, yellow -pandemic). Figure S3 : Epidemic spread with recovery rate on evolving SF networks. (a)-(c) The likelihood of a major outbreak, P inf , versus the infection rate, β, for different rewiring rates r. Lines represent the theory for r = 0 and 1 using Eqs. (14) , (15) and (19) in the main text, and symbols represent simulations results. The recovery rate was set with varying values, (a) γ = 0.2 (b) γ = 0.5 and (c) γ = 0.7. In our simulations, we constructed SF networks with k 0 = 2, λ = 2.5 and size of N = 10 4 . We averaged the results over 10 3 realizations. (d) The critical infection rate, β c for a major outbreak, versus the rewiring rate, r, for different values of γ using Eqs. (24) and (25) in the main text and simulations. Here we averaged over 500 realizations. (e)-(f) Eqs. (24) and (25) in the main text provide the 3D phase diagram in (r, γ, β) space which splits into the outbreak phase and the no-outbreak phase. R 0 determines the borders of these phases, R 0 > 1 is the condition for an outbreak. (e) β c below which there is no macroscopic pandemic. Note that in the blue area β c = 1 i.e. there is no pandemic for any β. (f)-(h) Slices in the sub-spaces of (r, γ, β) for one fixed value (blue -no pandemic, yellow -pandemic). To define P inf in the simulations of Figs. 2 and 4 in the main text, we had to set a threshold for the number of infections above which the spread is regarded as macroscopic. We set this threshold to be N/20. We support this setting in Fig. S4 where we show similar results for different sizes of system with the same threshold N/20. Similarly, to define β c in the simulations of Figs. 2 and 4 in the main text, we had to set another threshold for P inf above which we say that the chance of a major outbreak is nonzero. Since our systems are finite the transition is not very sharp, and thus we should set a threshold larger than zero. We set this threshold to be 10 −2 . One exceptional case is Fig. 2e in the main text where we focus on high resolution thus we tune the threshold for P inf as 1.5 × 10 −2 to obtain a better agreement with the theory. The second exception is Fig. 3d in SI for SF where the transition is very gradual, hence to catch the criticality accurately we set the threshold for an infinite group as N/100, and the threshold of P inf as 2 × 10 −3 . In Fig. S4 , we support the setting of Fig. 2e in the main text where we show similar results for different sizes of system with the same threshold 1.5 × 10 −2 . Figure S4 : Support of numerical simulations thresholds for different system sizes. The critical infection rate for an outbreak β c vs the rewiring rate r where the recovery time is τ = 1 as shown in Fig. 2e in the main text. We show here two system sizes using the same threshold N/20 for an "infinite" group, to calculate P inf , then we set the same threshold 1.5 × 10 −2 for P inf to find β c . We averaged over 10 3 realizations. We show that the simulations results are close to the theory in both different sizes of the system. Containing papers of a mathematical and physical character Infectious diseases of humans: dynamics and control Modeling infectious diseases in humans and animals Statistical mechanics of complex networks Networks -an introduction Complex networks: Structure, robustness and function Epidemic spreading in scale-free networks Spread of epidemic disease on networks Romualdo Pastor-Satorras and Alessandro Vespignani. Dynamical patterns of epidemic outbreaks in complex heterogeneous networks The implications of network structure for epidemic dynamics Critical phenomena in complex networks Using mobile phone data to predict the spatial spread of cholera Spatial spread of the west africa ebola epidemic Epidemic processes in complex networks Identification of influential spreaders in complex networks Searching for superspreaders of information in real-world social media Virus spread in networks The dynamic nature of contact networks in infectious disease epidemiology Contact networks in a wild tasmanian devil (sarcophilus harrisii) population: using social network analysis to reveal seasonal variability in social behaviour and its implications for transmission of devil facial tumour disease How disease models in static networks can fail to approximate disease in dynamic networks The origin of bursts and heavy tails in human dynamics Epidemic dynamics on an adaptive network Susceptible-infected-recovered epidemics in dynamic contact networks Epidemic thresholds in dynamic contact networks Analytical computation of the epidemic threshold on temporal networks Toward epidemic thresholds on temporal networks: a review and open questions A network epidemic model with preventive rewiring: comparative analysis of the initial phase A stochastic SIR network epidemic model with preventive dropping of edges SIR epidemics on evolving graphs Activity driven modeling of time varying networks Epidemic threshold and control in a dynamic network Temporal percolation in activity-driven networks Continuous-time discrete-distribution theory for activity-driven networks Virus propagation on time-varying networks: Theory and immunization algorithms Resilience of the internet to random breakdowns Dynamic networks and directed percolation Percolation structures and processes Random graphs with arbitrary degree distributions and their applications Epidemic threshold for the susceptible-infectioussusceptible model on random networks Network robustness and fragility: Percolation on random graphs Univariate discrete distributions Univariate discrete distributions Infectious diseases of humans: dynamics and control