Introduction

Host-parasite systems are widespread in nature. Understanding the selection mechanisms underlying virulence and pathogen transmissibility is essential to control outbreaks and disease progression in the long term1. Humans, livestocks, and crops are the most studied hosts due to their relevance for human activities. Despite some commonalities, different hosts differ profoundly in strategies that have coevolved with pathogens, such as immunity or avoiding behaviour, but also in intrinsic features, such as their degree of mobility. As evidence supports, pathogens specific of different host categories display diverse adaptive strategies2,3,4.

Early models in epidemiology were developed two centuries ago, at a time when empirical data was scarce5. A modelling standard was much later set by compartmental epidemiological models6, which classify the individuals in a population in a few states (susceptible, infected, recovered–SIR models) and are usually formulated as a set of differential equations at the mean-field level–i.e. assuming a well-mixed population. In the last forty years, many efforts have been devoted to devise and analyse mathematical and computational models able to explain and predict the evolution of viral traits6,7,8,9. Recently, the ability to obtain and process big data, along with the development of detailed metapopulation models, has allowed for the achievement of reasonably accurate estimations of epidemic spreading in the short term10,11.

Pathogens are in need of suitable strategies in order to persist in a host population, in a continuous arms race with the defenses of the host. Understanding which strategies are selected along evolution may help developing improved epidemiological models that include the long-term behaviour of the strains. The classical theory8,12 assumed that new pathogens, not adapted to the host, are more virulent (where virulence is understood as the number of deaths caused by the disease in a given time interval). Indeed, mean-field SIR epidemiological models predict that the base reproductive number R0, defined as the average number of infections produced by an infected individual, tends to increase along evolution6. Maximization of R0 in a finite population, however, exhausts the pool of susceptible individuals, leading to pathogen extinction. A possible way out of this runaway process would be for the pathogen to become less virulent as it co-evolves with its host; however, a revision of experimental data shows that this hypothesis does not hold in general6,7. As an alternative solution, theoretical models proposed that pathogens should be subjected to a trade-off between virulence (formally cast as the infection period or the death rate of infected individuals) and transmission, such that more virulent strains have lower transmission rates8. The equilibrium between transmission and infection period8,13 or transmission and death rate of the host9 results in a limit to the reproduction speed, i.e. in a maximum value of the base reproductive number, thus yielding a possible explanation for the existence of strains with intermediate values of R0. The trade-off hypothesis has been questioned in the last years for several reasons. One of the most important issues regards a definition of virulence able to link observed data with theoretical models. As a consequence, as of yet, there is little available empirical evidence supporting the existence of such physiological trade-offs14.

The transmission of pathogenic diseases rarely occurs in a host population that is well mixed, such that an important issue in infection propagation is the role played by structured host populations15 and the evolutionary parameters characterizing pathogen strategies16. Many models have studied the effect of space and network structure in disease spreading17,18. There is ample theoretical evidence that the evolutionarily stable traits of pathogens significantly differ in well-mixed or spatially structured scenarios1 and that space has important effects on evolutionary dynamics19,20,21 as well as on the effects of different functional forms of the a priori trade-off between transmission and virulence22. Quantitative and also qualitative properties of the epidemic process differ in spatially explicit, lattice-like environments when compared to situations where the network of contacts among hosts is heterogeneous. For instance, the presence of highly connected hosts, known as superspreaders, might facilitate the propagation of a disease in heterogeneous networks with respect to their homogeneous counterparts23. However, heterogeneous networks render a resident strain more resilient to invasion by new variants24, and might be a selective factor for pathogenic variants with increased transmissibility25.

Several studies suggest that trade-offs do not necessarily come from the physiology of the pathogens, but might arise as an emergent property of a spatially structured host-pathogen system9,12,26,27,28. The phenomenology of spatially (self-)structured host-pathogen systems has important features that sets them apart from mean-field approaches. The exhaustion of hosts by highly pathogenic variants becomes localized both in space and in time; through evolution, a hierarchy of time scales related to mutants of decreasing virulence defines a collective and time-dependent invasion fitness27. Also, it has been found that the spatial structure is enough to select for intermediate virulence values9, and that the recovery-transmission trade-off can emerge due to spatial structuring of the hosts in a lattice, even when the infection characteristic time and the transmission rate evolve independently28.

The effects of spatial structure on the evolutionary parameters of pathogens and the possible existence of emergent trade-offs has recently received empirical support. Experiments with two variants of the phage λ infecting E. coli have demonstrated that spatial structuring impedes the spread of the virulent variant, and selects for a prudent infection strategy29. Also, it has been shown that high host availability favours parasites with lower virulence and higher transmissibility, while low host availability selects for the contrary relationship, experimentally demonstrating the existence of a trade-off promoted by spatial structure30.

Though a few studies have emphasized the important role played by host-mobility fluxes under a metapopulation structure31,32, host mobility is not typically included in evolutionary models. Interestingly, the effects of host mobility on pathogen infectivity have been empirically evaluated in a series of experiments where insect larvae living in environments that limited their mobility to different extents were infected with a species-specific virus33: in agreement with expectations, infectivity was reduced concomitantly with host mobility.

