## Abstract

Bacterial populations often have complex spatial structures, which can impact their evolution. Here, we study how spatial structure affects the evolution of antibiotic resistance in a bacterial population. We consider a minimal model of spatially structured populations where all demes (i.e., subpopulations) are identical and connected to each other by identical migration rates. We show that spatial structure can facilitate the survival of a bacterial population to antibiotic treatment, starting from a sensitive inoculum. Indeed, the bacterial population can be rescued if antibiotic resistant mutants appear and are present when drug is added, and spatial structure can impact the fate of these mutants and the probability that they are present. Specifically, if the mutation that provides resistance is neutral or effectively neutral, its probability of fixation is increased in smaller populations. This promotes local fixation of resistant mutants in the structured population, which facilitates evolutionary rescue by cost-free drug resistance. Once the population is rescued by resistance, migrations allow resistant mutants to spread in all demes. Our main results extend to the case where there are resistant mutants in the inoculum, and to more complex spatial structures. They also extend to resistant mutants that carry a fitness cost, although the timescales involved are longer.

**Author Summary** Antibiotic resistance is a major challenge, since bacteria tend to adapt to the drugs they are subjected to. Understanding what conditions facilitate or hinder the appearance and spread of resistance in a bacterial population is thus of strong interest. Most natural microbial populations have complex spatial structures. This includes host-associated microbiota, such as the gut microbiota. Here, we show that spatial structure can facilitate the survival of a bacterial population to antibiotic treatment, by promoting the presence of resistant bacteria. Indeed, neutral mutants giving resistance can take over small populations more easily than large ones, thanks to the increased importance of fluctuations in small populations. Resistant mutants can then spread to the whole structured population. Thus, population spatial structure can be a source of antibiotic treatment failure. This effect of spatial structure is generic and does not require environment heterogeneity.

## Introduction

Antibiotic resistance is a crucial challenge in public health [1, 2]. Resistant bacteria emerge and spread through Darwinian evolution, driven by random mutations, genetic drift and natural selection. Mutations allow the emergence of strains adapted to challenging environments, including various antibiotic types [3]. These strains are selected when antibiotics are present in the environment. Critically, the evolution of antibiotic resistance can occur quickly, within days in specific conditions [4], while the development of a new antibiotic typically takes around ten years [5]. In this context, it is crucial to understand what conditions favor or hinder the development and spread of antibiotic resistance.

Bacterial populations often have complex spatial structures. For pathogenic bacteria, each patient constitutes a different environment, connected through transmission events. Within a patient, different organs and tissues represent spatial environments between which bacteria can migrate [6]. At a smaller scale, bacteria in the gut microbiota, which can be a reservoir of drug resistance, live in different spatial environments, namely the digesta, the inter-fold regions and the mucus, and some of them form biofilms [7–9], which are dense structures of cells enclosed in a polymer-based matrix [10, 11]. Thus, it is important to understand how the spatial structure of microbial populations impacts the evolution and spread of resistance. This question has been explored in epidemiological models in the case of viruses [12, 13] and of bacteria [14], and was recently addressed in controlled experiments, for specific antibiotic resistant bacteria [15], but is still relatively under-explored. Spatial structure can lead to small effective population sizes, and small population sizes were recently experimentally shown to substantially impact the evolution and spread of resistance [16, 17]. More generally, the impact of spatial structure on the fate of mutants was studied theoretically [18–34] and experimentally [35–39], but generally in constant environments.

