Collective search with finite perception: transient dynamics and search efficiency

Motile organisms often use finite spatial perception of their surroundings to navigate and search their habitats. Yet standard models of search are usually based on purely local sensory information. To model how a finite perceptual horizon affects ecological search, we propose a framework for optimal navigation that combines concepts from random walks and optimal control theory. We show that, while local strategies are optimal on asymptotically long and short search times, finite perception yields faster convergence and increased search efficiency over transient time scales relevant in biological systems. The benefit of the finite horizon can be maintained by the searchers tuning their response sensitivity to the length scale of the stimulant in the environment, and is enhanced when the agents interact as a result of increased consensus within subpopulations. Our framework sheds light on the role of spatial perception and transients in search movement and collective sensing of the environment.


INTRODUCTION
Exploration, movement, and search for resources are ubiquitous among organisms in nature [1][2][3]. Classical theories of search [4], such as optimal foraging theory [5,6], have mostly focused on long time limits and typically assume that natural selection favours search strategies that maximise long-term encounters with nutrients. However, many phenomena in ecology [7] and other fields of biology operate in transient regimes [8,9], extending over time scales that never reach the asymptotic stationary state [10]. Another typical assumption is to consider random walks [11][12][13] or diffusion processes [14] to describe the movement of searchers navigating the landscape based on local information [15][16][17]. Yet, in many instances, searchers can obtain and store [18] non-local information gathered through visual cues [19,20] or through anticipation of environmental changes [21][22][23] (Fig. 1). The question then arises as to how such finite perceptual range can influence both the dynamics of movement and the search efficiency over the finite time scales relevant in biology.
Here we study the role of finite time scales associated with ecological movement and search; specifically, the effect of limited spatial perception when the search time is itself finite. To formalise these aspects, we propose an optimal navigation (ON) model, which allows us to extend the description of search as a biased random walk [11,14,24], and reinterpret it in the framework of optimal control theory. The ON model includes a time horizon that quantifies the perceptual range of the searchers along their trajectory and fixes a non-local optimisation target for the agents. In the limit of vanishing time horizon (i.e., as the spatial perception shrinks and the information becomes local), the ON model recovers the classic Keller-Segel (KS) drift-diffusion model [25] * a.gosztolai13@imperial.ac.uk † m.barahona@imperial.ac.uk perceptual range Figure 1. A searcher with a finite perceptual range navigating a heterogeneous landscape using a biased random walk search strategy. In contrast to standard local searchers, which navigate based only on point-wise information, our searcher can use non-local information within its perceptual range to optimise its movement and exploration.
of local search strategies (i.e, with instantaneous sensing and alignment to the point-wise gradient). Using simulations and analytical results, we find that a population of non-local searchers moving towards a nutrient patch exhibits distinct transient behaviour, clustering faster at the hotspot than local searchers, thereby increasing their search efficiency. Our results show that the maximum efficiency gain occurs when the perceptual range of the searchers matches the environmental length scale over which the nutrient concentration changes significantly. As the search time becomes asymptotically large or small, the efficiency gain from the non-local strategy diminishes, and the searchers behave effectively as local responders. If the environmental length scale changes, we show that the efficiency gain can be maintained as long as searchers can adjust their sensitivity. This means that finite perception remains advantageous to searchers that can rescale their response dynamically, or to populations that contain a diversity of responses. Finally, we consider the effect of interaction between searchers, and show that non-local information consistently reinforces the dominant strategy in the population and leads to improved search efficiency overall, even though multimodality (subpopulations) can appear during the transients. Our framework provides and optimisation perspective on a range of collective phenomena in population biology and, more generally, on biologically-inspired search and exploration algorithms, thus shedding light on the role of spatial perception on finite time search.