Here, we address the question of the limits to the emergence and the structural stability of the trade-off between transmissibility and virulence in a spatially-explicit, SIR model under a variety of scenarios that represent realistic features of different host or pathogen types: local diffusion and long-range jumps of hosts (as for cattle or foraging animals, e.g.), high mutation rates (as for virus or viroids), and metapopulation structure. To this end we implement the model by Ballegooijen and Boerlijst28 and first characterize, in terms of invasibility criteria, the feedback evolutionary mechanism that selects for a curve of constant R0. We show that this curve is a critical self-evolved boundary34, whose functional form we calculate in a one-dimensional approximation, that separates two regions with qualitatively different spatial structure. While that evolutionary outcome is mostly robust under variations in the parameters, it is very fragile under host mobility. Finally, we extend our main results to a metapopulation model, showing that the main mechanism of evolution in the metapopulation is infection propagation within each subpopulation. Self-structured and disordered (mean-field) states are characterized by different average lifetimes that entail an asymmetric invasion likelihood such that, in metapopulations with mobile hosts, convergence to the critical boundary is favoured by the metapopulation structure.

Model

Following28, we define a host-pathogen dynamical model on a two-dimensional lattice with Moore neighbourhood (each node has 8 neighbours) and periodic boundary conditions. Each individual occupies a lattice site that can be either in a susceptible (S), infected (I) or recovered (R) state; transitions between these states are controlled by the stochastic reactions

$$S+I\mathop{\to }\limits^{{\rm{\beta }}}2I$$
(1a)
$$I\mathop{\to }\limits^{\mathrm{1/}{{\rm{\tau }}}_{I}}R$$
(1b)
$$R\mathop{\to }\limits^{\mathrm{1/}{{\rm{\tau }}}_{R}}S,$$
(1c)

where β is the rate of infection, and τI and τR are, respectively, the infection and recovery times (see Fig. 1). Each node has an internal time counter in order to trigger reactions (1b) and (1c); in either case, transitions occur precisely at a fixed value of τI and τR, so the distribution of infection and recovery times are delta functions. As in28, we employ a fixed time-step algorithm with synchronous update for numerical simulations. At each time step, we loop over the nodes. If a node is in the susceptible state, we identify its infected neighbours, compute the total infection rate, and infect it with the corresponding probability. If a node is in the infected or recovered states, we check if the internal counter is greater than the infection or recovery times, respectively, in order to change its state. The detailed procedure is explained in Methods. The choice of periodical boundary conditions leads to the appearance of finite size effects, which are discussed in the Supplementary Information. We have ensured that such effects do no affect the results presented here.

Figure 1
figure 1

Schematic description of the model. Each site in the lattice can be in one of the three states, infected (I, red), susceptible (S, gray) or recovered (R, blue). The colour code for states is maintained all through this work. Each infected site corresponds to an infected host characterized by a pair of values s = (β,τI). An internal time counter for each site triggers reactions (b) and (c). The time counter is reset to zero when the state changes.

Each infected node j has its own transmission rate βj, as well as its own infection period τIj. A strain is defined by a pair s = (β,τI) with no a priori imposed trade-off. Both parameters are independently mutated at each time step with probability μΔt, where μ is the mutation rate and Δt is the timestep. We assume superinfection exclusion, so a host individual in state I cannot be infected by a second strain.

To introduce host local diffusion we employ the Toffoli-Margolus algorithm35. This algorithm divides the lattice in 2 × 2 squares that rotate either clockwise or counterclockwise. Briefly, squares are taken starting alternatively from (0, 0) and (1, 1) so the system becomes mixed, as illustrated in Fig. 2, regardless of the state of the site.

Figure 2
figure 2

Schematic representation of the Toffoli-Margolus algorithm. The leftplot shows how rotation is applied when starting from (0,0); the right plot shows rotation from (1,1). When both steps are alternated, the system is diffusively mixed.

In a lattice, diffusion is defined as D = Γ(Δx)2, where Γ is the rate at which particles hop and Δx = 1 the distance between sites. Since every time the mixing algorithm is applied every particle hops to a neighbouring site, Γ can be fixed in order to have the desired diffusion coefficient D as Γ = 1/(DΔt).

To recreate a metapopulation scenario, we use a scheme similar to that implemented in previous studies31,32. We create a network of lattices of small sizes and connect them in a metapopulation network. After updating all lattices following the previous algorithm, we check the state of each population. Each host (for which the state of a site acts as a proxy) can jump with probability λΔt/N, where λ is the jump rate. If the jump occurs, we randomly select a site in a neighbouring lattice, as shown in Fig. 3. Then, both sites (their states) are exchanged. We fix λ = 0.01.

Figure 3
figure 3

Metapopulation structure and site jump dynamics. (a) Example of the metapopulation structure. It consists of 25 lattices, each one defined by a diffusion D. We use a fully connected network for the simulations. (b) Example of two subpopulations at a given time. Each node has a probability λΔt/N of jumping. (c) A site (highlighted in yellow) in the first subpopulation is randomly selected according to the previous probability to jump to the second subpopulation. (d) For each node that jumps, a target node in the second subpopulation is selected. (e) The state of the two nodes is swapped.

Results

Spatial self-structuring results in an emergent trade-off between transmissibility and infectivity

We start by simulating infection propagation and evolution without host mobility, i.e. with D = 0, to recall the core results of Ballegooijen and Boerlijst’s model28. This delayed SIRS model has base reproductive number

$${R}_{0}=8(1-{\exp }^{-{{\rm{\beta }}{\rm{\tau }}}_{I}})$$
(2)
$$\,=\,8{{\rm{\beta }}{\rm{\tau }}}_{I}-4{({{\rm{\beta }}{\rm{\tau }}}_{I})}^{2}+O({({{\rm{\beta }}{\rm{\tau }}}_{I})}^{3})\,{\rm{if}}\,{{\rm{\beta }}{\rm{\tau }}}_{I} < 1,$$
(3)