Here, we ask how spatial structure impacts the fate of a bacterial population suddenly subjected to antibiotic treatment. Is the population eradicated by the drug, or does it survive by developing resistance? We address this question in a minimal model of population structure, composed of identical demes (i.e. subpopulations) connected to each other by identical migrations. This simple structure is known as the island model [18, 19], or the clique or fully-connected graph [28, 31, 34]. We assume that the population initially only comprises drug-sensitive bacteria. Indeed, the initial diversity of a population of pathogenic bacteria in a host is often low, as many infections begin with a small infectious dose [40–44]. For simplicity, we assume that the environment is homogeneous, but note that environmental heterogeneities have a substantial effect on antibiotic resistance [45–47], and on evolutionary rescue in structured populations [48–50]. Specifically, we consider a perfect biostatic drug, which stops the growth of sensitive bacteria, but we also discuss the generalization of our results to other drug modes of action. When a well-mixed population is subjected to a treatment by a perfect biostatic drug (for a long enough time), the population gets extinct, except if resistant mutants are present when the drug is added [51–53]. The population can thus be rescued by resistance. We study the impact of population spatial structure on this process. We also analyze how the time when drug is added impacts the fate of a spatially structured population.

We show that spatial structure increases the probability that a bacterial population survives treatment by developing resistance through a neutral mutation. Specifically, for a given time of addition of the antibiotic, the survival probability of the population increases when the migration rate between demes is decreased, and when the number of demes is increased while keeping the same total population size. We show that this is due to the local fixation of resistant mutants in one or several demes. We study the composition of the population versus time before the addition of drug, and find that it is strongly impacted by spatial structure. We further study the time needed for resistant bacteria to colonize all demes once they have fixed in at least one of the demes. Finally, we show that our main results extend to the case where resistant mutants carry a cost, although the timescales are longer. They also extend to the case where resistant mutants are present in the inoculum, and to more complex spatial structures.

## Models and methods

### Spatially structured populations

We aim to assess the impact of spatial structure on the establishment of antibiotic resistance, in a minimal model where spatial structure is as simple as possible. Thus, we consider a spatially structured bacterial population comprising *D* demes (i.e. subpopulations) on the nodes of a clique (i.e. a fully connected graph). This corresponds to the island population model [18]. Each deme has the same carrying capacity *K* (Figure 1, center). For comparison, we also consider a well-mixed population with the same total carrying capacity *KD* (Figure 1, left), and a fully subdivided population composed of *D* demes with carrying capacity *K* without migrations between them (Figure 1, right). We model migrations between demes through a per capita migration rate *γ*, which is the same between all pairs of demes.

We will also briefly discuss extensions to more complex population structures on graphs [31, 34].

### Bacterial growth and resistance

We consider two types of bacteria: sensitive (S) and resistant (R) ones. In the absence of antibiotics, the two types of bacteria have fitnesses *f*_{S} and *f*_{R}, respectively, which set their maximal growth rates (in the exponential phase). They have the same death rate *g*. Thus, we implement selection on birth. However, it is straightforward to generalize our model to selection on death. We assume that growth is logistic in each deme. The growth rate of S (resp. R) individuals is *f*_{S} (1 −*N/K*) (resp. *f*_{R} (1 −*N/K*)), where *N* is the current population size of the deme considered. When S bacteria divide, their offspring can mutate to R with probability *μ*. Here, we focus on the rare mutation regime, where *Nμ* ≪ 1.

We mainly focus on neutral mutations, but we discuss the impact of a cost or of a benefit of resistance below and in SI Section 3.1. Considering neutral mutations is relevant because resistance mutations are often effectively neutral, e.g. at low drug concentrations. We thus set *f*_{S} = *f*_{R} = 1, implying that the time unit in our system is set by the maximum growth rate of bacteria. We do not model further mutations or backmutations – note that the rate of backmutations was estimated to be one order of magnitude smaller than the rate of compensatory mutations [54].

We consider an ideal biostatic drug that prevents division of the S bacteria, thus changing their fitness to *f*_{S} = 0. We assume that R bacteria are not affected by the drug.

### Initial conditions and growth regime