I. THE CLASSIC KELLER-SEGEL MODEL: NOISY SEARCH WITH LOCAL GRADIENT ALIGNMENT
A classic model for the dynamics of a population of searchers using local gradient alignment is given by the Keller-Segel equation. We recap here the standard formalism in non-dimensionalised form with x → x/L, t → t/T D as dimensionless variables, where T D is the diffusion time of the searchers (see Appendix A for a fuller derivation and details of the non-dimensionalisation).
Consider a population of searchers in a bounded spatial domain Ω, which we take to be one-dimensional for simplicity. As the searchers move, they are exposed to two concentration fields: a primary stimulant S 1 (x) (e.g. nutrient), and a secondary stimulant S 2 (x, t) (e.g. pheromone), which the searchers release and introduces interaction between them. On space and time scales much larger than the microscopic motion of the searchers, one can describe their biased random walk through the (non-dimensional) Langevin equation [24]: where v(x, t) is the velocity of the searcher given by: v(x, t) = ∇ (Pe 1 S 1 (x) + Pe 2 S 2 (x, t)) .
Here ξ(t) → √ T D ξ(t) is a dimensionless white noise process (see Appendix A), and the parameters Pe 1 and Pe 2 are Péclet numbers defining the ratio of diffusive to advective forces on the searchers. Hence, Eqs. (1)-(2) describe a searcher that uses local information, as it aligns its velocity instantaneously to the gradients of S 1 and S 2 with sensitivities Pe 1 and Pe 2 .
If the secondary stimulant S 2 diffuses faster than the searchers (see Appendix A), the time evolution of the population density ρ(x, t) of searchers obeying (1)- (2) can be described with a Fokker-Planck [26] known as the Keller-Segel model: where we have used Given an initial distribution ρ 0 (x) := ρ(x, 0), a stimulant profile S 1 (x), and parameters Pe 1 and Pe 2 , Eq. (3) can be solved numerically using standard techniques of finite volume schemes in case of no interaction between searches. Here, we use a first-order in time, second-order in space forward Euler scheme [27] with upwinding discretisation and ∆x = 0.01 and ∆t = 10 −6 . We denote the solution of the KS model by ρ KS (x, t).

Variational rewriting of the KS model
The KS model can be recast in a variational gradient formulation [28,29]. First, rearrange (3) as an advection equation: where u is the velocity of the population. Since the velocity of the searchers v is a gradient (2), u is also a gradient: All terms in (6) are either local or symmetric with respect to x; hence u can be written [28] as a first variation where the free energy functional includes (in order): an entropic term from the stochastic component of the dynamics (2); the internal energy of the stimulant landscape S 1 ; and a term from the interaction between searchers via the secondary stimulant S 2 . The KS model can then be rewritten in the equivalent gradient flow form which has the important implication that the evolution of ρ(x, t) can be computed using the Jordan-Kinderlehrer-Otto (JKO) variational optimisation scheme [29,30]. From an initial density ρ 0 (x), the JKO scheme constructs a sequence of probability distributions {ρ(x, k∆t)} k≥0 ρ(x, (k+1)∆t) = argmin where ∆t > 0 is the time step, and d 2 W (·, ·) is the Wasserstein distance between two distributions. The solution (10) has been proved to converge to the solution of Eq. (3) in the limit ∆t → 0 [30]. The variational rewriting (9) and its approximation scheme (10) leads us to formulate the optimal navigation (ON) search model, as follows. Consider a population of searchers that move by performing the optimisation (10) over a finite time horizon τ ≥ ∆t > 0, which reflects the perceptual range of the agents. Then the time evolution of the population corresponds to a sequence of constrained optimisation problems [31], i.e., a succession of JKO solutions, each over time τ .
Starting from the initial density ρ 0 (x), we construct the evolution of ρ(x, t), such that each iteration k ≥ 0 finds m(x, s) := ρ(x, kτ + s) for s ∈ [0, τ ] by solving the minimisation problem: subject to ∂ s m + ∇ · (mu) = 0. (11) Note that the constraint is the continuity equation ensuring the conservation of ρ as in (4), whereas the cost function J contains a transportation cost, which constrains the average motion to geodesics between optimal states, and an end-point term involving the evaluation of the free energy at τ (8). Although we use it here for a particular form of the free energy functional, the formulation is generic: through suitable choice of F, the ON model (11) converges to a broad class of conservation laws as long as they can be recast as continuity equations and possess a variational structure [28][29][30]32].
We denote the solution of the ON model (11) by ρ ON (x, t; τ ), and compute it using Algorithm 1, a gradient descent algorithm inspired by Ref. [33] and presented in detail in Appendix B.
Physically, the ON model (11) describes the motion of searchers that optimise their displacement over paths bounded by the time horizon τ . From the proof of the JKO scheme [30], it follows directly that the ON model recovers the local KS model as τ → 0: For finite horizon τ > 0, the time evolution of the ON model departs from the KS solution due to the effect of non-local information on the movement of the searchers, as explored below.