independent of τR. The value of R0 saturates to the number of neighbours in the lattice, when βτI is large, while \({R}_{0}8\simeq {{\rm{\beta }}{\rm{\tau }}}_{I}\) for βτI → 0. Notice that this first-order approximation to R0 is the quantity discussed in28. For comparison, a mean-field approach with no spatial structure would have an unbounded base reproductive number βτI.

For fixed parameter values (i.e. when evolution is not considered), the system exhibits different kinds of stable patterns. Figure 4a–d shows one typical configuration in the steady-state for each pattern. Low values of R0 produce short-lived local infection bursts, while high values of R0 eventually lead to the formation of spiral waves, a pattern characteristic of two-dimensional excitable media36. Thus, there are two different “phases”, with wave patterns and without wave patterns, that we call ordered or self-structured and disordered or mean-field, respectively. A “phase transition” or “critical boundary” separates these two regimes.

Figure 4
figure 4

Pattern formation and evolutionary dynamics in Ballegooijen and Boerlijst’s model28. (ad) Typical steady-state patterns as a function of fixed parameter values. In all plots we show a statistically stationary state of a 100 × 100 lattice with τI = 0.5 and τR = 1. For low R0 (a,b), only local infections develop. As the value of R0 increases, incipient spiral wave patterns appear (c) and become fully developed for larger base reproductive number (d). (e) Evolutionary trajectories for different initial conditions. Each evolutionary trajectory is depicted with a different color. All trajectories are eventually attracted to the curve τI(β) = cev/(8β) (dotted black line) with constant base reproductive number \({R}_{0}^{ev}=(4.504\pm 0.024)\), as determined through a non-linear least-squares fit. Here the lattice size is 150 × 150. (f) Evolutionary fluxes in phase space. The figure shows the two surfaces \({e}^{-{R}_{0}}\) and ew, that behave as effective potentials to indicate the directions of evolutionary change; their maximum value at each point, \({\rm{\max }}\,\{{e}^{-{R}_{0}},{e}^{-w}\}\) is represented through a colour scale. Arrows indicate the selection gradient. Dashed lines: the red line represents the exact solution obtained solving numerically the equation R0 = w1D, the black one corresponds to the approximate solution in Eq. 8, and, finally, the blue stands for the evolutionary trajectory observed in the simulations.

When the system is free to evolve through changes in virulence and transmissibility parameters (keeping the recovering time τR fixed), it converges to trajectories that fulfill

$${\rm{\beta }}=\frac{{c}_{ev}}{8{{\rm{\tau }}}_{I}},$$
(4)

where cev is a constant determined to be cev = (6.623 ± 0.003). The convergence to this trajectory happens after a transient period of variable duration and it is independent of the initial conditions. As a consequence, the basic reproductive number of the strain converges to a constant value \({R}_{0}^{ev}=4.504\pm 0.024\), as obtained from Eq. (2). Incidentally, the heuristic expression in Eq. (4) supports the goodness of the first-order approximation Eq. (3), and consistently yields a value βτI < 1. In the following, and for the sake of analytical tractability, we will assume that the base reproductive number R0 = 8βτI, though it should be kept in mind that this approximation might fail for βτI ≥ 1, i.e. for R0 ≥ 5.06. Since the system evolves to \({R}_{0}^{ev}=4.5\), this approximation is sufficiently good around the critical point.

The evolutionary trajectory of the system is illustrated in Fig. 4e. This result is in agreement with28, where it was shown that the trade-off is a by-product of the spatial self-structuring of the system, and where the quantity that seems to be under positive selection is the frequency of emission of infection waves, and not R0. Though not explicitly mentioned in28, where the maximum allowed value of the infectivity was β = 4, the evolutionary trajectory continues indefinitely to higher values of β and lower values of τI at an increasingly slower but non-arresting pace.

Selection for higher frequency of emission of infection waves only succeeds at the local scale

In order to delve into the feedback mechanism that drives the evolutionary process towards a fixed base reproductive number, we undertake two simulation experiments to evaluate the ability to invade of different strains once the system is spatially organized. No parameter evolution is considered here, since our aim is to quantify to which extent spatial pattern formation enhances or hinders the invasion of analogous populations. To this end we select a focal population with parameters corresponding to each of the four situations represented in Fig. 4a–d. Let us call this strain s0 ≡ (β,τI). Then, we also select four strains that are nearby in an evolutionary sense. That is, if the evolutionary process would be on, these strains would be one mutational step away from the focal population; their parameters are \({s}_{++}\equiv ({{\rm{\beta }}}^{+},{{\rm{\tau }}}_{I}^{+})\), \({s}_{+-}\equiv ({{\rm{\beta }}}^{+},{{\rm{\tau }}}_{I}^{-})\), \({s}_{-+}\equiv ({{\rm{\beta }}}^{-},{{\rm{\tau }}}_{I}^{+})\), and \({s}_{--}\equiv ({{\rm{\beta }}}^{-},{{\rm{\tau }}}_{I}^{-})\), where we have defined β± = β ± Δβ and \({{\rm{\tau }}}_{I}^{\pm }={{\rm{\tau }}}_{I}\pm {{\rm{\Delta }}{\rm{\tau }}}_{I}\) to simplify the notation. All possible competitions between the focal strain s0 and its mutants are assayed, and each competition is performed 10 times.

Note that the five populations (one focal and four nearby mutants) can be ordered with respect to their base reproductive number. In the simulations, where initial conditions ensure that β > τI for all times, the ordering is given by

$${R}_{0}({s}_{++}) > {R}_{0}({s}_{-+}) > {R}_{0}({s}_{0}) > {R}_{0}({s}_{+-}) > {R}_{0}({s}_{--}),$$
(5)