As we aim to model the appearance of resistance, we start with a population comprising only S bacteria. In practice, we initialize each deme (resp. the well-mixed population) with a number of S bacteria representing 10% of *K* (resp. of *KD*). Then, each deme (resp. the well-mixed population) quickly grows and reaches a steady-state size *K*(1−*g/f*_{S}) (resp. *KD*(1 − *g/f*_{S})) around which it fluctuates. We choose this initial condition because it is appropriate to model the start of an infection [55]. Note that since *Nμ* ≪ 1, it is very unlikely that mutations happen during this quick initial growth phase, whose timescale is set by *f*_{S} = 1 [52]. Our results are thus robust to the initialization, as long as it is performed only with S individuals. We work in the regime where *g* ≪ *f*_{S} = 1, so that extinctions of demes are very unlikely in the absence of drug, and demes fluctuate around their steady-state size.

### Analytical and numerical methods

We obtain analytical results from the Moran model [56] and from probability theory. Note that the Moran model assumes that population size is strictly fixed, which is not the case here. However, because we are in the regime where fluctuations around the steady-state size are small in the absence of drug, the Moran process then provides good approximations [52]. We perform stochastic simulations of the population evolution, using the Gillespie algorithm [57, 58]. The details of the simulation framework are described in the SI Section 2.1.

## Results

### Spatial structure increases the probability that a bacterial population survives treatment

How likely is a spatially structured bacterial population to survive biostatic antibiotic treatment? Because our antibiotic prevents S bacteria from dividing while they have a nonzero death rate, a population is doomed to go extinct in the absence of R bacteria. However, if at least one R individual is present when drug is added, *rescue by resistance* can happen [51, 52]. Here, we aim to assess the impact of spatial structure on rescue by resistance. To this end, we focus on the probability that the bacterial population survives antimicrobial addition in at least one of the demes. Indeed, R bacteria can then spread to the rest of the population via migrations, ensuring its overall survival.

Figure 2A shows the survival probability versus the addition time of the antimicrobial for a spatially structured population with different values of the migration rate. We observe that survival probability increases with drug addition time. Indeed, R mutants are more likely to appear and fix in a population initially composed only by S bacteria if there is more time before drug addition. Moreover, we find that survival probability is higher when migration rate *γ* is smaller.

Figure 2B shows the impact of varying the degree of subdivision of a population of fixed total size, but composed of a different number of demes. We observe that higher subdivision yields higher probabilities of survival.

### Local fixation of R mutants promotes the survival of structured populations

To rationalize our results on the impact of spatial structure on the ability of a microbial population to survive the addition of biostatic drug, we focus on rescue by resistance. R mutants can arise in our population with rate *N*_{tot}*μg*, where *N*_{tot} is the total number of individuals in the population, *μ* the mutation probability upon division and *g* the death rate, which equals the division rate at steady state. All the populations we considered in Figure 2 have the same total steady-state size *N*_{tot} = *KD*(1−*g/f*_{S}) in the absence of drug. Thus, the mutant supply is not impacted by spatial structure. However, the fate of mutants can be impacted by spatial structure. Most R mutants that appear give rise to lineages that go extinct, whatever the structure. The survival time of their lineages is not impacted by population size. Let us now consider mutants that fix. Since we consider neutral mutants, their fixation probability is 1*/N* in a population of size *N*. In spatially structured populations, fixation can occur locally within a deme, and then it is governed by the smaller steady-state population size *N* = *K*(1 − *g/f*_{S}) of a deme. If migrations are rare enough, once R individuals have fixed in a deme, they survive there, and can rescue the population.

To understand the impact of local mutant fixation on population survival, let us focus on successful mutants, i.e. those that give rise to a lineage that fixes. The average time of appearance ⟨*t*_{af W}⟩ of a successful mutant in a well-mixed population of size *N* is given by:
where *t*_{app} = 1*/*(*Nμg*) is the average appearance time of a mutant and *p*_{fix} = 1*/N* is its fixation probability. Recall that we are considering neutral mutants (see above, and SI Section 1.1). Importantly, this result does not depend on population size *N*. Therefore, it holds both for the well-mixed population and for each deme in a structured population.