III. NON-LOCAL SEARCH: TRANSIENTS AND ENHANCED SEARCH EFFICIENCY
We use the ON model (11) to study how the finite perception of the agents (encapsulated in the time horizon τ > 0) affects the search at the population level. We first consider non-interacting searchers insensitive to the secreted stimulant, i.e., Pe 2 = 0. The case of interacting searchers is presented in Section V.
For concreteness, let us assume henceforth a static Gaussian concentration of stimulant: with characteristic length scale σ 1, which serves as a simple model of a localised stimulant patch over the domain Ω = [−1/2, 1/2]. (Fig. 2a).
Our numerics start with a uniform initial condition ρ 0 (x) = 1 and we compute ρ ON (x, t; τ ), the time evolution (11) of the ON population of non-local searchers with time horizon τ > 0. We also compare it to the time evolution (3) of a KS population of local searchers, or equivalently the ON model with τ = 0.
Both the KS and ON models converge to the same stationary solution ρ ∞ (x) asymptotically as t → ∞: for all τ , given by the Gibbs-Boltzmann distribution (14), where Z is a normalisation constant (Fig. 2a). This result is well known for the KS equation [26]. To see that ρ ∞ (x) is also the stationary solution of the ON model, note that at stationarity d W (ρ ∞ , ρ ) = 0 in (10); solving for the minimiser gives the result (15). The approach to stationarity, on the other hand, reveals differences between the KS and ON models. As the time horizon τ is increased, the population of ON searchers exhibits a faster approach to stationarity. To show this, Fig. 2b presents the normalised L 2 -distance between ρ ON (x, t; τ ) and ρ ∞ (x) as a function of time for different values of τ : For small values of τ , an intermediate, quasi-steady distribution develops during the transient (e.g, τ = 10 −5 in Fig. 2c). This intermediate is the result of the population evolving on two timescales [14]: searchers near the maximum of S 1 (x) (|x| σ) are driven by advection due to the steep gradient, whereas those far from the maximum (|x| σ) are driven by diffusion in shallow gradients, and hence move slower towards the maximum. Due to the slow diffusive searchers, the stationary state is only reached at a longer time scale t ∼ 1. As the horizon τ is increased, this dual behaviour (diffusion-  or advection-dominated) is lost: the searchers escape quickly the diffusion-dominated part of the domain and, as a result, the distribution approaches stationarity increasingly faster with no appreciable quasi-steady transient distribution (e.g, τ = 10 −3 in Fig. 2c).
Such transient states can be important in biological systems that operate over time scales far from the asymptotic long-time regime [7][8][9]. In our setting, this situation arises when the search time T (which is analogous to the foraging effort in ecology) is smaller than the diffusiondominated (KS) convergence time, i.e., when T 1. In such a situation, non-local (ON) searchers have an advantage over local (KS) searchers. To quantify this effect, consider the amount of stimulant S 1 encountered over the search time T and define the normalised search efficiency as where U (0, T ) is the uptake of the population of KS searchers. Therefore, U (τ, T ) > 1 signals a gain in search efficiency, that is, increased stimulant encountered by the population due to the perceptual horizon τ > 0. Our numerics show that, given a finite search time T , the search efficiency (17) reaches a maximum U * (τ * σ , T ) for searchers operating with a optimal horizon τ * σ , which depends on the length scale of the landscape (Fig. 3a).
The presence of a maximum follows from the asymptotic behaviour U (τ, T ) → 1 for τ → 0 and τ → ∞. The latter limit follows from the invariance of ρ ∞ (x) under τ , and the fact that the integral (17) is asymptotically dominated by the steady state.
The dependence of τ * σ with the length scale of the landscape σ, as obtained numerically from our simulations, is shown in Fig. 3b (solid circles). To understand this dependence, consider a searcher at x(t) obeying the Langevin equation (1) under the ON model. The reachable set until t + τ is within a ball of radius x ms (τ ): where the two terms represent the displacement due to diffusion and to an effective drift velocityv. To estimatē v, we assume that the search time T is large enough such that individual searchers have explored the whole domain (e.g., for T = 0.1 this is fulfilled when τ > 10 −3 as seen in Fig. 2b). The effective drift velocity can then be approximated by the velocity of an average searcher (over the domain) that maximises its gain up to time τ : v From (18) and (19), we obtain an estimate of the horizon τ necessary to search over a distance x ms with the ON model. The relevance of this estimate is shown in Fig. 3. For small σ, the maximum search efficiency is attained when the mean-squared displacement of the searchers equals the length scale of the environment: as obtained with our approximation. The ON model thus predicts that the most efficient searchers are those that tune their horizon such that they traverse the characteristic length scale of the environment within one optimisation step. Shorter or longer optimisations lead to a decreased search efficiency.