so s++ and s−+ increase the base reproductive number of the focal population s0, while s+− and s−− decrease it. On the other hand, if β < τI, the ordering is R0(s++) > R0(s+−) > R0(s0) > R0(s−+) > R0(s−−). In a mean-field scenario, this ordering coincides in either case with the relative advantage of one population over the others and, thus, it determines the mutual ability to invade and predicts the outcome of competition experiments in a well-mixed scenario.

However, results in28 suggest that, in cases where the population is spatially structured, the relative advantage corresponds not to the population with the larger R0, but to the one with the higher frequency w of emission of infective waves. The emission frequency is obviously larger for those strains with a faster infection rate which simultaneously produce waves with narrower fronts, but these two quantities do not bear a straight relationship with parameters τI and β.

In order to better understand how the invasibility criteria might change in spatially structured systems, let us briefly explore the one-dimensional version of model28. The frequency w1D is the inverse of the average time elapsed between two consecutive infection events. A node with an infected neighbour becomes infected after a typical time tβ = β−1, and stays itself infected for a time τI. Then it recovers to become susceptible again after a time τR. Therefore,

$${w}_{1D}=\frac{1}{1/{\rm{\beta }}+{{\rm{\tau }}}_{I}+{{\rm{\tau }}}_{R}},$$
(6)

and the mutants and the focal population display the following ordering

$${w}_{1D}({s}_{+-}) > {w}_{1D}({s}_{--}) > {w}_{1D}({s}_{0}) > {w}_{1D}({s}_{++}) > {w}_{1D}({s}_{-+}),$$
(7)

which yields invasibility criteria different from Eq. (5). Again, as for the basic reproductive number, the precise ordering of the mutants s−− and s++ depends on the relative values of the parameters. The order in Eq. (7) corresponds to the case studied in simulations, β > τI. On the other hand, if β < τI, then w1D(s+−) > w1D(s++) > w1D(s0) > w1D(s−−) > w1D(s−+). This calculation, however, cannot be straightforwardly extended to the two-dimensional case.

Invasibility experiment 1

To go beyond the one-dimensional case, we considered a two-dimensional lattice of size 2L × L; the two parts of the space are not connected initially. s0 and each of its mutant strains are picked up pair-wise and placed either at the left or right half of the lattice. After a fixed time, such that spatial patterns have developed according to the parameters chosen, both parts of the space are allowed to interact.

In all simulations performed under the previous conditions, the system was eventually invaded by the strain with higher R0, independently of any other condition. Strains s++ and s−+ were systematically selected in competition with s0, while strains s+− and s−− were always removed from the system, as would be predicted by a mean-field approximation. This is an a priori unexpected result that apparently contradicts the dynamics of evolutionary trajectories in the spatially structured model.

Invasibility experiment 2

Take strain s0 and let the system run enough time to develop patterns in a large L × L lattice. Then, substitute any infected individual inside a randomly chosen area of size 10 × 10 sites with strains of one of the nearby mutants. In this case, we observed two different behaviours:

  1. 1.

    If the focal strain s0 was not able to develop patterns (that is, it is located in the disordered region of the parameter space, with a base reproductive number below \({R}_{0}^{ev}\)), the mutant strain invades the whole system if its R0 is higher: s++ and s−+ are at an advantage and therefore are selected in front of s0;

  2. 2.

    If s0 has clearly developed patterns (with a base reproductive number above \({R}_{0}^{ev}\)), the only mutant strain able to invade the system is s+−, following the direction observed in the evolutionary curve.

The critical boundary emerges as an equilibrium between two different selection mechanisms

The results above highlight that the likelihood to invade a spatially organized population depends on the size and structure of the invading population. Very often, this size is small because it is a single mutant individual or a small sample of individuals from disconnected populations that attempt the invasion. If this is so, the scenario in our invasibility experiment 2, whose dynamical properties coincide with those leading to the emergence of the trade-off, is the applicable one.

Let us return to the evolutionary trajectory in Fig. 4e with the previous results in mind. We see that initial conditions with low R0 first increase the base reproductive number by selecting mutants mainly in the s++ direction, and later converge to the curve evolving along the s+− quadrant. All regions in the evolutionary trajectory where τI increases (and also R0, since β always grows) correspond to spatially disordered situations, either because the parameters correspond to the phase with \({R}_{0} < {R}_{0}^{ev}\) or because the system is in the initial transient before spatial self-structuring sets in. The increase of R0 progressively drives the system to a new regime where spiral waves start to develop. This qualitative change modifies the criteria for invasibility, and selection for waves of higher frequency w sets in.

At this point, it seems reasonable to assume that the critical boundary results from the equilibration of two mechanisms: selection for larger R0 in the disordered phase and selection for higher w in the ordered phase (see Fig. 4f). Even though the frequency of emission is a complex function of the parameters in two dimensions, and results from 1D cannot be straightforwardly extrapolated, in general, to higher spatial dimensions, let us use the functional forms of w1D(β,τI) and R0(β,τI) previously derived to give an estimation of the curve where the two surfaces cross. Note that R0 grows in the s++ direction. If our understanding of the evolutionary feedback is correct, this estimation should resemble the numerical boundary \({R}_{0}^{ev}\). The relationship between β and τI along the critical boundary is defined through w1D = R0. Recall that, in order to make the problem analytically tractable, we use the first-order approximation \({R}_{0}\simeq n{\rm{\beta }}{\tau }_{I}\)

$$n{\tau }_{I}{\rm{\beta }}=\frac{c}{1/{\rm{\beta }}+{{\rm{\tau }}}_{I}+{{\rm{\tau }}}_{R}}$$
(8)