In a structured population, the first mutant that fixes locally in one deme may rescue the population by its resistance. The appearance of such a locally successful mutant is a Poisson process with rate *μg* (see Equation (1)). Thus, the average appearance time of a locally successful mutant in the fastest deme is (see SI Section 1 for details):
Crucially, this is *D* times faster than the appearance of a successful mutant in a well-mixed population (which is given by Equation (1)).

The addition of a biostatic antimicrobial (leading to *f*_{S} = 0, *f*_{R} = 1 when drug is added) should have a different effect depending how the addition time *t*_{add} compares to the two timescales defined in Equations (1) and (2). Specifically, we predict that:

If

*t*_{add}≪ ⟨*t*_{af F}⟩, the bacterial population is likely to be eradicated, whatever its structure.If ⟨

*t*_{af F}⟩ ≪*t*_{add}≪ ⟨*t*_{af W}⟩, it is likely that a locally successful mutant has appeared. This rescues a structured population. However, it is likely that no successful mutant has appeared in the well-mixed population yet. A well-mixed population is thus expected to go extinct.If

*t*_{add}≫ ⟨*t*_{af W}⟩, both the well-mixed and the structured population are expected to survive.

In Figure 2, we show the two timescales defined in Equations (1) and (2). We observe that the most substantial impact of structure on survival probabilities is observed when ⟨*t*_{af F}⟩ *< t*_{add} *<* ⟨*t*_{af W}⟩. This is fully in line with our theoretical analysis based on timescale comparisons. Furthermore, we observe that all populations survive if *t*_{add} ≫ ⟨*t*_{af W} ⟩. Finally, if *t*_{add} ≪ ⟨*t*_{af F}⟩, the population is eradicated in most cases. It can nevertheless be rescued by non-successful mutant lineages (see also Figure S3). Thus, the probability of treatment survival is given by the probability that non-successful mutants are present when the drug is added, see Equation (S16). Our simulation results are in good agreement with this analytical prediction, see Figure 2.

### Spatial structure impacts population composition before drug addition

To understand in more detail the role of spatial structure on resistance spread, let us study the system composition before drug is added.

Figure 3A shows the time evolution of the average number of R mutants present in the whole structured population. We observe that it is not impacted by population structure. Whatever the migration rate, the number of R individuals grows as mutants fix in some replicates of our stochastic simulations. This occurs either first locally for structured populations, or directly in the whole population for the well-mixed population (see SI Section 3.3), but the average over replicates remains the same. The long-time limit corresponds to the total steady-state population size, *N* = *K* (1 − *g/f*_{R}), as R mutants take over the whole population. This occurs with a timescale of order ⟨*t*_{af W}⟩. Figure 3B shows that the variance across replicates of the number of R mutants is strongly impacted by population structure. This is particularly true in the time interval between ⟨*t*_{af F}⟩ and ⟨*t*_{af W}⟩. This suggests that the impact of population structure on the variance of mutant number is driven by R mutant fixation. Figure 3B further shows that the variance of the number of mutants across replicates is larger when migrations are more frequent. This can be understood qualitatively by comparing a well-mixed population and a structured population with small migration rate. In the first case, mutants fix in one step, while in the second one they fix separately in each deme (see Figure S2). The large variance observed for the well-mixed population comes from the variability across replicates of the appearance time of a successful mutant. For the structured population with small migration rate, this is partly smoothed by lumping together *D* separate demes with different fixation times. Moreover, the appearance time of a successful mutant in the fastest deme has a smaller variance than that in a well-mixed population (see SI Section 3.3). Here, we focused on mutant fraction in the whole population because we are interested in the overall behavior of the population, but the dynamics at the deme level is described in SI Section 3 and below in Figure 4.

