Spatio-temporal dynamics of random transmission events: from information sharing to epidemic spread

Random transmission events between individuals occurring at short scales control patterns emerging at much larger scales in natural and artificial systems. Examples range from the spatial propagation of an infectious pathogen in an animal population to the spread of misinformation in online social networks or the sharing of target locations between robot units in a swarm. Despite the ubiquity of information transfer events, a general methodology to quantify spatio-temporal transmission processes has remained elusive. The challenge in predicting when and where information is passed from one individual to another stems from the limited number of analytic approaches and from the large fluctuations and inherent computational cost of stochastic simulation outputs, the main theoretical tool available to study such processes so far. Here we overcome these limitations by developing an analytic theory of transmission dynamics between randomly moving agents in arbitrary spatial domains and with arbitrary information transfer efficiency. We move beyond well-known approximations employed to study reaction diffusion phenomena, such as the motion and reaction limited regimes, by quantifying exactly the mean reaction time in presence of multiple heterogeneous reactive locations. To demonstrate the wide applicability of our theory we employ it in different scenarios. We show how the type of spatial confinement may change by many orders of magnitude the time scale at which transmission occurs. When acquiring information represents the ability to capture, we use our formalism to uncover counterintuitive evasive strategies in a predator–prey contest between territorial animals. When information transmission represents the transfer of an infectious pathogen, we consider a population with susceptible, infected and recovered individuals that move and pass infection upon meeting and predict analytically the basic reproduction number. Finally we show how to apply the transmission theory semi-analytically when the topology of where individuals move is that of a network.

Random transmission events between individuals occurring at short scales control patterns emerging at much larger scales in natural and artificial systems. Examples range from the spatial propagation of an infectious pathogen in an animal population to the spread of misinformation in online social networks or the sharing of target locations between robot units in a swarm. Despite the ubiquity of information transfer events, a general methodology to quantify spatio-temporal transmission processes has remained elusive. The challenge in predicting when and where information is passed from one individual to another stems from the limited number of analytic approaches and from the large fluctuations and inherent computational cost of stochastic simulation outputs, the main theoretical tool available to study such processes so far. Here we overcome these limitations by developing an analytic theory of transmission dynamics between randomly moving agents in arbitrary spatial domains and with arbitrary information transfer efficiency. We move beyond well-known approximations employed to study reaction diffusion phenomena, such as the motion and reaction limited regimes, by quantifying exactly the mean reaction time in presence of multiple heterogeneous reactive locations. To demonstrate the wide applicability of our theory we employ it in different scenarios. We show how the type of spatial confinement may change by many orders of magnitude the time scale at which transmission occurs. When acquiring information represents the ability to capture, we use our formalism to uncover counterintuitive evasive strategies in a predator-prey contest between territorial animals. When information transmission represents the transfer of an infectious pathogen, we consider a population with susceptible, infected and recovered individuals that move and pass infection upon meeting and predict analytically the basic reproduction number. Finally we show how to apply the transmission theory semi-analytically when the topology of where individuals move is that of a network.
Keywords: spatiotemporal, dynamics, random, transmission, events, information, random walk S Supplementary material for this article is available online (Some figures may appear in colour only in the online journal)