where c is a constant required for correct dimensionalization and n is the number of neighbours, which yields

$${\rm{\beta }}=\frac{c/n-{{\rm{\tau }}}_{I}}{{{\rm{\tau }}}_{I}({{\rm{\tau }}}_{I}+{{\rm{\tau }}}_{R})}\simeq \frac{c}{n{{\rm{\tau }}}_{I}{{\rm{\tau }}}_{R}}+o(\frac{1}{{\tau }_{I}^{2}}).$$
(9)

For τR = 1, to first order in τI we get \(n{{\rm{\beta }}{\rm{\tau }}}_{I} \sim c\), where we can identify n = 8 and c = cev. The selection mechanism described puts the system at the edge of wave formation: higher R0 strains tend to be selected in the disordered phase, while higher values of w are selected in the spatially structured phase, such that the curve of constant R0 is where these two mechanisms are at equilibrium (see Fig. 4f).

Since the computations above were done using an approximation for the basic reproductive number R0, one can wonder whether the derived results remain valid when the exact expression is considered. We have checked that if we include higher orders of the Taylor expansion, we still obtain an equation analogous to (11), of the form \({\rm{\beta }}({{\rm{\tau }}}_{I})=K/{{\rm{\tau }}}_{I}+o\mathrm{(1}/{{\rm{\tau }}}_{I}^{2})\), where the only difference is the expression of the constant K. We have solved such an equation numerically, and verified that the results do not deviate much from those obtained from Eq. (9) (see Fig. 4f).

Spatial self-structuring is fragile

The boundary \({w}_{0}^{ev}={R}_{0}^{ev}\) separates two phases with qualitatively different spatial structure. Selection mechanisms, as revealed by the invasion criteria in either phase, are different and of opposing sense regarding mutations in τI, causing an evolutionary feedback loop that eventually drives the system to a self-evolved phase boundary. The emergence of the trade-off is critically dependent on the development and persistence of spatial self-structuring. Are there conditions under which the latter is not possible, even if evolutionary parameters are in the ordered region? In this section we explore the stability of the emergent trade-off under changes in the mobility of hosts as well as in two model parameters that have been kept constant so far: the mutation rate μ and the recovery time τR.

Host mobility prevents spatial self-structuring

Broadly speaking, infection propagation depends on the degree of mobility of hosts: propagation speed, endemicity or optimal evolutionary parameters vary whether hosts are sessile, diffuse locally or perform high-distance jumps. In this section, we explore how locally diffusing hosts and hosts able to jump to arbitrary sites in the lattice affect the formation of spatial structures.

Diffusing hosts are modelled by means of the Toffoli-Margolus algorithm (see Methods). In the high-diffusion limit, the system becomes well-mixed and the expectation is that it behaves as in mean-field, thus increasing its average R06. Indeed, simulations with high diffusion follow an evolutionary trajectory along which β and τI steadily increase. The process continues until all individuals become infected, eventually causing the extinction of the pathogen.

On the other hand, sufficiently low diffusion should recover the D = 0 trajectory we analysed before. Therefore, there should be an intermediate value of the diffusion where the behaviour crosses over from \({R}_{0}={R}_{0}^{ev}\) to an ever increasing R0. Our simulations show that, for intermediate D values, the convergence of the system to either phase depends on the initial conditions, as depicted in Fig. 5. For an initial fixed value of β0, there exist a critical \({{\rm{\tau }}}_{I0}^{c}\) such that any \({{\rm{\tau }}}_{I0} < {{\rm{\tau }}}_{I0}^{c}\) will exhibit an evolutionary trajectory identical to D = 0, while for \({{\rm{\tau }}}_{I0} > {{\rm{\tau }}}_{I0}^{c}\) the parameters will diverge as predicted by the mean-field theory. The position of the critical point \({{\rm{\tau }}}_{I0}^{c}={{\rm{\tau }}}_{I0}^{c}({{\rm{\beta }}}_{0})\) increases as β0 increases. The persistent perturbation caused by diffusion distorts the spatial structure, which is developed only if diffusion is slower than wave formation speed. For a fixed value of β, wave formation and propagation speed decrease as τI increases. As a consequence, the system approaches the mean-field behaviour when τI increases, as patterns are suppressed. For higher values of β0, it is more difficult to sufficiently distort the patterns, such that the value of the critical point \({{\rm{\tau }}}_{I0}^{c}\) increases. Higher values of D lower the value of the critical point: for hosts with sufficiently high local mobility, pattern formation is not possible and all the phase space is in the mean-field regime.

Figure 5
figure 5

Evolutionary trajectories as a function of the initial infection period. Parameters of the simulations are D = 0.35, β0 = 0.8 and L = 150, with τI0 as shown in the legend. The dashed black line shows the expected mean-field behaviour τI = β+ constant. The system either displays a behaviour indistinguishable from the D = 0 case or follows a curve of steady increase in R0, as predicted in the mean-field theory. The region where stochastic fluctuations can lead the system to any of the two states stretches to a point in the limit L → ∞.

The situation is qualitatively analogous if, instead of local diffusion, we assume that nodes can have arbitrary neighbours in the lattice–rather than just nearest neighbours–with some given probability. Actually, the effect of long-distance transmission was already discussed in28, where it was pointed out that mixing up to 2% of contacts yielded similar results, i.e. spatial structuring and an emergent trade-off with a slightly different value for \({R}_{0}^{ev}\). Our simulations indicate that, as in the case with diffusion, relatively low values of the fraction of long-distance contacts (below 10% in all considered cases) prevent the formation of waves; the precise value causing the transition depends on the initial parameters. Figure 6 shows, for a fixed initial condition, the transition between the D = 0 and the mean field behaviour, which is in fact analogous to the diffusive case.