To go beyond the mean and variance in overall mutant number, in Figure 3C we examine the population composition in the absence of drug, at the time when we obtained the largest variance in Figure 3B (vertical dotted line). We describe the population composition by defining four categories: either there are no R bacteria at all (“No R” - red), or at least one deme comprises between 1 and 9 R bacteria but no deme has more than 9 R (“Small R population” - yellow), or at least one deme comprises more than 9 R individuals, but the R type has not fixed in the whole population (“Big R population” - cyan), or R bacteria have fixed in the whole population (“Only R” - blue). Note that we distinguish “Small R population” from “Big R population” to account for the possibility of stochastic extinction of R lineages, which becomes negligible if at least 10 R bacteria are present in a deme (see SI Section 3). In Figure 3C, we observe that in most replicates, at the time considered, the well-mixed population has either fixed resistance or does not have any mutants. Thus, the number of mutants is either 0 or (1 − *g/f*_{R})*KD*, yielding the large variance mentioned above. As we partition the system spatially and lower the migration rate, the composition of structured populations becomes more mixed, and the fraction of replicates with overall fixation or overall extinction decreases. This results in a smaller variance across replicates, as the number of mutants becomes more homogeneous across them.

An important cause of the composition difference between structured and well-mixed populations is the possibility of local fixation of R mutants. What is the fixation dynamics at the deme level before we add the drug? In Figure 4, we report how many demes have fixed resistance for different migration rates and at different times, in the form of histograms computed over simulation replicates. Note that for the well-mixed population we report overall fixation. As expected, the number of demes where R mutants have fixed increases over time. Furthermore, we observe that the distribution of demes that have fixed resistance and its dynamics are strongly impacted by spatial structure. For large migration rates (panel A), at all times, most replicates have fixed resistance in either no deme or all demes. This is close to the large-*γ* limit (i.e. the well-mixed population), shown as horizontal lines in panel A. When the migration rate *γ* is decreased (panels B and C), the fraction of realizations featuring an intermediate number of demes that have fixed resistance increases at intermediate times. For the small migration rate *γ* = 10^{−7} (panel C), the distributions become close to those observed for *γ* = 0 (panel D). Thus, small migration rates result in a population with a transient strong heterogeneity across demes. This has a crucial impact on the outcome of drug treatment, and on the survival probability curves in Figure 2. Indeed, the biostatic drug does not affect R mutants, and the presence of at least one deme where R has fixed rescues the population when the drug is applied.

### R mutants readily colonize the whole population after drug addition

So far, we focused on the impact of spatial structure on the survival probability of the population, and on its composition before the addition of drug. A key conclusion is that local fixation of R mutants allows earlier population survival. Let us now ask what happens after drug addition. Since our biostatic drug prevents S bacteria from dividing while mutations occur upon division, there are no new mutations after drug addition. If R mutants fixed in at least one deme before drug addition, how fast do they spread in all demes of a spatially structured population?