IV. INVARIANCE OF SEARCH EFFICIENCY THROUGH RESCALING OF RESPONSE SENSITIVITY
As shown in Fig. 3, the search efficiency of the ON model depends on the environmental length scale σ. Specifically, the ON efficiency gain diminishes as σ increases. However, as we now show, an ON searcher can retain the same search efficiency under a landscape with a different length scale by adjusting Pe 1 , the sensitivity to the stimulus.
To see this, consider an ON searcher starting at x 0 exposed to its nutrient micro-environment until time T . The effective gradient for this searcher, depending on the starting position x 0 , is: For a fixed exploration time T , an increase in the stimulant length scale σ leads to shallower effective gradients (Fig. 4a). Using asymptotic techniques, it can be shown (see SI) that the effective gradient (21) for Gaussian profiles has a well defined behaviour in two limiting regimes: Together with the form of the dynamics (1), this suggests the following scaling for the Péclet number: with 0 ≤ α(T ) ≤ 2.
To test this scaling, we obtain the ON solution (11) over a given T for Gaussian profiles with different σ using the renormalised Péclet number (23). We then compute the relative search efficiency (17) for this solution, U (τ, T ; Pe 1 (σ, T )). Our numerics in Fig. 4b show that the search efficiency curves for the renormalised parameter (23) for different σ all collapse on a single curve: The exponent α(T ) obtained numerically (Fig. 4c) is consistent with the expected asymptotic limits (22). Hence the search efficiency can be made invariant for different environmental length scales σ by rescaling the Péclet number (23). Alternatively, adjusting α(T ) can be viewed as responding to a 'renormalised landscape' [ Pe 1 S 1 (x)] in order to maintain the ON search efficiency. This is intuitive in limiting cases: when the search search time is small (T → 0), the efficiency remains unchanged on landscapes with similar local gradients near the centre (x 0 1); when the search time is large (T → ∞), the efficiency is invariant for landscapes with similar effective gradient over the whole domain (see inset of Fig. 4c).
This result suggests that searchers can optimise their search efficiency by adjusting their response sensitivity (as in the scaling (23)) so as to balance the relative effect of the advection and diffusion velocities or, in other words, the relative importance of gradient optimisation versus noisy exploration. Since the diffusion coefficient D is typically independent of S 1 (x) [34], the adjustment of Pe 1 could be achieved by varying the sensitivity as a function of the stimulant, i.e., χ 1 (S 1 (x)) (see Appendix A). In the Discussion, we explain possible biological mechanisms to achieve this effect.
Is non-local search advantageous over search times relevant for ecological systems? The invariant search efficiency U(τ, T ) characterises the performance of a searcher that is tuned to the intrinsic length scale of the stimulant landscape during its search time T . In Fig. 4d, we show the dependence of the maximum renormalised search efficiency (24) with the search time T . As expected, for short search time T → 0 and long search time T → ∞, the efficiency U * (T ) is equivalent to the local search strategy, i.e., U * (T ) → 1. However, between both extremes, searchers benefit from finite perception. Our numerics show that the optimal search time is T * = argmax U * (T, τ * ) ∼ 0.1 < 1 = T D . Hence finite perception is maximally advantageous for search times smaller than the diffusion time, a fact that is typical in ecological systems (see Discussion). each other through an attractive secondary stimulant S 2 (x, t) (i.e., Pe 2 > 0). The potential effect of interaction is contradictory: agent interaction may increase aggregation; however, aggregation might not increase search efficiency if agents move away from the stimulant source as the sensitivity S 2 becomes larger.
To explore these effects numerically, we use the ON model (11) with a weak interaction Pe 2 = β Pe 1 , β 1 (25) and compute the time evolution of the population for various β and τ . A summary of the results is presented in Fig. 5. In all cases, the presence of interaction reduces the tails of the population density and increases aggregation near the maximum of S 1 at the centre of the domain. This becomes more noticeable as the search time grows and we approach stationarity (Fig. 5a, right column). During early transients, however, agent interaction induces multimodality in the population (Fig. 5a, left and middle  column). This implies that some searchers move away from the maximum of the stimulant S 1 (x) and aggregate into transient subpopulations. This behaviour arises due to the non-linear response of the ON searchers to the gradient of S 1 (x): for steep gradients of S 1 (x), agents are dominantly driven by attraction to S 1 , whereas for shallow gradients of S 1 (x), the agents are driven by the interaction with the rest of the population through the secreted stimulant S 2 . In contrast, for non-interacting agents (β = 0) the distribution is always uni-modal (Fig.  5a). Correspondingly, Fig. 5b shows that the distribution is unimodal when both T and τ are large, in line with the expectation that increased spatial perception τ or search time T leads to overlapping information of the searchers about the environment. On the other hand, when τ and/or T are small, the searchers remain isolated within their local environment, thus leading to multimodality by local aggregation.
Despite the presence of multimodal transients, agent interaction β leads to overall improved search efficiency U * (τ * , T ) attained with a shorter time horizon τ * (Fig. 6). This behaviour is due to increased concentration around the centre (on average) and suggest that when resources are sparsely distributed, agent interaction in conjunction with a finite perceptual range, may play an important role in improving the collective sensing of the environment.