Figure 6
figure 6

Evolutionary trajectories as a function of the probability p of a long-range interaction. Initial conditions are β0 = 1.0, τI0 = 0.5 and L = 100. As in the diffusive case, depending on the value of p there is a transition from the mean-field phase to the ordered phase, albeit with a different value of \({R}_{0}^{ev}\). The exact value of p at which the transition occurs is also dependent on the initial conditions.

Waves develop in a finite range of τR values

The intrinsic self-excitability of Ballegoijeen and Boerlijst’s model28 lies at the origin of the emerging spatial waves. This property is lost in simpler susceptible-infected (SI) models, which do not consider a recovery period after infection. In other words, spatial waves do not develop in the limit τR → 0. From a geometrical perspective, τR > 0 has the effect of separating subsequent wave fronts, thus allowing the formation of well-defined infection waves.

Interestingly, in the simulations, changes in τR do not seem to affect the critical value \({R}_{0}^{ev}\). Nevertheless, the analytic reasoning made before suggests that the critical value should change, given the dependence of Eqs (6) and (9) with τR. We believe that the one dimensional argument we have used is not able to capture the full phenomenology observed in two dimensions.

Even when τR does not affect the critical point of the transition, it is relevant for the study of the stability of the patterns. Our computational results show that if τR decreases, the transient time needed to converge to the curve \({R}_{0}={R}_{0}^{ev}\) increases. This is due to the fact that the formation of wave fronts requires larger values of τI the smaller τR is. Therefore, for small τR, increasingly larger values of R0 are required in order to develop patterns and start the selection for wave frequency. Conversely, larger values of τR permit the formation of waves with lower values of τI, thus accelerating convergence to the critical boundary.

We have numerically studied the limit τR → 0, which corresponds to the conversion of our model to an SI-like model. For low values of τR, we have checked that the system is not able to develop patterns, exhibiting the mean-field behaviour as described in the diffusion case. Moreover, we have checked that too large values of τR also prevent the formation of waves. Intuitively, this is due to the blocking effect caused by individuals remaining for too long in the recovered state, and thus avoiding wave propagation. We cannot discard, however, that this is a finite size effect showing up when \({{\rm{\tau }}}_{R}\simeq L\).

In summary, considering that self-structuring patterns are possible only for intermediate values of τR, too large or too small values of the recovery rate also jeopardize the stability of the emergent trade-off.

It is interesting to recall that, in our model, nodes remain infected exactly for a time τI, and recovered precisely after an interval τR. As a consequence, wave fronts have a fixed size, a property that enhances and likely stabilizes the formation and maintainance of patterns as described above. An additional source of disorder in this context might come from broad inter-event distributions, different from delta-like functions, which would blur the propagation front. We hypothesize that the effect of broadening the distribution of τI or τR values would act in a way similar to the mobility of hosts. For sufficiently low dispersion values, patterns should still be formed, while there must be critical values (depending on each of the stochastic variables) at which the dynamics of the system would cross-over to the mean-field regime. On a related note, it has been shown that the particular choice of the inter-event distribution affects the behaviour of R037. Since, in the current model, the value of R0 is selected through evolution, we might expect as well a change in the evolutionary parameters characterizing the critical boundary for a broad distribution of τI or τR values, even in the regime where self-structuring still holds.

Evolutionary trajectories are weakly affected by changes in the mutation rate

Pathogenic organisms display a range of mutation rates that spans at least seven orders of magnitude, from the barely 10−10 substitutions per nucleotide and replication cycle of pathogenic fungi to the 10−4 of most RNA viruses38. Viroids, circular non-coding RNA molecules that are pathogenic to plants, affecting especially crops, might present mutation rates up to over 10−3 substitutions per genome copied, thanks to the small size of their genomes (a few hundred nucleotides)39.

Low mutation rates are not an issue in the context of the model here studied, since they cannot disrupt the emergence of the trade-off. In a more realistic scenario, though, low μ entails long transients that would delay the convergence to the critical curve. The pertinent question, therefore, is if large values of μ prevent in any way the development of spatial self-structuring. Actually, our simulations where performed for μ = 0.01, which is not a small value for a phenotypic mutation rate, as implemented in the model. We have verified that mutation rates up to μ = 0.5 do not prevent convergence to \({R}_{0}^{ev}\), though they increase the size of fluctuations away from the critical curve. Additionally, one could consider changes in the parameters that, in agreement with empirical observations40, would be randomly drawn from a fat-tailed probability distribution, that is where mutations causing large changes in phenotype are not exceedingly rare. Though this possibility has not been tested, we do not expect it to modify the evolutionary trajectories in the light of our previous results.

Role of a metapopulation structure in the evolutionary fate of populations

Our metapopulation model consists in a network of lattices that can exchange the states of a randomly chosen pair of individuals (see Methods and Fig. 3). Alternatively, we have also simulated a situation where infection could be propagated through vectors, and where an infected individual tries to transmit the disease to a second, randomly chosen individual in a different lattice. Since results are indistinguishable in these two formulations, here we present results for the first case (swapping of individual states). Simulations are performed with a fully-connected metapopulation (as in Fig. 3a).

The metapopulation structure is irrelevant for sessile hosts