To address this question, let us first calculate the time *τ*_{c mig} it takes for an R mutant to migrate to a deme without R mutants, starting from a population where resistance has fixed in *k* ≥ 1 demes out of *D*. Then, there are *Nk* mutant individuals, where *N* is the steady-state deme size, which can migrate to each of the *D* − *k* uncolonized demes at a per capita rate *γ*. However, once an R mutant arrives in a new deme, its lineage may go stochastically extinct. This happens with probability 1−*g/f*_{R}, assuming that the deme does not contain other individuals (see derivation in SI Section 1.5). Thus, we have:
where *C* = 1*/*(1−*g/f*_{R}) captures the effect of stochastic extinctions. In Figure 5A, we compare the analytical prediction in Equation (3) to our simulation results, obtaining a good agreement. We also show the impact of stochastic extinctions by setting *C* = 1 in the analytical predictions: their effect is not negligible here (of order 10%, and they would be larger if *g* was closer to *f*_{R}). The time *τ*_{c mig} for R mutants to colonize the next deme features a minimum when half of the demes are mutant. A larger proportion of migration events then leads to colonization. Indeed, more mutant demes yield more mutants that may migrate, but fewer wild-type demes where they can fix, leading to a trade-off. Equation (3) neglects the presence of S bacteria in the population, which would affect the stochastic extinction of R lineages. This is acceptable provided that the extinction of S bacteria upon drug addition is fast enough. The decay time *τ*_{S} of a well-mixed population comprising *N* S bacteria upon drug addition reads [52]:

For the migration rate considered in Figure 5A, we checked that *τ*_{S} is indeed negligible with respect to *τ*_{c mig}.

So far, we focused on one step of the spread of R mutants. How long does it take in practice for R mutants to colonize the whole structured population? In Figure 5B, we show the total colonization time versus drug addition time for different migration rates. We observe different regimes in these curves depending on the drug addition time *t*_{add}.

First, if the drug is added after a short time, at most one deme in the population will comprise R mutants or will have fixed them. This should happen if the drug addition time *t*_{add} is shorter than the average appearance time ⟨*t*_{af F}⟩ of a locally successful mutant in the fastest deme. How long does it then take for R mutants to colonize the whole population? To obtain this total colonization time *t*_{c tot}, we can sum *τ*_{c mig} over the *D* − 1 steps needed to sequentially colonize the structured system. It is thus given by:
where Γ is the Euler gamma constant, while *Ψ* is the digamma function. In Figure 5B, we report the overall colonization time of the population by R mutants, defined as the time *t*_{add} when drug is added plus the time needed for colonization after drug addition. We observe that for small addition times satisfying both *t*_{add} ≪ ⟨*t*_{af F}⟩ and *t*_{add} ≪ *t*_{c tot}, *t*_{c tot} indeed describes well the colonization time. Indeed, it is then unlikely that mutants are present in more than one deme when drug is added, and the addition time has a negligible contribution. It leads to a plateau whose value is governed by the migration rate. Note that in Figure 5B, this plateau is only observed for small migration rates (*γ* ≲ 10^{−5}) such that the condition *t*_{add} ≪ *t*_{c tot} is satisfied for the smallest *t*_{add} values considered. For larger values of *t*_{add} and larger migration rates, the timescale *t*_{add} dominates the overall colonization time of the population by R mutants, as we have *t*_{add} *> t*_{c tot}. In these cases, mutant spread can be considered fast when drug is added (see Figure 5B). Finally, if *t*_{add} is further increased, overall colonization of the population by R mutants may happen before drug addition. Thus, the overall colonization time becomes smaller than *t*_{add} and tends toward a new plateau. Note that in this regime, colonization can occur before drug addition through migrations or new mutations, followed by fixations. The time it takes for a locally successful mutant to appear in the slowest deme can be expressed as (see SI Section 1.2). It is beyond this time that we expect a plateau, even for small migration rates. This is indeed what is observed in Figure 5B.

### Extension to cases where resistance carries a cost or a benefit

So far, we considered that the resistant mutant is neutral. However, antibiotic resistance often carries a cost in the absence of drug [59, 60]. Besides, if antibiotic is already present at relatively low doses in the environment before the addition of drug, it can induce a benefit of resistance before drug is added. Let us briefly consider these cases.

First, our results extend to effectively neutral mutants having a fitness cost *δ* such that *Nδ* ≪ 1. The impact of structure should in fact be even stronger if *Nδ* ≪ 1 but *NDδ* ≫ 1 because fixation is then strongly suppressed in a well-mixed population of size *ND*. Second, the case where the cost of resistance *δ* is stronger (*Nδ* ≫ 1) is discussed in SI Section 3.1. While spatial structure should have a strong effect here, this will only matter for the very long times associated to the fixation of deleterious mutants. Third, the effect of spatial structure we evidenced here for neutral mutants does not extend to the case where resistant mutants are beneficial, see SI Section 3.1.

### Extension to an inoculum that contains R mutants

So far, we focused on a sensitive inoculum and on resistant individuals appearing through mutations. The case where mutants are already present in the inoculum is also interesting. We consider it in SI Section 5. Our main results about the increase in probability of treatment survival granted by a spatial population structure extends to the case where R mutants are present in the inoculum (see also Ref. [39]). Specifically, we observe that in this case too, the survival probability of the population increases when the mutation rate decreases, see Figure S6.

### More complex spatial structures behave similarly to the clique

So far, we considered a minimal model of spatially structured population, known as the clique, where all demes are equivalent and connected to one another by identical migration rates. Do our findings extend to more complex spatial structures? To address this question, we explored two structures with more reduced symmetry.

First, we consider a two-dimensional square lattice with periodic boundary conditions. Here, each deme is directly connected to its four nearest neighbors, thus only allowing for local migrations. We compare the lattice to the clique with the same total outgoing migration rate from a deme. Our simulations yield no statistically significant difference for the survival probability in the square lattice and in the clique (see SI Figure S5). This suggests that making migrations more local does not affect treatment survival.

Second, we consider a star structure, comprising a central deme connected to *D* − 1 leaves [31]. All leaves are assumed to be equivalent. Denoting by *γ*_{I} (resp. *γ*_{O}) the migration from a leaf to the center (resp. from the center to a leaf), we defined migration asymmetry as *α* = *γ*_{I}*/γ*_{O}. We compared the star with a given outgoing migration rate from a leaf to the clique with the same total outgoing migration rate from a deme (i.e. *γ*_{0} = (*D* − 1)*γ*). We observe in Figure S5 that the star gives the same survival probability to treatment as the clique and the lattice if *t*_{add} *<* ⟨*t*_{af F}⟩, i.e., in cases where usually not more than one deme has fixed resistance before drug addition. For larger values of drug addition time *t*_{add}, our numerical results for the star depend on *α* and significantly differ from those obtained for the clique and the lattice, although the difference remains minor. We interpret this minor difference as arising from wild-type individuals possibly re-invading demes where mutants have fixed, which is structure-dependent. See SI Section 4 for more details. Overall, our main results are robust to changing the graph on which demes are placed.