VI. DISCUSSION
In this work, we studied how finite spatial perception influences the dynamics and efficiency of collective random search by a population of agents. Using concepts from optimal control and random walks, we proposed a model that encapsulates the spatial information the searchers possess as a time horizon for an optimisation problem. Simulations of the dynamics of population search show that non-local information affects the movement strategy, as compared with the standard Keller-Segel model based on local optimisation. Although nonlocal search does not change the stationary state, it leads to qualitatively different transient responses, which are of relevance in biological systems [7]. For example, marine bacteria have been observed to aggregate at food patches much faster (∼ 10 1 − 10 2 s) [35,36] than the timescale to reach the steady state distribution (T D ∼ 10 4 − 10 5 s, based on D ∼ 10 2 − 10 3 µm 2 /s [37] and typical interpatch distance L ∼ 10 3 µm [38]). Similarly, in several rodent species diffusion coefficients of D ∼ 200 m 2 /day and home range of L ∼ 70 m have been reported [39]. Therefore, the time it takes to reach home by diffusion (∼ 25 days) is much longer than their typical response time (∼ 1 day). We find that non-local information increases the search efficiency under such transient search times: the maximum efficiency is reached when the meansquared displacement of the searchers matches the environmental length scale of the stimulant. When the time horizon vanishes or when the search time is infinite, our model recovers the response of local searchers. This is in accordance with the fact that when long-range cues are unreliable, local response leads to highest efficiency [15]. We also showed that the search efficiency can be made invariant to changes in environmental length scales by suitably scaling the response sensitivity. As a consequence, a searcher with a given perceptual range may always achieve its maximum efficiency by dynamically adjusting its sensitivity to the environmental stimuli. This can be achieved in two ways: at the agent level by dynamically rescaling the responses via adaptation [40]; at the population level, by the presence of a distribution of sensitivities among the agents. For example, it has been shown that phenotypic heterogeneity (or plasticity) across a population can be used to achieve maximum search efficiency in patchy environments [41].
Finally, we considered the effect of interaction between searchers with finite perception and showed that interaction can lead to unimodal or multimodal population distributions on transient timescales. Multimodality appears even in the presence of unimodal stimulant landscapes due to a trade-off between following the environmental gradient or the rest of the population. In our numerics, interaction always improved the overall search efficiency of the population.
Our work opens up several directions of research. Beyond our simple setup, it would be of interest to study search on temporally-fluctuating or patchy nutrient landscapes [42] using non-local strategies. Random search theory based on local response predicts that when a searcher is positioned equally far from two nutrient patches it is equally likely to explore either patch. However, on transient timescales, nonlocal searchers are expected to explore the patch with denser resources with higher probability. This direction will be the object of future work.