We performed simulations of a metapopulation where all the patches were in the no-diffusion phase or in the mean-field phase, respectively. The evolutionary trajectories are identical to the ones displayed by a single population in the no-diffusion regime or in the mean-field. This is because all the subpopulations are subject to the same selection mechanism. In fact, evolution happens locally when the patches are in any of these two limits. This result is easy to understand if we think of two connected populations, A and B. Let us say A is in the high diffusion regime and B in the D = 0 regime. Since the base reproductive number in B has a low value, a strain that jumps from B to A will not invade the well-mixed population, where the mechanism of selection relies on R0. Moreover, a strain from A to B would not invade either, since it has a low wave emitting frequency, which is the main selection mechanism in B. At the end, the evolutionary trajectory in each population is the same as the isolated system’s trajectory, since the dynamics only depends on the base reproductive number of the perturbation and the spatial structure, and not on where this strain comes from. Both populations will evolve with no apparent interaction between them. Therefore, evolutionary dynamics depends only on the local spatial structure of the populations, and not on the large scale metapopulation. Figure 7 illustrates this point.

Figure 7
figure 7

Interaction between two subpopulations with diffusing hosts. We depict the detailed evolutionary trajectory of two connected subpopulations with finite diffusion D = 0.35 in the β−τI plane (a), as well as the temporal variation of τI (b) and β (c). Labels (1) and (2) correspond to events where subpopulation A was invaded by a strain of subpopulation B. In (1), the subpopulation was invaded by a strain of higher R0, which was possible because pattern formation had not yet started. In (2), spatial patterns are developed and the subpopulation can only be invaded by a strain with higher frequency of emission, causing a jump forward along the critical boundary.

Well-mixed states are shortly lived in small lattices

We have seen that, when hosts are mobile, the evolutionary dynamics does not always converge to the critical boundary but, depending on the initial conditions and the strength of diffusion, it might enter the runaway regime where R0 steadily increases. The eventual fate of such populations is a pathogen-free system with all individuals in the susceptible state. While in the absence of other populations that may act as reservoirs of the pathogen this is the final state, pathogen-free populations can be rescued if a metapopulation structure is present. At this point, therefore, the fact that populations in the mean-field regime have a finite lifetime becomes an important evolutionary feature. This is in contrast with self-structured populations, which are in a state of endemic infection that is sustained in time.

With this motivation in mind, we have studied the average lifetime of populations for intermediate values of the diffusion as a function of their lattice size. Here, lifetime is defined as the number of timesteps required for all the individuals to reach the susceptible state. As expected, populations in the ordered phase did not decay in any of the performed simulations. In contrast, the lifetime of populations as a function of their lattice size can be fitted in the mean-field phase to a power-law with exponent (2.6 ± 0.6) (Fig. 8). In the limit of infinitely large systems, the mean-field phase is stable and infection can survive for very large times whose duration diverges as L → ∞.

Figure 8
figure 8

Lifetime of populations in the mean-field phase. The diffusion is D = 0.35, and lifetime is represented as a function of the system size L in log-log scale. Points are averages over 10 realizations. The best fit to data is shown with a dashed line, T(N) = (5.3 ± 3.0)·10−5 N(2.6 ± 0.6) + (1.5 ± 0.3)·104 as obtained through least-squares fit.

The metapopulation structure favours the emergence of the evolutionary trade-off if hosts diffuse

The results in the previous section quantify differences in the lifetime of subpopulations that have reached the critical boundary, which are self-structured and thus stable in time, or entered the mean-field behaviour, therefore with a finite lifetime that depends on their size. At some point, the latter will become fully susceptible and can be re-infected by a neighbouring population. When hosts are mobile, the reinfected lattice can either be attracted again to the mean-field behaviour or develop waves and converge to the critical boundary. The likelihood of either outcome is dependent on the initial conditions, as we have shown. However, the initial conditions are not arbitrary now, but correspond to the state of a neighbouring lattice, which has already evolved to one of the two possible states. If the lattice from which the infecting individual is drawn is the mean-field regime, the newly infected lattice will also fall into that disordered phase, and again collapse in finite time to the fully susceptible situation. Instead, if the infecting individual is drawn from a subpopulation that has converged to the critical value \({R}_{0}^{ev}\), the initial conditions are such that the newly infected lattice will develop spatial patterns and the emergent trade-off. The ability of a neighbouring individual to infect follows the criteria derived for mutants in former sections (Fig. 7).

In a metapopulation structure, however, the global process functions as a ratchet. Once a lattice has settled in a self-structured state with fixed base reproductive number \({R}_{0}^{ev}\), it will not be kicked out of it by any attempt of invasion from neighbouring subpopulations. At the same time, populations in the disordered state regularly collapse until they are infected in such conditions that they fall into the ordered phase, at which point their dynamics are stable and long-lived. Therefore, a metapopulation structure selects for a globally ordered phase due to the finite lifetime of any subpopulation in the disordered phase, where R0 diverges.

Discussion

In this work, we have revisited a spatial self-structuring model of host-pathogen evolution where an emergent trade-off between infectivity and transmissibility had been described28. We have shown that an evolutionary feedback mechanism here characterized poises the system to a critical boundary where selection on the base reproductive number and selection on the frequency of emission of infective waves equilibrate. This critical, self-evolved state only emerges if the conditions of the system are such that spatial ordering in the form of epidemic waves can set in. The critical boundary separates two regions characterized by spatial order/disorder through a phase transition where incipient spatial waves wax as disorder wanes. The precise, quantitative nature of the phase transition, however, needs to be formally characterized in future research.

Classical definitions of fitness often fail in spatially extended evolutionary competition, as the inability of R0 or w to predict by themselves the winner in an invasion here demonstrates. Indeed, there have been other studies clearly pointing out that, in spatially structured evolving populations, the strategy of maximizing R0 is not adaptive in the long run, either because fitness depends on the time-scale (different strategies are successful at different times)27 or because, at odds with mean-field scenarios, a finite fraction of immune hosts might induce pathogen extinction even if R0 is arbitrarily large41.