## Discussion

Here, we showed that spatial structure can facilitate the survival of a bacterial population to antibiotic treatment, starting from a sensitive inoculum. Indeed, the bacterial population can be rescued if antibiotic resistant mutants are present when drug is added. While the emergence of resistant bacteria by random mutations only depends on total population size and not on spatial structure, their fate can be affected by spatial structure. In the relevant case where the mutation that provides resistance is neutral or effectively neutral, its probability of fixation is increased in smaller populations. This leads to local fixation of resistant mutants in demes, which then constitute refugia of resistance mutants and allow the population to survive when drug is added. Because of this, spatial structure facilitates evolutionary rescue by cost-free drug resistance. The survival probability of the population increases when the migration rate between demes is decreased, and when the number of demes is increased. Once the population is rescued by resistance, migrations allow resistant mutants to spread in all demes. While our main results were obtained starting from a sensitive inoculum, we showed that they extend to the case where there are resistant mutants in the inoculum. While we considered a minimal model where all demes are equivalent and connected to each other with identical migration rates, bacterial populations can have diverse spatial structures, with migrations that may be more local or asymmetric. We showed that our main conclusions still hold for a lattice of demes, modeling more localized migrations, and for demes located on a star graph with asymmetric migrations.

The effect of spatial structure we evidenced here is due to stochastic fixation of neutral mutants. Stochastic effects often give rise to original behaviors of small and structured populations. In particular, inoculum size impacts the survival of bacterial population in the presence of antibiotic [16, 17], and spatial partitioning impacts the efficiency of antibiotic resistance by production of the beta-lactamase enzyme [15]. However, the effect evidenced here is different, as it relies on the stochasticity in the fate of a mutant, and not in the stochasticity in the inoculum size.