Introduction
The spatio-temporal patterns that we observe at large scales in a population or an entire system result from random short-range interaction events between pairs of individuals or components. Uncovering when, where and how these interaction processes occur is a key tenet in the study of complex systems [1], and is a necessary step to control and modulate the emerging large scale patterns. Some of the simplest local mechanisms of interaction are those that entail the proximity and subsequent exchange of some token of information [2]. We refer to them as transmission events (see figure 1 for an illustration of the process), alternatively capture or annihilation events when either or both individuals cease to exist upon interaction.
Transmission events are ubiquitous and their efficiency or inadequacy is vital for the survival and functioning of many natural and artificial systems. Capture or binding events, such as when predators search for prey or white blood cells seek organisms invading our body, are beneficial for, respectively, the fitness of an ecological species [3] or the efficiency of our immune system [4]. Transfer of cell phone malwares or infectious pathogens, on the other hand, negatively affect, respectively, the security of an entire cellular network [5] or the health of an animal population [6].
Irrespective of the type of information exchanged, transmission events represent a type of reaction diffusion process whereby moving entities may undergo a reaction at one or multiple spatial locations. While with large population density a vast body of literature has pushed forward the understanding of the spatial and temporal scales that affect reaction kinetics [7][8][9][10][11][12][13][14], in the low density or dilute regime, most findings relate to specific models or geometry [15][16][17][18][19][20], and a general methodology is still lacking. The difficulty stems from the need to quantify, in the presence of multiple reactive centres, the time-dependent probability for a random event to occur at one location and not others, the so-called time-dependent splitting probabilities.
Standard approaches to overcome this challenge and analyse transmission events employ stochastic simulations, but they are known [21] to generate large fluctuations in the output predictions, possess limited scalability, and fail to elucidate the impact of dimensionality and confinement on information transfer. Here we move past these limitations by predicting the splitting probability dynamics and developing a general theory of random transmission events by building on the pioneering results developed for spatially symmetric scenarios and unbounded domains, namely studies on discrete lattices in the '80s on exciton annihilation in molecular crystals [15,16] and sensitised luminescence [17], and more recent ones in continuous space on infection/reaction dynamics [18][19][20]. Pictorial representation of a stochastic transmission event between two randomly moving individuals: a red one that carries information, the emitter or 'infected', and a green one that initially does not, the receiver or 'susceptible'. Upon proximity or encounter (co-location) the red individual may transfers information to the green individual. When transmission occurs successfully the green individual is then infected and turns red, and may later transmit that information to others. Examples of information transfer includes an infectious pathogen passed from an infected to a susceptible human, knowledge about food sources exchanged between two animals, or a shared coordinate systems communicated between two mobile autonomous robots.
Extending the so-called defect technique [8,[22][23][24][25] to discrete time we construct an analytic theory of information transfer processes to predict the spatio-temporal dependence of the probability of transmission between individual pairs in spatial domains of arbitrary dimensions and boundary conditions, and for arbitrary degree of transfer efficiency. The mathematical exact nature of the theory allows us to tackle the long standing issue of predicting the mean reaction time for a randomly moving entity in presence of multiple reactive centres [26]. We determine the inaccuracy of widespread approximations to estimate the mean reaction time by developing a general procedure in arbitrary powers of small and large ratio of movement versus reaction rates, coined, respectively, the motion limited and reaction limited regimes [9].
To demonstrate the broad utility of the theory we apply it in different contexts. We show how boundary conditions may affect the dynamics of transmission events between two individuals by many orders of magnitude. We also analyse capture events in a predator-prey contest with imperfect detection when predator and prey do not share the same spatial domain [27]. As an application to a population problem we obtain the exact dependence of the so-called basic reproduction number [28] in an epidemic model as a function of the pathogen infectivity and the movement characteristics of the individuals. As an application to non-Euclidean topologies we also demonstrate that our theory can be employed semi-analytically when individuals move on networks [29].
The rest of the paper is organised as follows. In section 2 we introduce the mathematical formalism, show how the exact solution of the master equation is derived, obtain the splitting probability to transmit at one location and not others, and also present an approximate technique to determine the overall transmission probability at any location. The spatio-temporal dynamics of transmission events on Euclidean lattices is studied in section 3, while the mean transmission time (MTT) is presented in section 4. Movement strategies that reduce the chance of a predator being captured by a prey are analysed in section 5. Section 6 derive the exact prescription for the basic reproduction number in a susceptible-infected-recovered (SIR) model, while the dynamics of transmission between walkers on a network form section 7. Conclusions are drawn in section 8.

Modelling transmission events
To develop an analytic theory we use a discrete space-time formulation and model the movement of individuals as lattice random walkers [30]. The spatial discretisation avoids solving unwieldy boundary value problems with continuous space variables [31], while the representation in discrete time has two advantages. Firstly, it exploits the existence of explicit analytic representations in space and time of the occupation probability for nearest neighbour and next-nearest neighbour steps as well as their generating functions [32,33]. Secondly, one benefits from the use of standard techniques to perform numerical time inversion of generating functions [34] as compared to the non-trivial task of inverting a function in Laplace domain [35,36] when building the theory in continuous time.
We consider two walkers that roam independently in a domain of d spatial dimensions. The quantity of interest, P n 0 (n, t), is the time-dependent joint probability in the combined domain of 2d spatial dimensions, with n = (n 1 , n 2 ) and n 0 = (n 0 1 , n 0 2 ). It represents the probability of the first individual, the information emitter or 'infected', to be at time t at site n 1 starting from n 0 1 , and the second individual, the information receiver or 'susceptible', to be at time t at site n 2 starting from n 0 2 . A transmission event occurs when the walkers meet at a site, that is whenever n 1 = n 2 , and information gets transferred (see figure 1 for an illustration of the process). We call S the unordered set of M lattice sites in the 2d domain that correspond to the co-locations of the two original walkers in the d domain. When a transmission event happens the susceptible walker becomes infected and P n 0 (n, t) becomes identically zero [15]. Calling m k (k = 1, . . . , M) the co-location coordinates in S where information may be transferred with probability 0 < ρ m k 1, we map the event of transmission to that of an absorption event of a single 2d walker at one of M partially absorbing target sites, also referred to as defective sites or defects [22-25, 30, 37].
By using δ n,s to represent the Kronecker delta and calling A(n, ) = δ n / ∈S A 1 (n, ) + δ n∈S A 2 (n, ) the transition probability tensor in the 2d space from lattice site to lattice site n, one describes the above process through the master equation where, in the second equation, 1 − ρ m i is the probability of not having been absorbed when at site m i . Whenever ρ m i = 1, that is with perfect transfer efficiency at one of the sites that represents co-location of the walkers, the second equation indicates that site m i is a (fully) absorbing site. In other words, the coupled equations in (1) represent the temporal dependence of the joint probability of being at any location n in the 2d domain and not being absorbed at any of the defective sites.

Exact solution of the master equation
To find the exact solution of equation (1) it is convenient to combine the two equations into the single one where the prime summation runs over the M elements of the set S and is being used to lighten the notation. Equation (2) can now be solved exactly using Montroll's defect technique [8,22,23,25,30,37]. The latter exploits the knowledge of the solution of the defect-free problem, that is the solution of the master equation (1) when the set S is empty (ρ s = 0) and the linearity in P(n, t) of the equation itself. By assuming s ρ s δ n,s A(s, )P( , t) as a given known function, the formal solution of (2) is simply the Green's function solution or propagator of the defect free problem plus the propagator convoluted in time and space with the known term. Calling Ψ m (n, t) the defect-free propagator, that is the occupation probability at time t to be at n having started at m at time t = 0 in the absence of any (partially) absorbing site, we have alternatively by taking the generating functions, that is f (z) = ∞ t=0 f (t)z t for any function f (t), With an initial condition localized at lattice site n 0 we can have two scenarios: either n 0 / ∈ S or n 0 ∈ S. The initial condition is then P(n, 0) = δ n,n 0 (1 − ρ n 0 )δ n 0 ∈S + δ n 0 / ∈S . As a result equation (5) can be rewritten as P n 0 (n, z) = Ψ n 0 (n, z) + s ρ s ρ s − 1 Ψ s (n, z) P n 0 (s, z).
Equation (6) when n is equal to all the absorbing site in S is a matricial equation that can be solved via Cramer's rule [38] through the evaluation of the ratio of determinants where |A| = det(A), and where P m 0 (m j , z) represents the generating function of the probability of being at m j at time t and not having being absorbed at any of the M partially absorbing sites. The M × M matrix D(ρ, z) has diagonal elements given by D k,k (ρ, z) = 1 − ρ m k + ρ m k Ψ m k (m k , z) and off-diagonal elements given by D ,k (ρ, z) = ρ m k Ψ m k (m , z), while the matrix D ( j) (ρ, z) is the same as D(ρ, z) but with its jth column replaced by the transpose vector Ψ n 0 (m 1 , z), Ψ n 0 (m 2 , z), . . . , Ψ n 0 (m M , z) T . Inserting equation (7) into equation (6) one obtains the exact solution in z-domain of equations (1) or (2) as Given the presence of (partially) absorbing sites the walker occupation probability is not conserved in time. This can be seen by summing equation (8) over all n sites to obtain the survival probability, that is the probability of not having being absorbed by either of the sites in S, where the expression after the second equal sign has been obtained by summing equation (6) over all n.
The generating function of the first-absorption probability to any of the M targets, . From this relation we obtain the first-transmission probability between the two original lattice walkers in the spatial d domain as where ρ m j might all be different, while the splitting probability at the jth defective site is simply where the notation (m j |m 1 ; . . . ; m j−1 ; m j+1 , . . . , m M ) means that the walker is absorbed at site m j before being absorbed at any of the other M − 1 sites. After pulling out the term ρ m j Ψ m j (m j , z) from each column from D(ρ, z), and similarly from all columns of D ( j) (ρ, z) except the j-the column, it is possible to rewrite conveniently all the elements of the two matrices in terms of first-passage probability generating functions between pairs of sites F x ( y, z), namely from the initial location to the absorbing sites and between all absorbing sites, and first-return probability generating functions to the absorbing sites Q m k (z). As the splitting probabilities express mutually exclusive trajectories, the firsttransmission probability is simply the sum of all splitting probabilities, that is where the M × M matrix F(ρ, z) has diagonal components equal to F k,k (ρ, z) = 1−ρ m k ρ m k 1 − Q m k (z) + 1, with F r ( , z) the generating function of the first-passage probability from site r to site and Q r (z) the generating function of the first-return probability to site r, and off-diagonal elements F ,k (ρ, z) = F m k (m , z). Analogously to the matrix D ( j) (ρ, z), the matrix F ( j) (ρ, z) is the same as F(ρ, z), but with its jth column replaced by the transpose vector Note that in equation (12) we have lightened the notation: we have used T n 0 (ρ, z) in place of T n 0 →(m 1 ;...;m M ) (ρ, z) and we have called T ( j) n 0 (ρ, z) the splitting probability of transmission at site m j in place of T ( j) n 0 →(m j |m 1 ;...;m j−1 ;m j+1 ...,m M ) (ρ, z). The significance of equation (12) is that it is possible to determine analytically the generating function of the time-dependent transmission probability as well as all the splitting probabilities. At the same time a finite integration through standard techniques [34] (see appendix D.1) provides the inversion of equation (12) and one obtains T n 0 (t) and T ( j) n 0 (t). In other words we obtain the time-dependent transmission probability by knowing the generating function of M 2 first-passage probabilities and M return probabilities in the 2d domain in the absence of any defect. This general result is valid for any discrete Markov process where M is a finite subset of states, and is thus applicable to lattice as well as networks.

Approximating the transmission probability dynamics
When ρ r = ρ there exists a technique, the so-called ν-formalism [39], that may simplify the computation of the transmission probability. While it does not allow to calculate the individual splitting probability, it does provide a closed form expression for the overall transmission probability that avoids the computation of the determinant in equation (12). The technique was introduced to study exciton movement on lattices with traps [16], and was used for sensitized luminescence in molecular crystals [17] and molecular motion in cell membranes [40], and it is of relevance to the vast literature on first-passage processes [41][42][43][44]. More recently it has also been applied to study the transmission dynamics between two Brownian walkers bounded to move in a quadratic potential [18,19]. In these examples the νformalism is shown to be exact, but has also been shown to be a good approximation and to be related, when defects are randomly placed, to the defect-placement pair correlation function [17].
The ν-formalism, introduced to study the dynamics in continuous time, can be applied without any change to discrete time. It stems from noticing that summing over all co-location sites in equation (6) when ρ r = ρ one has [16] The quantity s Ψ r (s, t) represents the probability that the two walkers are co-located at time t if their locations coincided at r when t = 0 [18]. When s Ψ r (s, z) is independent of r, then one calls ν(z) = s Ψ r (s, z) and from (13) one gets s P n 0 (s, z) = s Ψ n 0 (s,z) Even when ν(z) is not exact, the formalism can be applied as an approximation provided one eliminates the r-dependence from s Ψ r (s, z). Two prescriptions to eliminate such rdependence have been proposed in the literature: one consists of taking [39] ν(z) = s Ψ s (s, z), which, however, is a poor approximation in our problems, the other one takes ν(z) as an ensemble average over all defective sites [16,17], that is giving equation (16). We thus have an alternative representation of the generating function of the overall transmission probability when ρ r = ρ, exact and equivalent to equation (12) for movement in periodic domains, and approximate in other cases, and is given by Equation (16) satisfies the appropriate limits, i.e. T n 0 (ρ, z → 0) = ρ s δ n 0 ,s and T n 0 (ρ, z → 1) = 1. As we show in appendix C, the transmission probability approximation is very good when the locations where walkers may meet fills the entire available domain, but it is a poor approximation when the domains where walkers move are unequal as exemplified by the predator-prey interaction problem analysed in section 5.

Time-dependent transmission probability
For our first problem we construct analytically the occupation probability for the 2d walker n 0 2 (n 2 , t) from the known occupation probability of the individual walkers, ψ (i) , in periodic and reflecting domains (see appendix B for the explicit Ψ n 0 (n, t) expressions). We use Ψ n 0 (n, z) to build the matrices F(ρ, z) and F ( j) (ρ, z), invert numerically equation (12) to time, and plot in figure 2 the transmission probability when the two walkers are initially placed in opposite corners. In panel (a), with perfect transfer efficiency, we display the encounter dynamics. As the walkers in the periodic case are nearby at t = 0, the peak in transmission results from encounter events occurring in the area around the initial sites, that is within a small number of steps. Past the peak the decrease in the transmission probability for the periodic domain slows down in correspondence with the increase from zero for the reflecting domain. This qualitative change signals the time scale at which the movement trajectories that bring the walkers to meet in the bulk of the domain, start contributing to the transmission probability. These insights can be clearly observed by plotting the spatio-temporal encounter dynamics at each spatial location (splitting probabilities) of two walkers in a smaller square domain, that is T (k) n 0 (ρ = 1, t) at each encounter location m k , as shown in the supplementary video SV1 (https://stacks.iop.org/JPA/55/375005/mmedia).
The so-called 'defocusing' effect was coined in reference [20] to study first-passage processes within two concentric spheres, the internal one partially reactive, and the outer one fully reflecting. The term defocusing relates to the multiple time scales present in the dynamics of first-absorption at the reactive boundary. We also find in our case multiple time-scales, separated by orders of magnitude, as displayed by the complex shape of the transmission probability.
In all curves the mode of the probability is due to the so-called direct trajectories, that is those do not explore much of the space before they reach their targets. The kink or drastic change  (c), is the approximation for the reflecting case using equation (16). The circles and squares are generated from 1.5 × 10 7 stochastic simulations. The dashed purple curve in all three panels is the approximation for the reflecting case in equation (16): the inset in panel (a) highlights how little difference is present between the exact and the approximate expression, whereas in panels (b) and (c) the approximate curves show that they are indistinguishable from the exact line. of decay in panel (a) after the mode of T n 0 (ρ, t), around 200 steps, represents the cross-over or mixing time beyond which the contribution to the transmission dynamics comes from indirect trajectories, that is those trajectories that explore much of the space before a transmission event happens [45,46]. This mixing time is related to the so-called cut-off phenomenon [47][48][49], that is the fast time scale with which the occupation probability approaches the steady state (an area of interest in the mathematical literature on random walks in finite groups, see e.g. [50]). As the initial conditions for the reflecting case represent two walkers at the opposite end of the domain, the mixing time occurs around the mode of T n 0 (ρ, t) and no kink is present in panel (a) on the green curve. The kink in the transmission probability would have in fact appeared by placing the two walkers nearby in the reflecting domain.
The drastic change of decay for the periodic cases gets even more pronounced and progressively so as one moves from panel (b) to panel (c), as walkers need to meet more than once before transmission occurs, that is more indirect trajectories contribute to the transmission probability beyond the mode. In panel (c), when ρ starts being small (ρ = 0.025), the flattening of T n 0 (ρ, t) for long periods of time indicates the onset of the reaction regime, that is when the dynamic is mainly dictated by the target reactivity.

Exact mean transmission time and comparison to approximations for mean reaction time with multiple targets in other areas
By setting out the transmission formalism as a first-passage process to multiple partially absorbing targets, we also produce advances in the study of reaction diffusion events with multiple reaction centres. We are able to derive an expression for the mean transmission/reaction time in terms of mean first-passage and first-return time to individual locations. Using equation (12) and after some lengthy algebra (shown in the supplementary information) we derive the MTT at any of the M encounter sites as Similarly to the transmission probability, the M × M elements of the matrix T are constructed by calculating in the 2d domain M 2 first-passage quantities and M first-return quantities, namely, the mean first-passage times (MFPTs) F r→ from r = n 0 to = m k encounter sites, with k = 1, . . . , M, and from r = m i to = m k (for all i and k, with i = k), and the mean return time Q m k to the m k sites. More precisely we have The analytic findings above allow to construct a rigorous perturbative expansion (see supplementary information for the derivation) to calculate the motion and reaction limited approximations of equation (17). For the simpler case ρ m i = ρ, that is when the transfer probability is equal at any of the encounter site, we obtain the first order reaction limited approximation where For the first order motion limited approximation we have instead where r 2 = 1 ρ − 1 1 and E is the mean first-encounter time, obtained from (17) when ρ m j = 1 for each j. The numerical coefficients α M and β M are generated by defining the matrices T k , T 0k and T 1k , obtained by eliminating the kth row and column from the respective matrices T, T 0 and T 1 , and calculating α M = M k=1 Q m k det T 0k / det(T 0 ) and We can now consider our exact MTT and compare two approximate prescriptions routinely employed to estimate rates of random processes in reaction diffusion phenomena. The first approximation consists of taking the encounter rate obtained from motion considerations in the absence of transmission, and then multiply it by a transfer rate upon proximity or colocation. Examples of this approach can be found e.g. in studies on sensitised luminescence [51,52], nucleation theory [53], and epidemiological models [54]. The second approximation goes under different names in different disciplines, e.g. it is called the inverse addition law when utilised for series reactions in chemical compounds [55], or Matthiessen's rule developed to study charge carrier mobility in solids [56] or, in conjunction with the relaxation time approximation [57], to estimate the dynamics of carriers reaching equilibrium. This second approximation consists of taking the overall rate of the combined processes as Average time for a territorial predator to capture a territorial prey for different relative directional bias in their movement steps. Both predator and prey are confined within their own territory, represented by reflective boundary conditions at the perimeter of their respective domains, but the prey's domain boundaries do not affect the predator's movement steps. The predator starts at the centre of its own square territory of side-length N = 41, moves as a next nearest-neighbour lattice walker and has a bias g 1 = 0.15(cos[π/4], sin[π/4]) towards the bottom left corner. The prey also starts at the centre of its own square territory of side-length L = 5, moves as a next nearest-neighbour lattice walker and has a bias g 2 = 0.15(cos[θ + π/4], sin[θ + π/4]) that forms a relative angle 0 θ π with respect to g 1 as depicted in panel (a). The diffusivity parameter q is the same for both individuals and the capture efficiency at each site within the prey's territory is constant and equal to ρ. In panels (b)-(e) we have used, respectively, the values (ρ, q) = (1, 0.072), (0.8, 0.47), (0.8, 0.51), and (0.02, 1). The solid lines are the exact results from equation (17) with M = L 2 , while T R n 0 (triangles) and T M n 0 (circles) are, respectively, the first order capture and motion limited approximations, respectively in equations (18) and (19). Except when ρ is small, the corresponding MTT derived from equation (16) fails to capture any of the qualitative features present in these curves (see figure C1). the sum of the rate of the individual processes, an exact prescription only when the combined process is the superposition of multiple independent Poisson distributed processes [58].
While shortcomings of the above two prescriptions are well known, e.g. in physical [15,59,60] and epidemiological problems [61][62][63][64], our exact expression for the MTT allows to quantify the validity of the reaction and motion limited approximations. For example the inverse sum of rates, as per Mathiessen's rule, appears only in the zeroth order reaction limited case, namely the S term in equation (18), while the first order perturbation both in the motion and reaction limited cases already show an intricate relation between the reactive terms involving the return probability to the encounter locations and the motion terms involving the combination of first-passage times to and between the lattice sites where the walkers are colocated. Similarly, one may observe that the product of encounter and transfer rates do not emerge as a parameter in any order of the systematic expansion (18) and (19).
We conclude this section by noticing that with perfect transfer efficiency equation (17) allows us to make contact with the literature on first-passage processes [41][42][43][44] where computation of the MFPT to any of M target sites has so far relied on the numerical solution of a set of linear equations for the splitting first-passage probabilities integrated over all times [65], namely T (k) n 0 (ρ = 1, z = 1) for each k in our notation. Using ρ m k = 1 for each k in equation (17), we have the exact solution of that equation set. The formalism presented here allows to deter-mine analytically all the (time-integrated) splitting probabilities, offering a great simplification to the calculation of the MFPT in a multi-target environment.

Evasive strategy in a predator-prey game
We exploit the MTT expression and explore the efficiency of different evasive strategies in a predator-prey game within overlapping territories [66] whereby a territorial predator seeks to capture an evasive prey. We take ρ m k = ρ to represent the capture probability, i.e. the ability of the predator to seize the prey once co-located.
We fix the predator movement statistics and we analyse the prey evasive attempts as a function of its movement directional bias relative to the predator through the angle θ (see figure 3(a) for the spatial arrangement of the predator and prey and their movement characteristics). As no burrow or nest exists for the prey, we define the strategy as optimal when it maximises the mean time at which the prey will be eventually captured.
With ρ = 1, i.e. when capture occurs at the first encounter, it is best for the prey to stay away from the predator for as long as possible. The maximum MTT in panel (b) occurs at θ = 0, which corresponds to when both walkers move towards the bottom left corner from the outset. With ρ small, in panel (e), the opposite strategy is more convenient, that is to move towards the predator given the small chance of being captured at the first encounter. At later times the walkers have minimal spatial overlap as the drift coefficient is towards opposite corners and thus the maximum MTT occurs at θ = π. Panels (c) and (d) displays the parameter range through which the transition from the most obvious strategy in panel (b) to the counterintuitive one in panel (e) becomes apparent.

The basic reproduction number in a susceptible-infected-recovered population
We apply our theory to a stochastic spatial SIR model. We construct an exact formalism to predict a key epidemiological parameter to predict its spread in a population, the basic reproduction number R 0 . Starting with one infected individual and W susceptible ones in a square domain of side N, we provide an analytical recipe to calculate R 0 for the stochastic SIR model where ρ m k = ρ is the so-called force of infection [67], that is the per capita probability to become infected. The other critical epidemiological parameter in the model is γ, which represents the probability for the initially infected individual to either leave the domain or to recover from the infection if no escape from the spatial domain is possible.
As state-of-the-art theoretical approaches to estimate R 0 are based on a macroscopic description of the infectious dynamics [28,68], we show the value of our theory in determining R 0 from a microscopic description of all possible spatio-temporal transmission events. We first account for the (independent) recovery probability γ, giving the probability for a transmission event to occur at time t as (1 − γ) t T n 0 (ρ, t). Summing over all times we obtain the overall transmission probability ∞ t=0 (1 − γ) t T n 0 (ρ, t) = T n 0 (ρ, 1 − γ). We assume complete uncertainty about the initial locations of the individuals in the population and we sum over all possible initial spatial positions Ω. In this way the transmission probability is equal for each susceptibleinfected pair and the average number of secondary infections is given by (see more details in the supplementary information) Note that in equation (20) the generating function T n 0 (ρ, z) is evaluated at z = 1 − γ, thus bypassing the need to perform a numerical inversion. By varying γ to its extreme values we obtain two expected limits in (20). In one limit, γ = 1, that is when the infected individual recovers immediately, R 0 → ρW/N 2 with W/N 2 representing the probability of being colocated with either of the susceptible individuals at time t = 0. In the other limit, γ = 0, when the infected never recovers or never moves out of the domain, the system reduces to the case of a susceptible-infected population, and R 0 → W as all individuals will eventually get infected.
We compare our analytic predictions of the basic reproduction number with stochastic simulations where we count the secondary infections up until the initially infected individual either recovers or has infected all the W susceptible individuals present at time t = 0 (R 0 neglects the depletion of the number of available susceptible individuals as time progresses). In figure 4 we show perfect agreement between simulations and equation (20) plotted as a function of γ for different values of the force of infection ρ and population number W.

Transmission dynamics on networks
While the formalism has been applied by considering movement on Euclidean lattices, the topology of the mathematical space where random walkers move can be arbitrary. The mathematical derivation in section 2.1 is in fact completely general and does not specify the form of the matrix that represents the jump probabilities between any pair of lattice sites or nodes. As the exact propagators for random walks on networks are not known [29], the master equation in the absence of any defect on a network cannot be solved exactly. However, the generating function solution of the master equation can be found numerically computing the eigenvalues and eigenvectors of the adjacency matrix. We thus exploit our theory here and analyse the transmission dynamics of two walkers moving on a network, a topic of burgeoning interest in the robotics [69,70] and physics literature [71], but also of relevance to the propagation of misinformation in online social networks [72,73].
Recent studies on the dynamics of random walks on networks have provided means to compute the mean encounter time of multiple walkers at one node [69,71]. As the encounter of N walkers at one node corresponds to a first-passage process to a single node of a single combined walker moving on a network whose size is N times the original network, such calculation does not require the computation of the splitting probabilities. As our formalism, on the other hand, accounts for all possible splitting probabilities, we are able to compute the temporal evolution of the encounter probability (at any node) as well the transmission probability T n 0 (ρ, t). We do so for the case of two walkers moving on a network, taking for simplicity ρ = ρ.
Using the igraph package [74] we generate three specific undirected network realisations with 100 nodes with the constraint that all nodes can be reached from any other nodes. We compare the transmission dynamics on one-dimensional periodic (P) lattice with that on a Barabási-Albert (BA) network [75] with each new node added having four edges, an Erdös-Rényi (ER) network [76] with an edge probability of 0.1, and a Watts-Strogatz (WS) network [77] obtained with a 0.2 rewiring probability of the one-dimensional periodic lattice. The corresponding transition matrix for each network is constructed by taking the adjacency matrix of the network adding a self-loop for each node and normalising appropriately. The resulting transition matrix is such that the probability to jump to either of the connected nodes or to stay at the current node are equal. We then place the two walkers initially at two nodes that are connected through by two other nodes and three edges and we use equation (12) to plot the transmission probability as a function of time in figure 5 for three values of ρ.
The maximum of T n 0 (ρ, t) at short times is due to the walkers being placed initially within a minimum of three steps from each other. The highest value occurs in the periodic lattice as the walkers on the networks have more chances to move away from each other, while the second highest probability value occurs with the small world network, which is generated by perturbing the periodic lattice. Compared to the lattice studied in figure 2, the mixing time for the periodic case in figure 5 is longer, which may appear surprising given that the total number of lattice sites in the former is 40 times the one in the latter. However if one considers that the number of neighbouring sites for the combined single walker is 24 for the former and 8 for the latter, it is clear that the topology also does play a role in the magnitude of the mixing time, with shorter values the larger the number of neighbours. The long mixing time in figure 5 is also the reason why a reaction regime, corresponding to when the probability flattens out, is not apparent even when ρ = 0.025. Compared to the periodic case, the presence of long-range connections in the WS network pushes the mixing time to lower values, namely around time t = 40, but it is yet not sufficient to reach the reaction regime at ρ = 0.025. For the ER and BA networks, for which the average number of outgoing connections is larger than the periodic lattice and the WS network, there is no obvious cross-over between the occurrence of direct versus indirect trajectories. The probability displays a continuum of transmission time scales already at ρ = 1, and the reaction regime is clearly visible for lower values of ρ. For the specific ER and BA network realisation the mean degree is, respectively, 10.1, and 7.8, compared to 2 for each site in the periodic case and the WS case. Whereas, the mean excess degree is 10, 10.7 and 1.3, respectively, for the ER, BA, and WS networks and 1 for the P lattice. The vertical arrows in panels (a)-(c) represent the MTT for each probability curve obtained via equation (17). Panel (d), which is the same as (a), but on a log-log scale, is plotted to highlight the nuances of the transmission time dependence that makes the MTT for the ER and BA case always smaller than the WS and P cases.

Conclusions
We have developed a spatio-temporal theory of stochastic transmission events between pairs of individuals that move and transfer information upon co-location. While we have focused on simple geometrical constraints and basic movement statistics to present fully analytic results in most of the applications considered, the theoretical approach presented here is completely general and opens the path for more complicated transmission processes accounting for mobility patterns derived from empirical data and for more intricate physical boundaries. The results can also be extended to more complex information transfer processes, e.g. when communication occurs via acoustic, electromagnetic or chemical signals that are much faster than the movement of the individuals. In such cases transmission is possible even when individuals are some distance away and the efficiency of the emitter-receiver link can be straightforwardly accounted for by including among the defective sites also those locations when individuals are some distant apart and taking an appropriate distant-dependent transfer probability.
The use of the defect technique has allowed us to overcome past technical hurdle and compute the splitting probabilities to reach any number (subset) of a set of meeting locations to the exclusion of the remaining ones. This in turn has given us the ability to quantify analytically the MTT to any of a set of locations allowing us to resolve the long-standing issue of quantifying exactly the reaction time scale for reaction diffusion processes in the dilute regime whereby a small number of reacting particles or agents may interact at multiple locations with some rate or probability. This has been possible by deriving a determinant expression for the mean reaction time from the knowledge of the MFPT and mean return time to each individual reactive centre. Beyond transmission problems, these findings will be of use to analyse a wide spectrum of processes that rely on first-passage [41][42][43][44] and first-encounter statistics [69,71,78,79] as well as rendezvous problems [80,81]. And more broadly, the formalism developed here represents a novel tool to study the dynamics of interacting random walks [82,83].
Given the direct relevance to epidemiology some further considerations to model the spread of infectious diseases are in order. As modelling infection spread relies on compartmental models whereby the state of infection of an individual is represented through discrete internal variables [84], the stochastic transmission theory gives a mechanistic representation of how infectivity is transferred from one individual to the next [85]. With digital epidemiology [86] offering opportunities to identify pathogen transmission at the person-to-person level, the theory presented here provides a rigorous means to predict the risk of getting an infection on the basis of the pathogen characteristics, the movement statistics of the individuals and the physical constraints of the space where individuals may be in proximity [87]. More generally, by providing quantitative tests for the validity of traditional assumptions of infection parameters in a population [88] such as the density-dependent or the frequency-dependent transmission rate, our formalism allows to improve on the output of large scale epidemiological forecast [89] for the current as well as future pandemics.

Acknowledgments
LG and SS acknowledge funding from, respectively, the Biotechnology and Biological Sciences Research Council (BBSRC) Grant No. BB/T012196/1 and the Engineering and Physical Research Council (EPSRC) Grant No. S108151-111. We acknowledge discussions with Debraj Das, Nitant Kenkre, David Sanders and Zohar Neu, and the Advanced Computing Research Centre, University of Bristol (http://bris.ac.uk/acrc/) for making their computing resources available to us. We thank Elisa Bozzarelli for the illustration in figure 1.

Author contributions
LG, first and senior author, designed the study, derived the mathematical details, drafted and revised the paper. SS implemented the computational tools, created the figures, edited and commented on the text, and approved the submitted MS.

Data availability statement
All data that support the findings of this study are included within the article (and any supplementary files).

Appendix A. Limiting cases of the first-transmission probability expression
From the general expression (12) we can obtain some results. If transmission may only occur at a single site r one has T n 0 →r (ρ, z) = F n 0 (r, z) which reduces to the first-passage probability from n 0 to r when the information transfer is perfect ρ = 1. The case in which transmission occurs at two locations, m 1 and m 2 with, respectively, transfer probability ρ 1 and ρ 2 , is given by which reduces to equation (A.1) when either ρ 1 or ρ 2 vanishes, and reduces to equation (38) of reference [32] when ρ 1 = ρ 2 = 1, that is to the generating function of the first-passage probability to either of two targets. The derivation of the analytic expression for the first-transmission probability in continuous time can be obtained straightforwardly from the discrete time expression. We show this derivation in the supplementary information.

Appendix B. Propagator, first-passage probability, and mean first-passage and return time explicit formulae
The expressions for the first-passage and return probability used in equation (12) and the MFPT F r→ and mean return time Q r used in equation (17), can be obtained using the time-dependent propagators for the individual walkers. The knowledge of the time dependence is necessary given that the joint propagator is simply given by the product of the two individual propagators. Below we show how the necessary expressions have been derived.
We keep the treatment completely general and we consider the propagator in d spatial dimensions with size N 1 × · · · × N d for an unbiased walker in a periodic domain [32] as well as for a biased walker in a domain with reflecting boundaries [33]. Along each dimension the sites range in coordinates between n = 1 and n = N i . The time-dependent propagator for a d-dimensional walker localised at site r at time t = 0 is given by where for the periodic case and while for the reflecting domain and where and with α k = 1 when k = 0 and α k = 2 for k > 0. The propagator representing the two independent lattice walkers each moving in a domain of d dimensions of size, respectively, N 1 × · · · × N d and L 1 × · · · × L d , is given by whose generating function is given by From equation (B.9) it is straightforward to obtain the first-passage probability from site r to site given by and the return probability to site r .
we obtain the mean first-encounter time F r→ at location starting from r Similarly by calculating d Q r (z)/dz z=1 from (B.11) we obtain which represents the mean return time to site r and equals the inverse of the steady state occupation at site r as expected from Kac's theorem on discrete Markov stochastic ergodic systems [90]. for reflecting boundary conditions. In figure 3 we have used the propagator for two biased next-nearest neighbour walkers moving in a two dimensional domain, which means that the propagator for each walker is itself made up of the product of one dimensional propagators. For ψ (1) r 1 ( 1 , t) and ψ (2) r 2 ( 2 , t) we have constructed them by using equation (B.9) with, respectively, d = 1 and N 1 = L 1 = 41 for the predator, and d = 1 and N 1 = L 1 = 5 for the prey. The combined Ψ r ( , t) is then made up of the product as per (B.8). In figure 4 we have considered reflecting boundary conditions for unbiased nearest neighbour walkers moving in a square domain of size 25, that is we have used equation (B.9) with d = 2 and N 1 = N 2 = 25 for each walker.

Appendix C. Validity of the ν-formalism
When the walkers are moving without bias and sharing the same spatial domain with periodic or reflecting boundary conditions or a combination thereof in arbitrary dimensions, it is straightforward to calculate s Ψ n 0 (s, z) and r s Ψ r (s, z). As these summations are simply scalar product of the right eigenvectors of the matrix representing movement along each direction, Figure C1. Comparison of the exact expression for the MTT in equation (3) and the one derived from the ν formalism, that is by taking the limit d T n 0 (ρ,z) dz z=1 in equation (16).
In this example the locations where two walkers may meet is not the entire domain as displayed in figure 3 their pairwise scalar products are non zero only when both of the eigenvectors are identical.
Using the propagator expressions in appendix B we can show that in the absence of movement biases where each s (N) k and g (N) k (n 1 , n 2 ) are defined, respectively, in equations (B.2) and (B.3) when it is a periodic domain, and via equations (B.6) and (B.7) when it is a reflecting domain. Note that for periodic domains the functional dependence of g (N) k (r, ) in equation (C.1) clearly indicates that s Ψ n 0 (s, z) depends only on the initial separation n 0 1 − n 0 2 along each axis of walker 1 and walker 2. We have similarly that in the absence of a bias with M = d i=1 N i whenever the domain where the two walkers may meet is the entire available space.
In figure 2 we have tested the validity of equation (16) with equations (C.1) and (C.2) in approximating the transmission probability for the reflecting domain showing an excellent agreement in particular as ρ decreases. Irrespective of the spatial dimensions equation (16) is expected to be a good approximation when the defective sites fill the space in a symmetric fashion. In such symmetric situations the average contribution captures reasonably well the r-dependent weighting of s Ψ r (s, z) in equation (13).
The approximation is rather poor on the other hand when the defective sites are not filling out the space as exemplified by the predator-prey problem in figure 3. For that case the encounter locations are unequally distributed in the domains of each walker. Except when ρ is small, in figure C1 we see that equation (16) misses out on nearly all qualitative features of the exact MTT. The validity of the ν-formalism can be shown to get progressively worse (not displayed) as the space shared by the two walkers is gradually reduced.

Appendix D. Efficient evaluation of the transmission probability time dependence and the mean transmission time
Here we provide the details of the time inversion of the first-transmission probability generating function, T n 0 (ρ, z), and the evaluation of the MTT expression, T n 0 (ρ), as well as why other methods are less advantageous compared to the use of equations (12) and (17).

D.1. Numerical inversion of the generating function of the transmission probability
The time dependence of the first-transmission probability to either of the co-locating sites is obtained by inverting equation (12) via the counterclockwise contour in the complex z-plane through the following standard techniques [34,91]. With the substitution z = re iθ and a step of size π/t with a trapezoidal rule we have which has an error e r given by [91] e r r 2t 1 − r 2t .
For a given accuracy one requires the radius of integration to be r e r 1 − e r 1 2t .
For figure 2 we have chosen an accuracy of 10 −8 leading to r ≈ 10 − 8 2t . In order to keep a fixed accuracy for all t, one requires t + 1 evaluation of T n 0 (ρ, z), giving a time complexity that scales linearly with time. The same procedure can be applied for the individual splitting probability T ( j) n 0 (ρ, z). Considering for simplicity a square domain of length N for each walker in a space of d dimensions, and given the scaling cost of N 2d to compute the 2d nested sums in the propagator expressions in appendix B, and M co-location sites, the above numerical scheme to obtain T n 0 (ρ, t) with the same accuracy at all times would have a time complexity that scales as N 2d M 2 t. This scaling should be compared to the cost of solving iteratively the master equation in equation (1), which has a sparse tensor, extracting information at each time iteration from the M co-location sites and setting such values to zero before the next time steps. Such procedure, which was introduced in reference [92] for the analysis of first-passage processes to static targets, would have a time complexity that scales as c(d)N 4d Mt, where the constant c(d) depends on the dimension d of the walker and its movement statistics, e.g. for a nearest neighbour walker c(d) = (2d + 1) 2 , while for a next nearest-neighbour walker c(d) = 3 2d . As the case with the largest value of M occurs when M = N d , that is when the encounter locations are all the sites of the spatial domain shared by the two walkers, the computational advantage of the analytic expression is at least a factor (2d + 1) 2 c(d) 3 2d .
Note that using the above iteration/substitution procedure on the master equation to estimate the MTT would be far inferior to the analytic derivation via three determinants of the MTT in equation (17). The disadvantage is two-fold: first, the entire transmission probability would need to be computed, and second, an arbitrary stopping criterium to approximate the long time dependence of the transmission probability is necessary.
Another computational procedure that can be implemented to study transmission problems is stochastic simulations. In that respect, the advantage of our analytic approach is given by the impossibility to reduce in a systematic way the error in the simulation output as one increases the size of the ensemble. This limitation makes such procedure time prohibitive and does not allow a full exploration of the parameter space dependence.

D.2. Transmission probability
When the number of defective sites is sufficiently small, e.g. M 10 it is convenient to evaluate the elements of the matrices in equation (10) by using directly the propagators in (B.9) from the starting site n 0 to the defective sites and between the defective sites. However, for larger values of M it is more convenient to construct the propagators using a matrix formulation via eigenvalues and eigenvectors as follows. We rewrite equation (10) or (12) as where we redefine where L (c) 0 is a matrix whose columns are identical and are made up of the left eigenvector components corresponding with the initial condition of the two walkers. The resulting expression can be used to evaluate multiple values of z more efficiently by reusing the calculated Fourier components in the eigenvectors. The elements of the matrices R (c) , L (c) and K (c) are composed of the eigenvalues and eigenvector components of the one dimensional transition matrix given above equation (D.5). To define these elements explicitly we consider two independent multidimensional walkers. We let d 1 and d 2 be the number of dimension of two walkers, N = (N 1 1 , . . . , N 1 d 1 ) and N 2 = (N 2 1 , . . . , N 2 d 2 ) be the domain sizes, and n 1 = (n 1 1 , . . . , n 1 d 1 ) and n 2 = (n 2 1 , . . . , n 2 d 2 ) be the locations of the walkers. We define the scalar indices corresponding with the eigenvector component and eigenvalue of the combined dynamics of the two walkers, respectively, as With these indices we define R n 1 i ,k 1 i R n 2 ,k 2 , and, L (c) k,n = L k 1 i ,n 1 i L k 2 ,n 2 (D. 10) for the matrices of eigenvectors and for the matrix of eigenvalues, where R and L are matrix of eigenvectors of the one dimensional system. The matrices R (c) and L (c) are rectangular with size M × respectively, while K (c) is square matrix with d 2 =1 N 1 i N 2 rows and columns. The total number of sites where the walker can meet is given by |S| = M. Although the above construction is general, using the same L, R and K, for all dimensions implies that the dynamics along each dimension of both walkers are, that is, the diffusion parameter of the two walkers q 1 and q 2 are identical, they occupy domains of the same size, etc. If this were not the case, one would simply use different matrices for L, R and K, e.g. in their size and/or their elements when boundary conditions differ, to construct the composite elements.  figure 5, we calculate the matrices R and K numerically via eigendecomposition of the adjacency matrix while L is found by taking the inverse of R −1 . The composite analogues are then found using construction stated above with d 1 = d 2 = 1.

D.3. Mean transmission time
Efficient calculation of the MTT is accomplished by rewriting the matrices T 0 , T 1 and T in equation (17) using eigenvectors an eigenvalues in a similar fashion to that of the transmission probability outlined in appendix D.2, with the difference being that the steady-state eigenvector and eigenvalue are being excluded. In other words, one takes K (c) k,k , L (c) k,n and R (c) n,k with k > 1. With the definition we find where Y is a diagonal matrix with elements Y i,i = (1 − ρ m i )ρ −1 m i Q m i , υ = diag(W), a column vector constructed from the diagonal elements of W, and o is a column vector of ones.