Convergence to the critical boundary is a far from trivial issue. First, the emergence of the trade-off can be severely delayed depending on initial conditions and specific evolutionary parameters. Second, the trade-off is structurally unstable under host mobility, such that moderate values of host diffusion or of a fraction of long-distance host jumps cause a cross-over to a mean-field behaviour, where the base reproductive number grows unboundedly. We believe that other mechanisms able to hinder pattern formation would have similar consequences. This is the case for low recovery times τR, as it might be if this variable follows a sufficiently broad distribution36. Third, the evolutionary stable, finite \({R}_{0}^{ev}\) value can be achieved through successive invasions of the resident pathogen only if invasion is attempted at a local scale. This result is highly reminiscent of invasion experiments by mutant viral strains where it was observed that the substitution of the wild type by an in principle fitter mutant did not succeed unless the mutant was seeded above a minimum relative population size threshold42. In the latter case, the impossibility to displace the wild type if the invading population was too small was ascribed to its limited genotypic heterogeneity43. Actually, space might play an important role in the emergence of heterogeneous populations and its properties44, therefore conditioning also in this respect evolution45 and invasion46. Fourth, convergence to the critical boundary is dependent on the initial evolutionary parameters, a fact that might have important ecological implications. It indicates that the onset of spatial self-structuring, and therefore of the emergent trade-off, is contingent on the life-history of the system, and affects its evolutionary fate. Indeed, the jump of a pathogenic species to a new host is affected by multiple variables, among which ecological factors, viral genetic plasticity and host specificities47. While sufficiently long coevolution with the original host species has probably selected for evolutionary parameters permitting coexistence, the aetiology of the disease might be completely different in the new host. If the pathogen turns out to be too virulent (i.e., it starts with a too high τI), persistent infection of this new host is prevented, and it can only infect in bursts that terminate with the death of the local host population and the eradication of the pathogen in a short time. Bursts of infection can however have different origins, and in particular result from prudent infective strategies48.

In a metapopulation organization, we have shown that the evolutionary dynamics happen at the scale of the local populations, and not at the scale of metapopulations, in contrast with other studies where the dynamics of the metapopulation cannot be extrapolated from the dynamics of a patch (see e.g.31,32). Moreover, in the current case evolutionary trajectories in patches can be unrelated if the subpopulation properties are very different, leading to a sort of ecological speciation. Instead, the metapopulation structure is here responsible for driving the system to a globally stable phase in the presence of host mobility. In this study, we have kept the jump rate between subpopulations fixed for all strains, though, together with a complex network structure, it may affect the spreading of disease in the metapopulation at long time scales.

Though attention is typically focused on the evolution of pathogenic traits and on the immune strategies of the host (be they intrinsic, through an immune coevolving system or extrinsic, as in avoiding behaviour), it cannot be discarded that the spatial pattern itself be a feature under selection49. In a different class of systems, it has been shown that disordered states are conductive to extinction, as in the case of spatially extended catalytic hypercycles, where the formation of spiral waves avoids the otherwise lethal effect of parasitic mutants50. The question therefore remains, whether selection for long-lived coexistence with the host mediated by the selection of specific spatial patterns may act as an additional force to promote emergent trade-offs.

Methods

Here we describe in detail the numerical algorithm used to simulate the dynamics of the model, including the diffusion scheme. The steps of the algorithm are:

  1. 1.

    Initialize the lattice with periodic boundary conditions, and a 5% of infected individuals, all of them with the same initial strain. Take t = 0. Initialize internal counters tj = 0 for all nodes.

  2. 2.

    At each timestep, we iterate over the nodes. For node j,

    1. (a)

      If the node is susceptible, consider the set of infected neighbours Ωj. Node j is infected with probability \(p=1-\exp \,(\,-\,{\rm{\Delta }}t{\sum }_{n\in {{\rm{\Omega }}}_{j}}\,{{\rm{\beta }}}_{n})\). Each neighbour has different transmission rate, so we have to select the origin of the infection computing all the probabilities pm = 1 − exp (−Δtβm) and then selecting the source node with probability \({q}_{m}={p}_{m}/{\sum }_{n\in {{\rm{\Omega }}}_{j}}\,{p}_{n}\) to ensure normalization. Since Δt is very small, we can expand \({q}_{m}\simeq {\beta }_{m}/{\sum }_{n\in {{\rm{\Omega }}}_{j}}\,{{\rm{\beta }}}_{n}\) to avoid computing all the exponentials. If neighbour m was selected, then set βj = βm and τIj = τIm. Using this method, we infect the node at the correct rate, and select the neighbour with a probability according to its transmission rate.

    2. (b)

      If the node is infected, check if tj ≥ τIj. In this case, the infection has finished, the node becomes recovered, and internal time is reset to tj = 0. In other case, with probability μΔt make a mutation (βjIj) → (βj ± Δβ, τIj ± Δτ), changing βj and τIj independently.

    3. (c)

      If the node is recovered, check if tj ≥ τR. If this happens, then make the node susceptible again.

  3. 3.

    We have t = kΔt. If k = Γ then apply the mixing algorithm.

  4. 4.

    Make t = t + Δt ≡ (k + 1)Δt and return to step 2 until the desired time.

The next step is to select the parameters. We choose to fix τR = 1 as the basic timescale (except when this parameter is externally varied). All times are relative to this scale. We have fixed Δt = 0.01, μ = 0.01, Δβ = 0.01 and Δτ = 0.01, as in28. Lattice size varies through the study and is indicated in each case.