Because local fixation of neutral resistant mutants is instrumental to our effect, it involves rather long timescales. The average appearance time ⟨*t*_{af F}⟩ = 1*/*(*Dμg*) of a locally successful mutant in the fastest deme is of particular relevance. As it scales as the inverse mutation probability per individual and per generation 1*/μ*, it can be quite long, even considering that there are often several different mutational targets that give rise to resistance, leading to a larger effective *μ*. However, this timescale is inversely proportional to the number *D* of demes, meaning that it can potentially become arbitrarily small when increasing population subdivision. With a mutation probability per nucleotide and per generation of 10^{−10} [61], assuming 10 possible mutations for the development of resistance to a given drug, gives *μ* = 10^{−9}. Then, for bacteria dividing once per hour, we find ⟨*t*_{af F}⟩ = 10^{8} h for *D* = 10, but ⟨*t*_{af F}⟩ = 10^{2} h for *D* = 10^{7}. Such large numbers of demes are realistic for instance in the case of intestinal glands [62]. Note also that larger mutation rates, e.g. in mutators, can be relevant to the evolution of resistance [63]. While we mainly focused on neutral mutants giving resistance, our findings extend to effectively neutral mutants, and to deleterious mutants. However, in the latter case, the timescales involved would be even longer.

Here, we modeled the action of the antibiotic as preventing any division of sensitive bacteria. In other words, we considered a perfect biostatic drug. However, our main findings generalize to biocidal drugs that increase the death rate of sensitive bacteria, or to drugs which combine both modes of actions. Indeed, what happens before the addition of drug, in particular the local fixation of resistant mutants, is not impacted by the mode of action of the drug. Thus, the effect of spatial structure we evidenced here holds independently of this. The difference between the biostatic and the biocidal case lies in the decay of the sensitive bacteria once drug is added. In the biocidal case, sensitive microbes may still divide during this phase, and new resistant mutants may then appear [52, 64]. This is the case both in well-mixed and in structured populations, with only minor differences between them, due to the stochasticity of extinction. Thus, our main findings are robust to the mode of action of the drug. Beyond modes of action, it would be interesting to study the impact of spatial structure on multi-step drug resistance evolution [65].

Here, we considered a minimal model of spatial structure, without any environmental heterogeneities. This allowed us to find a generic effect of spatial structure on the survival of a population to antibiotic treatment. It would be very interesting to extend our work to heterogeneous environments, which are known to have a substantial effect on antibiotic resistance evolution [45–47], and on evolutionary rescue in structured populations [48–50].

Some mechanisms of resistance to antibiotics involve the production of a public good. One prominent example is the beta-lactamase enzyme, which degrades beta-lactam antibiotics in the environment. Spatial structure was recently experimentally shown to have an important impact in this case [15]. Note that collective protection via a public good exists in multiple other cases [66–68]. Recently, a model was developed to describe this phenomenon in a well-mixed population [69, 70]. Extending this study to the case of structured populations would be very interesting. More generally, coupling these evolutionary questions to ecological interactions, which also have an interesting interplay with spatial structure [71–73], is an exciting perspective.

It would be interesting to test our predictions experimentally. *In vitro* experiments considering bacterial populations with migrations between demes have been performed [35–39], but generally with a constant environment. Investigating the fate of populations upon the addition of drug in these setups would be very interesting. A challenge is that the timescales relevant here are long. However, they can become smaller if the number *D* of demes is increased. Long experiments with large numbers of demes can be achieved using robots for serial passage [35, 74, 75], and the connection between theory and experiment for spatially structured populations is progressing [76].

## Code availability

Python code for our stochastic simulations is freely available at https://github.com/Bitbol-Lab/DrugRes_StructPop

## Acknowledgments

This research was partly funded by the Swiss National Science Foundation (SNSF) (grant No. 315230 208196, to A.-F. B.) and by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 851173, to A.-F. B.).