Appendix A: The Keller-Segel model and its nondimensionalisation
On space and time scales much larger than the microscopic motion of the agents, we describe the biased random walk of the searchers with a Langevin equation, and the time evolution of the population density, ρ(x, t), with an associated Fokker-Planck equation [26]: where D is the diffusion coefficient of the searchers, and χ 1 and χ 2 are the coefficients of sensitivity to the stimulants S 1 and S 2 , respectively. Typically, the parameters D, χ 1 and χ 2 are inferred experimentally from trajectories of the agents [14,43], and can sometimes be expressed in terms of microscopic parameters [34]. If the agents release the stimulant S 2 at a constant rate Γ (in units of mol/(agent t)) and S 2 diffuses with diffusion coefficient D 2 , we obtain the forced diffusion equation: To reduce the number of parameters, we nondimensionalise the equations. We use the length scale L (i.e., the extent of the domain) and time scale T D = L 2 /D (i.e., the diffusion time of the searchers) to definê x := x/Lt := t/T D .
Input ρ(x, kτ ), κ, δ Output m(x, s) := ρ(x, kτ + s), s ∈ [0, τ ], The ON model (11) is numerically solved as an implicit forward Euler scheme, where we obtain during each step the evolution m(x, s) = ρ(x, kτ + s) for the time window s ∈ [0, τ ] using a recently developed gradient descent algorithm [33]. We used this algorithm since it preserves a discrete analogue of the variational structure of the ON model and has the required property that the free energy (8) decays along the time evolution of m(x, s).
We first derive the optimality conditions of (11). The corresponding Lagrangian is [31]: L τ (m, u, φ) := J (u, m) allowing us to write (11) as a saddle node problem: where the infimum is taken over all the possible time evolutions of the population, i.e. pairs (m, u) satisfying ∂ s m+∇·(mu) = 0. Solving for the first-order optimality conditions of (B2), yields a variational mean-field game system [44,45]  Here = 10 −5 and ω = 10 −6 are small regularising factors to bound the logarithmic term and to guarantee the existence of finite solutions at all times [46,47].
In compact form this may be written as where I ∈ R M ×M is the identity matrix and B(u) ∈ R M ×M is the matrix associated with the upwind scheme. The corresponding scheme for (B3b) is given by Algorithm (1) may then be used with a given descent step κ to compute m(x, s) to the required tolerance level δ. Note that κ, ∆t and ∆x must be chosen so as to fulfil the CFL condition [48]: u i+1/2,j ∆t/∆x ≤ 1 for all staggered grid points (i + 1/2, j). Then the cost function J ∆t,∆x decreases at every iteration p.