The recent COVID-19 pandemic has demonstrated the necessity to develop and study effective models of epidemic dynamics [AM91] . Classical epidemic models are compartmental models leading to relatively simple low-dimensional ordinary differential equations (ODEs) [BvdDW08, DH00] . These minimal ODE models can be derived from first principles [KMS17] but often suffer from very strong assumptions, such as a sufficiently high link density within the network of individuals. Within the past two decades, it became apparent that viewing the structure of the contagion process via a network science approach is crucial [PSV01, CBBV06, Dur10, HK11, PSCMV15, TKH20] . During the COVID-19 pandemic it became clear that there are two major effects controlling direct epidemic spreading in humans without an available vaccine or immediate medical treatment: exogenous quarantine measures [MB20, KKC + 20] and endogenous social self-distancing (or social avoidance) of existing contacts [GBB + 20]. Formally, measures can be considered on a finer scale, such as (digital) contact tracing [FWK + 20, KRB + 20]. Yet, most non-pharmaceutical interventions (NPI) can be grouped into external/exogenous ones leading effectively to quarantine-type effects, and intrinsic/endogenous ones within a population that lead effectively to a social re-organization of contact networks.
In this work, we are interested in developing and analyzing effective, yet tractable mathematical network epidemic models to understand how to compare and balance the effects of quarantining and social self-distancing. Motivated by the COVID-19 pandemic [TKH20] , we start from a standard susceptible-infected-recovered (SIR) model on a complex network [KMS17] . Next, we use two well-established modelling approaches. First, we simply add another possible quarantine state, X, of the nodes [MB20, PKG + 20] together with a transition rate, κ, of infected individuals to transition to state X. Second, we use a social self-distancing rule of susceptible individuals trying to avoid contact with infected individuals leading to re-wiring of links [GDB06, SS08, RGZ09] controlled by a re-wiring rate, w; we keep the population size and the total number of links fixed to account for the propensity to keep social contact. Note that re-wiring links makes the network fully adaptive [GS09] , i.e., there is dynamics on and of the network. The resulting model is a Markov chain on all possible node states and all possible edge configurations. It can be simulated on small to medium size networks, but becomes quickly computationally intractable on large networks. For this reason, we derive suitable ODE approximations [KMS17] based on a moment-closure approximation [Kee99, KRM97, GDB06, Kue16] . This approximation technique can also account for the dynamically changing connectivity of the network. We obtain a hierarchy of models. A particular model is obtained after fixing a truncation level. In our analysis we focus on the second-order or pair-approximation moment-closure, which leads to a five-dimensional ODE. We compare medium-size direct network simulations with ODE simulations.
As a next step, we investigate the main questions associated with SIR-type models: (I) Does an epidemic spread happen, or does it decay immediately? (II) How big is the cumulative size of the epidemic outbreak? (III) What is the maximum size of the infected population during an epidemic? As expected, the first question (I) can be calculated directly using local analysis and we can express the epidemic threshold as a function of the re-wiring rate w and the quarantine transition rate κ in the approximating ODEs. Questions (II)-(III) are much harder to address as network structure effects preclude the application of classical methods from mathematical epidemiology to calculate the SIR outbreak size and/or the maximum peak . Here we develop a new technical tool by viewing the outbreak size as a  global observable and applying moment-closure methods and integral estimates on the level  of this observable. This technique leads to an upper bound on the global outbreak size within  suitable parameter regimes, which we cross-validate numerically. From a public health perspective, we find that large parameter regimes in the (w, κ)-plane show a linear, or almost linear relationship regarding the effects of quarantine versus social self-distancing leading to a bounded triangular region, within which the epidemic cannot be avoided, controlled, or contained efficiently. This shows that there is a balancing effect between strong quarantining and social self-distancing, i.e., the weakening of one measure necessitates the strengthening the other and vice versa. On the one hand, this is an intuitive result. On the other hand, it arises without any major assumptions in broad parameter regimes in a complex fully-adaptive network epidemic model. In addition, it can be observed in network-and ODE simulations, and can be analytically treated both, locally and globally via nonlinear dynamics techniques. Hence, it seems advisable, when reducing or observing the reduction of mitigation measures, i.e., a decrease of w and/or κ, to avoid entering the dangerous triangle region as there is no easy way to leave it again by a simple small change.
The paper is structured as follows: In Section 2 we provide the detailed mathematical model for adaptive social self-distancing models with quarantine including moment-closure via pair approximation; in the appendix we also develop more complicated higher-order moment-closure models. In Section 3 we present our main analytical and numerical results including a new global moment-closure viewpoint for global observables. In Section 4, we provide a summary and outlook, how our approach can be extended to wider set of applications.
Here we compare two different, yet comparable, measures present in most epidemics: social self-distancing, i.e., nodes/agents avoid infected individuals simply due to the risk of acquiring the disease themselves, and external quarantine measures, which enforce the removal of infected nodes from the population. It is evident from data that both measures have played a key role during the COVID-19 pandemic [MB20, KKC + 20, GBB + 20]. To account for the complex social structure, we start with microscopic Markov process models of susceptibleinfected-recovered (SIR) dynamics on general networks with N nodes, K undirected links, and node states S, I, and R. Then we add mitigation measures to the SIR model. The well-known basic SIR rules are:
• (infection) infected I nodes infect susceptible S nodes along susceptible-infected SI links with a rate β > 0.
• (recovery/death) infected I nodes become recovered R nodes at a rate γ > 0. One way to model social self-distancing [GDB06, SS08] is the preference of the susceptible S nodes to avoid interactions with the infected I nodes:
• (social self-distancing) SI links are re-wired to susceptible-susceptible SS links at a rate w ≥ 0.
The self-distancing/re-wiring rule makes the network fully adaptive [GS09] and allows for very general network topologies. The rule also takes into account that links are not lost, which mirrors the desire to keep as many social connections as possible and to optimally re-wire them to mitigate risk. While it is straightforward to simulate the resulting Markov process on any given network, the simulations become prohibitively expensive for large N . It is also straightforward to use the master equation for the resulting Markov process [Nor06] and arrive at the following set of ODEs via standard techniques [KMS17] [SS08, GDB06] . Note that we do not allow recovered individuals to pass back into the susceptible compartment, which makes sense if we assume that immunity is acquired upon recovery, e.g., as conjectured to be true on certain time scales of interest for COVID-19. Although the ODEs (1) are actually exact in the mean-field limit [KMS17] for any graph, they are not closed as we have not written down the equations for the SSI and ISI motifs. Although these equations could be derived, they would depend on fourth-order motifs, and so on [Kue16, HK11] .
To avoid studying an infinite system of ODEs, we employ a standard moment-closure pair approximation [KRM97, Kee99, KMS17, GDB06] , assuming that 
(2)
Here we made use of node conservation and the notation ρ AB ≈ [AB]/N to emphasize that we are working with approximate per-node densities after moment-closure has been applied. As such, the equations (2) only cover the aspect of social self-distancing and take into account the complex adaptive network structure via a second-order closure. We take into account quarantine effects, such as in the modelling of COVID-19 in [MB20] . In [MB20] , network structure was not considered. Quarantine effects lead to certain features of epidemic spreading that cannot be captured by classical SIR models. We denote the quarantined compartment by X. The rules we use are:
• (quarantine) infected I nodes are quarantined into a state X at a rate κ ≥ 0.
• (recovery of X) quarantined nodes are released into the recovered compartment R at rate δ > 0.
In particular, we consider quarantining and rewiring only for the infected compartment. This is a simplification of the present model and is not pursued like this in many real contact tracing efforts. The expected release time from the X-compartment is T = 1/δ, since the rates are Poissonian. However, δ does not have an effect on the amount of nodes in the infected compartment in this model and for any positive δ the amount of nodes in the recovered compartment for t → ∞ is also independent of δ. With these quarantine rules, we obtain the non-closed moment equations:
More complicated variants of the rules are discussed in Appendix A. We see that the parameters appear linearly in the equations, so that any one of them can be used to re-scale the time, e.g. t → γt. This leaves four effective dynamical parameters β, w, κ and δ. The last one does not affect the infected compartment or the recovered compartment at infinity and is therefore not part of the subsequent analysis. Using a moment-closure pair approximation, we get the closed system
that allows us to compare the effects of social self-distancing and quarantine. We compare this model with full network simulations in Figure 1 . The results show excellent agreement for the vast majority of sample runs for a large part of the parameter space, when w, κ > 0; see also Appendix B for additional comparisons, where even for the singular cases w = 0 or κ = 0 excellent agreement is observed.
In contrast to SIS or SIRS, an epidemic eventually dies out for a standard SIR model. Hence, three questions arise:
(I) Given an initial density of infected I(0) sufficiently close to the disease-free state, does the epidemic spread, or does it die out almost immediately?
(II) How big is the cumulative size of the epidemic outbreak R ∞ (we use r ∞ for the corresponding density)? R ∞ measures the total number of nodes at t → ∞ in the recovered compartment R (respectively r ∞ is the corresponding density).
(III) What is the maximum size of the epidemic,[ I] := max t I(t), i.e., what is the height of the highest peak?
To answer (I), the local calculation near the disease-free state is relatively simple if we have a closed ODE model. For example, consider the adaptive SIR model without quarantining (2) and use the disease-free state ρ * with ρ I = ρ R = ρ SI = 0 and ρ SS = µ/2, i.e., also all links are of type SS. Here µ is the average degree of the network, which equals 2K/N for a network with K edges. Linearizing the vector field at ρ * , we find that for an epidemic dies out exponentially fast. A very similar calculation for the full model (4) reveals:
as the critical threshold for the infection rate. We see that on a local level near ρ * , the effects of self-distancing and quarantine are comparable as the rates of both processes lower the critical threshold in a linear way. These results are completely consistent with the numerics. Figure 2 shows the rate β at which we record an epidemic outbreak/growth for direct network simulation, as well as for numerical integration of the mean-field ODEs. The linear level-set structured in the (w, κ)-diagram expected from (6) is clearly visible on the network simulation and the ODE integration levels. This answers questions (I), and means that a combination of measures is particularly effective to contain a disease early on. Since it is unrealistic to assume that social self-distancing happens effectively in the situation of a new disease, our SIRX model suggests that one has to compensate and focus more on quarantine measures of infected individuals in the early phase.
However, the local structure near the disease-free state only yields a partial picture of SIR models. In fact, one often does observe epidemic outbreaks for SIR-type dynamics. For this case, we study r ∞ to answer our second question (II). Figure 3 shows r ∞ for a range of values near the epidemic transition in the (w, κ)-plane. We compare numerical simulations that estimate lim t→∞ R(t)/N with the pair approximation ρ R,∞ := lim t→∞ ρ R (t) of equation (4).
The numerical results indicate another linear relation between the parameters w and κ. In general, it is impossible to get an exact formula for the cumulative size of the epidemic outbreak for an arbitrary model for SIR-type dynamics on complex networks. Yet, we can arrive at an implicit formula starting with in our adaptive SIRX model (3). We denote the 
where we used [R](0) = 0 and we have omitted the argument t of the last integrand for brevity. Now we use the differential equation for [R] and insert it to get
We have obtained two integrals, which would suffice to calculate r ∞ . Using the same idea as for [R], we find for [I] and [X] that
as there cannot be any quarantined infected nodes in the beginning or at the end of the epidemic. Using the ODE for [I], we get
Several crucial observations are evident from the last formula. The procedure generically does not terminate on the infinite network level as in generic cases, we expect that all motifs could eventually occur. This means that without further assumptions only an infinite series expression for R ∞ is obtained or we could obtain upper or lower bounds. Still, the infinite series and particularly upper bounds are very informative as they can display the influence of the different parameters and link them to higher-order network motifs. Indeed, at the next step, the expected number of links comes into play. We get
and we obtain
The infinite sum will yield new motif terms involving infected nodes at every step at the time t = 0. This demonstrates the key importance of the network structure. For example, a highly connected first cluster of infected nodes yields a large number of SI-links and thereby a large final outbreak size. We could continue this procedure to obtain an infinite series formally but this does not give any concrete quantitative approximations. Instead, we aim for an upper bound of the total number of infected/recovered.
The key new technical step is that we directly impose the moment-closure pair approximation directly on (7), using the approximate densities ρ I , ρ R , ρ SI and ρ SS of the closed equations (4). We get an approximation for r ∞ in terms of ρ R,∞ := lim t→∞ ρ R (t),
Using βρ SI = −ρ S and applying the logarithmic derivative gives
where K 0 := ρ I (0) + β β+γ+w+κ ρ SI (0) > 0. Integration by parts and ln(x) = −| ln(x)| for x ∈ (0, 1] yields
Next, we use | ln(ρ S (t))| ≥ | ln(ρ S,∞ )| = − ln(1 − ρ R,∞ ) and we make the assumption that 2ρ SS −ρ SI ≤ 0 for all times (see the computations below for further justification of this assumption). Then we obtain the bound For each infection rate we show the boundary for a set of initial conditions to illustrate the dependence on ρ I (0) and ρ SI (0). For the initial SI-link density we choose a mean-field scenario (dashed line) with ρ SI (0) = µρ S (0), a scenario (dash-dotted line) with dis-proportionally many initial SI-links ρ SI (0) = 6µρ S (0) and a scenario (dotted) with very few SI-links ρ SI (0) = (µ/5)ρ S (0). One may also see the mean-field transition lines (solid lines) at the respective infection rates in the respective colours. They all lie within the positivity region. All parameters are as before, in particular µ = 15.
Simplifying finally yields the desired upper bound
The bound (9) is a transcendental inequality in ρ R,∞ . Regarding our assumptioṅ
we find that it holds numerically for a broad ranges of parameters. In Figure 4 (b) we show the domains of validity for the positivity assumption in the (w, κ)-plane for a range of infection rates and initial conditions. The assumption holds in a neighbourhood around the critical transition.
Note that our analysis is in sharp contrast to the classical three-dimensional SIR ODE model, where an exact implicit functional relation for r ∞ can be obtained. Therefore, having an upper bound available such as (9) helps us to study the parameter dependencies. The same linear combination of the two parameters w and κ appears as in the local bifurcation case near the epidemic threshold. Now however, they occur via an inverse. The same conclusions as for the local epidemic spreading near the outbreak threshold are valid: we need a linear mix of quarantine and social self-distancing to keep the total number of infected r ∞ under control. Figure 4(a) shows a comparison of the upper bound for with numerical simulations of the full network as well as simulations of the pair approximation ODEs. Both capture the main trend well that occurs when the infection rate is increased. When the total infected population is around the ten percent level, our approximations show that employing a combination of quarantine and social-distancing might be effective in practice, while going beyond this level, a very steep increase of the total number of infected occurs.
Finally, we answer question (III) regarding the maximum peak[ I] of the number of infected, i.e.,[ I]/N is the maximal fraction across the entire duration of the epidemic. Figure 5 shows the corresponding results comparing direct network simulations in Figure 5 (a) with mean-field approximations in Figure 5 (b). The structure of the results is familiar in the sense that a linear dependence between w and κ emerges for our studied parameter ranges. Therefore, one can conclude that using a well-tuned combination of quarantine and social self-distancing outside of a triangular region in (w, κ)-space is likely to be not only effective in preventing outbreaks, or reducing the total number of infected during epidemic, but also to prevent high peaks.
In this work, we have provided three contributions. First, we developed a new type of adaptive network models that include two of the most important epidemic control measures: quarantine and social self-distancing. We derived mean-field models via pair approximation; even more detailed approximation schemes are discussed in the appendix. Second, we analyzed the new model via a numerical combination of direct network simulations and mean-field ODEs, which show excellent agreement. We focused on three questions regarding We also indicate the critical curve, as calculated from (6). We can see here a slight deviation, which can be explained by the fact that the simulations are random processes. The average of sample path maxima over many sample paths is not the same as the maximum of the average of sample paths. The former overestimates the expectation value of ρ I . Again N = 500, µ = 15, γ = 0.025, β = 0.0025, δ = 0.01, ρ I (0) = 0.01 and ρ SI (0) = µρ I (0).
(I) the epidemic threshold, (II) the total number of infected individuals, and (III) the maximum peak of the epidemic. In all three cases, we demonstrated for a broad range that the parameters controlling quarantine and social-distancing enter in a comparable linear combination to control the epidemic spread. This has the practical implication that a suitable combination of these two measures outside of a well-defined triangular region in parameter space is the best choice as one cannot expect either measure to be executed perfectly in practice. Third, on a technical level, we have shown a new way to provide estimates for the total infected population during an epidemic by using pair approximation and integral estimates directly on the level of the final infected number observable. This provides a new technical tool for broad classes of epidemic models on networks since one can now aim to employ moment-closure on many other observables directly.
Of course, many generalizations of the presented model are possible. For example, one could try to use slightly different rules for the link dynamics allowing for link deletion [BBLS19, TW13] . Yet, we conjecture that the same analysis principles we have developed here still apply. Furthermore, it would be desirable to not only consider the mitigation of the epidemic itself but also whether quarantine and social self-distancing can help us or are detrimental to detect early-warning signs for large epidemic outbreaks [OD13, WK16, BOM + 18]. This line of research has already been started in recent years for epidemics on adaptive networks [KZG15, HKT18] but the interplay between pre-epidemic mitigation measures and warning signs has remained unexplored.
(FFG) under projects 857136 and 873927, and the Medizinisch-Wissenschaftlicher Fonds des Bürgermeisters der Bundeshauptstadt Wien under project CoVid004.
In this appendix, we provide more details on moment-closure schemes and the derivation of our reduced system. Beyond the pair approximation (4), refined approximation schemes are possible, which we present in this appendix in more detail.
A.1 Full closed equations up to second order motifs First, we write down the full closed equations up to second-order motifs, which are given by These equations can also be written in the alternative form via pair approximation densities as follows d dt This latter model has the following density representation:
After the usual reduction steps, we obtain a closed system of eight ODEs for the densities
ρ IXs = − δρ IXs − γρ IXs − (κ 0 + κ)ρ IXs + κρ SI .
In future work, it could be interesting to study the differences between the slight variations of adaptive social self-distancing epidemic networks with quarantine we presented in this appendix. Yet, we conjecture that the key major effects to understand the control of the disease are already displayed by our five-dimensional main system (4).
In this appendix, we collect several additional examples of comparisons between direct network simulations and the moment-closure equations (4). As outlined in the main part of the paper, we are particularly interested in the parameters w controlling the re-wiring of social self-distancing and the quarantine rate κ. We have already shown a comparison in Figure 1 , where κ > 0 and w > 0, which showed very good agreement between network dynamics and the moment-closure approximation. To check the robustness of the approximation, we provide here also in Figure 6 the case w = 0 and κ > 0, while in Figure 7 we consider κ = 0 and w > 0. Even for these quite singular cases, the approximation via second-order moment-closure works extremely well. 