Living systems often need to allocate limited resources to different tasks. For instance, this situation arises when a colony of microbes differentiates into different cell types, each specialized to a task that contributes to the growth of the colony as a whole1. Cells solve this allocation problem by regulating the splitting ratios between cell types during differentiation. Conceptually similar allocation problems arise on the molecular level, where enzymes need to be allocated to different targets. For instance, a limited number of ribosomes must produce different types of proteins in different ratios to achieve balanced cell growth2,3,4. Accordingly, cells dynamically control these ratios when their environment changes to support different growth rates5,6. Cells also control the spatial localization of enzymes to optimize or regulate metabolic fluxes7,8. These and many other biological examples share the basic characteristics of generic resource allocation problems, in which a given amount of a resource must be distributed among competing alternatives to maximize the expected performance of the system9.

The optimal allocation of limited resources has been extensively studied in economics. Rules such as Kelly’s criterion10 and returns-variance analysis11 are used to determine optimal betting strategies or optimal portfolios12. These criteria typically assume that the expected return on a bet only depends on its placement and not on the placement of other bets. Although there are biological systems for which such criteria can be directly applied13, the treatment needs to be generalized to describe systems, for which the performance depends in coupled, nonlinear ways on the amounts of the resource allocated to each task. Here we show that the problem of allocating enzymes to different spatial positions to optimize the total enzymatic reaction flux has a one-to-one mapping to an investment problem where investments and returns are interdependent. In this context, enzyme molecules represent capital that can be invested at different positions within the system. Each position corresponds to an asset generating a certain expected return in terms of reaction flux. However, the placement of enzymes affects the substrate profile, and thereby the flux return from other enzymes. Hence, the spatial enzyme allocation problem corresponds to a betting problem where the coupling between the returns and the bets is determined by the reaction–diffusion dynamics of the substrate.

We consider a class of reaction-transport models for systems with an arbitrary but fixed shape (Fig. 1). The systems could correspond to biosynthetic systems or to living cells. In the latter case, cell growth must be slow compared to the reaction and transport time scales, such that the coupled reaction-transport process reaches its steady-state before the cell shape changes appreciably. Indeed, the intrinsic time scale of enzymatic reactions is in the range of 1 μs to 1 min, with a median of 0.1 s14. The substrate diffusion time scale is in the range of 1 ms to 1 s for cells that are 1–10 μm in size. In contrast, rapidly growing cells have doubling times of at least 20 min in lab conditions, or 1 h in the wild15. As illustrated in Fig. 1, we assume that the substrate \({{{{{{{\mathcal{S}}}}}}}}\) enters the system from the exterior boundary or from interior compartments. Internal \({{{{{{{\mathcal{S}}}}}}}}\) is transported via diffusion and possibly also by advection, and \({{{{{{{\mathcal{S}}}}}}}}\) is lost within the system to competing reactions or at the boundaries due to leakage. The enzymes \({{{{{{{\mathcal{E}}}}}}}}\) can be freely arranged on the boundaries and within the system. Potential colocalization of \({{{{{{{\mathcal{E}}}}}}}}\) with other enzymes8,16,17,18,19,20 is incorporated in our model to the extent that the substrate influx at the boundaries may be caused by other, boundary-localized enzymes. We also consider multi-step reactions catalyzed by different enzymes as an extension of our model.

Fig. 1: Schematic representation of the class of models considered in this work.
figure 1

a An enzyme \({{{{{{{\mathcal{E}}}}}}}}\) converts a substrate \({{{{{{{\mathcal{S}}}}}}}}\) to product \({{{{{{{\mathcal{P}}}}}}}}\) with a catalytic rate kcat. The enzyme molecules can be freely placed, both within the system and on its interior or exterior membranes. b—Import: \({{{{{{{\mathcal{S}}}}}}}}\) is either imported from the exterior or produced within internal compartments. b—Transport: Within the system, \({{{{{{{\mathcal{S}}}}}}}}\) is transported diffusively, and possibly also advectively via a velocity field v(r), e.g., by active transport or cytoplasmic streaming. b—Loss: During transport, \({{{{{{{\mathcal{S}}}}}}}}\) can also be degraded with rate σ or leak out of the system via a membrane.

A previous numerical study of a minimal one-dimensional model (within the class of models of Fig. 1) observed a localization–delocalization transition in the optimal enzyme distribution as a function of a dimensionless reaction–diffusion parameter21: When reactions are slow compared to diffusion, localizing all \({{{{{{{\mathcal{E}}}}}}}}\) at the source boundary is optimal, while a more extended profile with some enzymes also in the interior is optimal for faster reactions. The existence of this transition was subsequently found to be robust with respect to the spatial dimension and specific loss mechanism and reaction kinetics22. However, the physical principles governing the optimal configurations and the generality of the transition have remained elusive, and a construction principle for optimal enzyme arrangements is lacking. Within the economics analogy, the localization–delocalization transition corresponds to a transition in investment strategy from investing everything on a single asset to having a diversified portfolio with multiple assets. Can we explain the generality of the transition by analogy with a diversification investment strategy? Moreover, just as Kelly’s criterion10 and returns-variance analysis11 provide a set of rules for the optimal partition of bets, can we derive a generalized criterion to construct optimal enzyme arrangements?

We address these open questions with a variational approach, which ultimately reveals the investment strategy underlying optimal enzyme arrangements. The practical significance of our theoretical analysis has three aspects. First, it produces a criterion to determine, for a given experimental situation, whether enzyme localization is optimal. Second, we turn this criterion into an additive construction scheme for optimal enzyme arrangements. Third, the conceptual framework underlying our analysis and the economic interpretation that it provides can be transferred to other biological or economical allocation problems.


Variational approach to the spatial enzyme allocation problem

We consider catalytic reactions where a substrate \({{{{{{{\mathcal{S}}}}}}}}\) is converted into a product \({{{{{{{\mathcal{P}}}}}}}}\) by an enzyme \({{{{{{{\mathcal{E}}}}}}}}\) (Fig. 1a). The substrate can enter the system from the exterior or from an internal compartment, e.g., an organelle (Fig. 1b—Import). Enzymes may be located both in the bulk of the system and at the boundaries where the substrate enters. The former fraction is described by the concentration field e(r), with r denoting positions inside the system, while eS(s) is the density of \({{{{{{{\mathcal{E}}}}}}}}\) on the boundary surface at position s. The concentration of \({{{{{{{\mathcal{S}}}}}}}}\) at time t is ρ(r, t). We consider the distribution of \({{{{{{{\mathcal{E}}}}}}}}\) as stationary and explore all possible spatial arrangements of the enzymes. The rate at which enzymes locally catalyze product formation depends on the substrate concentration ρ(r, t). We express this dependence in the general form kcateF[ρ], where kcat is the catalytic rate of the enzyme and F[ρ] is a monotonically-increasing reaction function that depends on the enzyme’s reaction mechanism, e.g., F[ρ] = ρ/(KM + ρ) for Michaelis–Menten kinetics and F[ρ] ρ for linear mass-action kinetics.

Within the system, the transport of substrate molecules (Fig. 1b—Transport) can be both stochastic, with a diffusion coefficient D, as well as directed, with a velocity field v(r), where the latter could be due to cytoplasmic streaming23 or cargo-carrying molecular motors24. If the substrate is intrinsically unstable25 or subject to competing reaction pathways18, it decays with rate constant σ (Fig. 1b—Loss). The dynamical interplay of these processes then follows

$${\partial }_{t}\rho ({{{{{{{\bf{r}}}}}}}},t)=D{\nabla }^{2}\rho ({{{{{{{\bf{r}}}}}}}},t)-\nabla \cdot \left[\rho ({{{{{{{\bf{r}}}}}}}},t){{{{{{{\bf{v}}}}}}}}({{{{{{{\bf{r}}}}}}}})\right]-\sigma \rho ({{{{{{{\bf{r}}}}}}}},t)-{k}_{{{{{{{{\rm{cat}}}}}}}}}e({{{{{{{\bf{r}}}}}}}})F[\rho ({{{{{{{\bf{r}}}}}}}},t)].$$

In the following, we focus on steady-state conditions, ∂tρ(r, t) = 0, where ρ(r, t) = ρ(r). We consider two types of boundaries for the system. First, boundaries at which substrate enters. Including reactions of substrate with enzymes that may be located at such a boundary, we have a boundary condition of the form

$$j({{{{{{{\bf{s}}}}}}}})=\left[D\frac{\partial \rho }{\partial {{{{{{{\bf{n}}}}}}}}({{{{{{{\bf{s}}}}}}}})}-\rho ({{{{{{{\bf{s}}}}}}}}){{{{{{{\bf{v}}}}}}}}({{{{{{{\bf{s}}}}}}}})\cdot \hat{{{{{{{{\bf{n}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\right]+{k}_{{{{{{{{\rm{cat}}}}}}}}}{e}_{S}({{{{{{{\bf{s}}}}}}}})F[\rho ({{{{{{{\bf{s}}}}}}}})],$$

where j(s) is the influx of \({{{{{{{\mathcal{S}}}}}}}}\) at position s, \(\hat{{{{{{{{\bf{n}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\) is a unit vector normal to the boundary, pointing outwards from the system, and \(\frac{\partial }{\partial {{{{{{{\bf{n}}}}}}}}({{{{{{{\bf{s}}}}}}}})}\) represents the magnitude of the normal component of the gradient. This condition enforces flux conservation at the boundary: the influx j(s) must equal the sum of the local transport and reaction flux. We allow for j(s) to be a discontinuous function of s as there could be regions on the boundary without influx, j(s) = 0 (see Supplementary Note 1 for details on how such discontinuities are treated). The second kind of boundaries we consider are boundaries at which substrate is lost (Fig. 1b—Loss), e.g., via leakage through a membrane26. For these, we impose absorbing boundary conditions, ρ(s) = 0. For convenience, we represent these boundary conditions as

$$0=k({{{{{{{\bf{s}}}}}}}})\left\{j({{{{{{{\bf{s}}}}}}}})-\left[D\frac{\partial \rho }{\partial {{{{{{{\bf{n}}}}}}}}({{{{{{{\bf{s}}}}}}}})}-\rho ({{{{{{{\bf{s}}}}}}}}){{{{{{{\bf{v}}}}}}}}({{{{{{{\bf{s}}}}}}}})\cdot \hat{{{{{{{{\bf{n}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\right]-{k}_{{{{{{{{\rm{cat}}}}}}}}}{e}_{S}({{{{{{{\bf{s}}}}}}}})F[\rho ({{{{{{{\bf{s}}}}}}}})]\right\}-h({{{{{{{\bf{s}}}}}}}})\rho ({{{{{{{\bf{s}}}}}}}}),$$

where k(s) and h(s) are set to represent absorbing boundaries (k = 0, h = 1) or boundaries with influx of substrate (k = 1, h = 0).

The interplay of processes of the type illustrated in Fig. 1 and described by Eqs. (1)–(3) have been demonstrated to generate stable gradients of intracellular components in a variety of biological contexts27,28,29,30. An immediate consequence of non-uniform substrate profiles is that different spatial enzyme distributions e(r) generate different total reaction fluxes. In cases where the substrate is produced inside organelles, e.g., mitochondria or endoplasmatic reticula, the associated enzymes tend to be concentrated in proximity of the organelle membrane but also present in the cytoplasm31,32,33,34. In contrast, when the substrate is imported into the cytoplasm from the external environment, some of the associated metabolic enzymes are localized to the external membrane35.

The total reaction flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\), i.e., the rate at which the whole system produces \({{{{{{{\mathcal{P}}}}}}}}\), has contributions from enzymes at the boundaries and within the bulk,

$${J}^{{{{{{{{\mathcal{P}}}}}}}}}={\int}_{S}{k}_{{{{{{{{\rm{cat}}}}}}}}}{e}_{S}({{{{{{{\bf{s}}}}}}}})F[\rho ({{{{{{{\bf{s}}}}}}}})]{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{s}}}}}}}}+{\int}_{V}{k}_{{{{{{{{\rm{cat}}}}}}}}}e({{{{{{{\bf{r}}}}}}}})F[\rho ({{{{{{{\bf{r}}}}}}}})]{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{r}}}}}}}},$$

where the first integral is over all boundary surfaces S and the second is over the volume V of the system. Given a fixed amount of available enzymes, ET = ∫SeS(s)ds + ∫Ve(r)dr, how should these enzymes be positioned such as to maximize the rate \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) of product formation?

This optimization problem can be approached by defining a functional of the form \({{{{{{{\mathcal{L}}}}}}}}={J}^{{{{{{{{\mathcal{P}}}}}}}}}-{\sum }_{i}{\lambda }_{i}{C}_{i}\), where Ci represent different constraints with associated Lagrange multipliers λi. For our model, these constraints are that (i) the total amount of enzymes must equal ET, (ii) ρ(r) and e(r) must jointly satisfy the reaction-diffusion-advection equation, Eq. (1), at each point r, and (iii) ρ(s) and eS(s) must jointly satisfy the boundary condition, Eq. (3), at each boundary point s. The resulting Lagrangian has the form

$${{{{{{{\mathcal{L}}}}}}}} = {J}^{{{{{{{{\mathcal{P}}}}}}}}}-{\lambda }_{e}\left[{\int}_{S}{e}_{S}({{{{{{{\bf{s}}}}}}}}){{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{s}}}}}}}}+{\int}_{V}e({{{{{{{\bf{r}}}}}}}}){{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{r}}}}}}}}-{E}_{{{{{{{{\rm{T}}}}}}}}}\right]\\ +{\int}_{V}{\lambda }_{V}({{{{{{{\bf{r}}}}}}}}){{{{{{{\mathcal{D}}}}}}}}\left[e({{{{{{{\bf{r}}}}}}}}),\rho ({{{{{{{\bf{r}}}}}}}}),{{{{{{{\bf{r}}}}}}}}\right]{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{r}}}}}}}}+{\int}_{S}{\lambda }_{S}({{{{{{{\bf{s}}}}}}}}){{{{{{{\mathcal{B}}}}}}}}\left[\rho ({{{{{{{\bf{s}}}}}}}}),{e}_{S}({{{{{{{\bf{s}}}}}}}}),{{{{{{{\bf{s}}}}}}}}\right]{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{s}}}}}}}},$$

where \({{{{{{{\mathcal{D}}}}}}}}\left[e({{{{{{{\bf{r}}}}}}}}),\rho ({{{{{{{\bf{r}}}}}}}}),{{{{{{{\bf{r}}}}}}}}\right]\) and \({{{{{{{\mathcal{B}}}}}}}}\left[\rho ({{{{{{{\bf{s}}}}}}}}),{e}_{S}({{{{{{{\bf{s}}}}}}}}),{{{{{{{\bf{s}}}}}}}}\right]\) represent the right-hand side of Eqs. (1) and (3) respectively, and the signs in front of the Lagrange multipliers have been chosen such that they result to be positive. Maximizing \({{{{{{{\mathcal{L}}}}}}}}\) with respect to eS(s) and e(r) while simultaneously minimizing with respect to all Lagrange multipliers yields the optimal enzyme arrangements satisfying the constraints.

The optimal enzyme arrangement may consist of regions with a finite density of enzymes next to regions with no enzymes, as seen in previous numerical studies18,21,22. To allow for such discontinuities, we split the volume V into different sub-spaces (and similarly for the boundaries S); within each sub-space the enzyme density must be continuous and e(r) ≥ 0, but at the interfaces continuity is not required. The number of sub-spaces as well as the shape of the interface between each pair of sub-spaces are then also variables to be optimized (see Supplementary Note 1 for details and Supplementary Note 2, 5, 6 for examples). This is equivalent to applying the Karush–Kuhn–Tucker conditions36,37 on the Lagrangian, Eq. (5), while imposing e(r) ≥ 0.

We will see below that the variational approach is useful even when it is impossible to solve for the optimal enzyme arrangement analytically. In cases where it is possible to extract the exact functional form of the optimal profile, the problem can usually be reduced to a low-dimensional optimization over a small number of parameters, which is then easily performed numerically (see Supplementary Note 5 for an example). For systems where the functional form of e(r) cannot be found analytically, such as those with complex geometries, we will describe a scheme for constructing the optimal enzyme arrangement.

Enzyme allocation problem as a betting game

The spatial enzyme allocation problem defined above can be mapped to a betting game. We consider a game that has a single winning outcome out of a set of mutually exclusive events. Each outcome i has a certain probability pi of being the winning event. We assume that a gambler bets a total amount B = ∑ibi with bi ≥ 0 denoting the bet on outcome i. If i is the winning event, the gambler wins the amount αibi, with αi ≥ 1 referred to as the odds of event i. The expected amount of capital won by the gambler is thus C = ∑iαibipi. If the expected odds αipi are independent of the bets bi, the optimization problem is linear with respect to the bets and the optimal strategy for a given total budget B is to invest everything in the outcome with highest expected odds. However, if the expected odds are coupled to the bets, the optimization of C subject to the budget constraint becomes nontrivial, and diversification of bets may be the optimal strategy.

By comparing the objective function C of the betting game to the reaction flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) of our spatial enzyme allocation problem, we see that the set of events {i} maps to the set of possible enzyme positions, a bet bi corresponds to the enzyme concentration e(r) allocated to r, and the fixed budget B corresponds to the total enzyme amount ET. Moreover, the probability pi of i being the winning event is replaced by the reaction function F[ρ(r)] for enzymes at position r, and the odds αi correspond to the catalytic rate kcat. Note that the reaction function is directly determined by the substrate concentration ρ(r), e.g., F[ρ(r)] = ρ(r)/KM in the linear regime of a Michaelis–Menten kinetics.

In the enzyme system, part of the substrate is lost via the loss mechanisms of Fig. 1b, which can be included in the betting game via events with finite probability but zero odds (pi > 0, αi = 0). However, the objective function C = ∑iαibipi needs to be generalized to account for the nonlinearity and spatial coupling in the enzyme system: The “expected odds” kcatF[ρ(r)] depend on the “bets” e(r), since the binding between enzymes and substrate at a given location generates a diminishing returns effect, i.e., the addition of extra enzymes at that position becomes gradually less efficient. Moreover, the substrate concentrations at different positions are coupled, due to the substrate diffusion (and possibly advection), such that the substrate concentration at one position ultimately depends on the enzymes at every position. This means that the bets placed on one event i also affect the winning probabilities pj with j ≠ i. These effects are captured by making the probabilities pi a function of the vector of bets pi = fi(b) and adding the feedback from the bets onto the winning probabilities via constraints in the objective function,

$${{{{{{{\mathcal{C}}}}}}}}=\mathop{\sum}\limits_{i}{\alpha }_{i}{b}_{i}{p}_{i}-\mathop{\sum}\limits_{i}{\lambda }_{i}[{f}_{i}({{{{{{{\bf{b}}}}}}}})-{p}_{i}]-\lambda \left(\mathop{\sum}\limits_{i}{b}_{i}-B\right),$$

where λi are the Lagrange multipliers for the feedback constraint, analogous to λ(r) in the Lagrangian \({{{{{{{\mathcal{L}}}}}}}}\) of the enzyme system, Eq. (5). The behavior of this generalized betting game depends on the form of fi(b). In Supplementary Note 8.1, we show for example that in a simple game with two possible winning outcomes, a diminishing returns effect (∂fi/∂bi < 0) can result in an optimal strategy with diversified bets (b1, b2 > 0).

The above mapping illustrates that in order to solve our optimal enzyme allocation problem, we need to generalize the treatment of betting games to include the coupling between bets and expected gains. Note that we considered only a single round of the betting game so far. Classical treatments of betting games, e.g., the one by Kelly10, often assume that the gambler iteratively reinvests a certain fraction of the current capital, such that the long-term capital growth rate must be optimized rather than C. In the enzyme context, this would correspond to a situation where the product of the enzymatic reaction is used to generate additional enzymes to be placed in the system, similar to ribosomes generating more ribosomes in growing cells. Here, we first treat the stationary enzyme allocation problem, corresponding to a repetitive game in which the gambler bets the same total amount B in every round, such that the optimal strategy is the same as the optimal strategy for a single round. We will later see that our scheme to construct optimal strategies can also be adapted to the case where a constant fraction of the capital is iteratively reinvested (see below and Supplementary Note 8.2).

Optimal allocation principle

We now leverage the above variational approach to solve the enzyme allocation problem. Towards this end, we examine the variation of the Lagrangian, Eq. (5), with respect to the enzyme density,

$$\frac{\delta {{\mathcal{L}}}}{\delta e({{\bf{r}}})}=\underbrace{k_{{{\rm{cat}}}}F[\rho ({{\bf{r}}})]-\lambda_{V}({{\bf{r}}})k_{{{\rm{cat}}}}F[\rho({{\bf{r}}})]}_{\begin{array}{c}\!\!\!\!\!\!\!\equiv {\frac{d{J}^{{{\mathcal{P}}}}}{de({{\bf{r}}})}}{}^{{``} }{{{{{\mbox{marginal return}}}}}}^{_{{\hbox{''}}}}\end{array}}-{\lambda }_{e}.$$

This variation corresponds to the change in the constrained flux \({{{{{{{\mathcal{L}}}}}}}}\) as enzymes are added at position r. Three different terms contribute to this change. The first is the increase in flux that would be observed upon adding enzymes at position r if everything else in the system were to remain unaffected, which corresponds mathematically to \(\frac{\delta {J}^{{{{{{{{\mathcal{P}}}}}}}}}}{\delta e({{{{{{{\bf{r}}}}}}}})}\). However, changing e(r) also alters the substrate density profile ρ(r), thereby affecting the rate of reactions at all positions. This coupling is captured by the second term in Eq. (7), where the Lagrange multiplier λV(r) ensures that ρ(r) and e(r) satisfy the constraint of the reaction-diffusion equation. Thus the sum of the first two terms is the total rate of change of the reaction flux as extra enzymes are added at position r. In the following, we refer to this quantity as the “marginal return” on an investment of enzymes, and denote it by \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}\). Finally, the third term, \(-{\lambda }_{e}=-\frac{\partial {{{{{{{\mathcal{L}}}}}}}}}{\partial {E}_{{{{{{{{\rm{T}}}}}}}}}}\), corresponds to a marginal cost of adding extra enzymes into the system. This marginal cost can be interpreted as the reduction in flux from other positions \({{{{{{{\bf{r}}}}}}}}^{\prime}\, \ne \,{{{{{{{\bf{r}}}}}}}}\) in the optimal configuration, as enzymes are moved from these positions to r in order to satisfy the constraint of constant total enzyme number.

In the optimal enzyme profile e*(r), we must distinguish between regions where placing enzymes is optimal (e*(r) finite), and regions where placing enzymes is suboptimal, such that they remain empty (e*(r) = 0). Wherever e*(r) > 0, the variation \(\frac{\delta {{{{{{{\mathcal{L}}}}}}}}}{\delta e({{{{{{{\bf{r}}}}}}}})}{\left\vert \right.}_{{e}^{* }}=0\). The functional derivative with respect to the surface density \(\frac{\delta {{{{{{{\mathcal{L}}}}}}}}}{\delta {e}_{S}({{{{{{{\bf{s}}}}}}}})}\) has the same form as Eq. (7). Thus the optimal profile follows a ‘homogeneous marginal returns’ criterion (HMR criterion): it is such that at any position with enzymes, the marginal return on placed enzymes equals a constant value, namely \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}{\left\vert \right.}_{{e}^{* }}={\lambda }_{e}\). By contrast, in empty regions, the marginal flux gain from placing enzymes is less than the associated marginal cost, \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}{\left\vert \right.}_{{e}^{* }} \, < \,{\lambda }_{e}\). The optimality of the enzyme profile determined by the HMR criterion is guaranteed by the convexity of the optimization problem, which is a consequence of the diminishing returns effect due to the depletion of substrate by enzymes (see subsection “Geometrical interpretation and analogy to portfolio selection” below).

To illustrate this optimal allocation principle, we apply the HMR criterion to the simple case of a linear reaction (F[ρ] = ρ/KM) with no advection or decay (\(\left\vert {{{{{{{\bf{v}}}}}}}}\right\vert =\sigma =0\)) in a one-dimensional domain of size L, with a source of substrate at the left boundary (x = 0) and an absorbing boundary on the right (Fig. 2a). This case is exactly solvable within the variational approach (see Supplementary Notes 2 and 3), such that we can explicitly see how variations of the enzyme profile affect the marginal returns landscape. Moreover, this case allows us to cross-validate our variational approach with a previous numerical study21. As shown in Supplementary Note 2, the optimal enzyme profile for this example is

$${e}_{S}^{* }(0)=\left\{\begin{array}{l}{E}_{{{{{{{{\rm{T}}}}}}}}}\quad \\ \sqrt{{E}_{{{{{{{{\rm{T}}}}}}}}}/\alpha }\quad \end{array}\right.{{{{{{{\rm{and}}}}}}}}\quad {e}^{* }(x)=\left\{\begin{array}{l}0 \hfill \\ \frac{{E}_{{{{{{{{\rm{T}}}}}}}}}}{L}\Theta \left(\frac{{x}_{0}-x}{L}\right)\quad \end{array}\right.{{{{{{{\rm{for}}}}}}}}\quad \begin{array}{l}\alpha {E}_{{{{{{{{\rm{T}}}}}}}}}\le 1\\ \alpha {E}_{{{{{{{{\rm{T}}}}}}}}}\, > \,1\end{array},$$

with α = Lkcat/(KMD), the Heaviside step function Θ(x), and \({x}_{0}=L\left[1-{(\alpha {E}_{{{{{{{{\rm{T}}}}}}}}})}^{-1/2}\right]\). Eq. (8) shows that the optimal enzyme profile undergoes a localization-delocalization transition from having all enzymes localized at the source, to an extended profile with enzymes also in the interior of the system (Fig. 2b, orange lines). The transition occurs as a function of the dimensionless parameter αET, with αET = 1 marking the transition point.

Fig. 2: Homogeneous Marginal Returns (HMR) criterion for the optimal spatial allocation of enzymes.
figure 2

a Illustration of the analytically solvable 1D model with a source of substrate at x = 0 and an absorbing boundary at x = L. Within the system, the substrate diffuses and can react with the spatially arranged enzymes. b Optimal enzyme profile with corresponding marginal return landscape at different total enzyme amounts ET (the reaction-diffusion parameter is fixed to α = 10−2). ce Different enzyme and substrate profiles (left) with corresponding marginal returns (right) for ET = 400. c Localized configuration. The marginal returns landscape is peaked at x > 0, indicating that enzymes should be moved away from the source. d Optimal profile with constant marginal return over the region with enzymes (HMR criterion). In the constant region, the marginal return is equal to the marginal cost λe of adding extra enzymes into the system. e Overextended profile. Monotonically decreasing marginal return, indicating that enzymes should be moved towards the source at x = 0.

The analytic solution demonstrates how the optimal enzyme profile arises from a balance between gain and cost. The shape of the marginal returns landscape (Fig. 2b, green lines) changes as the total enzyme amount ET is increased. Below the transition, the marginal returns \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de(x)}\) strictly decrease with distance from the source, i.e., the maximal value occurs only at x = 0, whereas above the transition the marginal returns take on a constant value over the region 0 ≤ x ≤ x0 where enzymes are present and decreases only for x > x0. The level of this marginal returns plateau corresponds to the marginal cost λe of adding extra enzymes into the system (Fig. 2d). This marginal cost decreases with increasing availability of enzymes (increasing ET). Figure 2c, e shows how the shape of the marginal returns landscape changes when the enzyme profile deviates from the optimum. If it deviates by having a larger proportion of enzymes located at the source (Fig. 2c), the marginal returns landscape becomes non-monotonic with a peak at a position x > 0. The elevated enzyme density in this region depletes the substrate locally, reducing the turnover by each enzyme and diminishing the returns from adding additional enzymes. The peak in the marginal returns landscape implies that a higher flux can be achieved by moving some enzymes away from the source. In contrast, if the enzyme profile is overextended (Fig. 2e), the marginal returns landscape has a maximum at the source, such that the flux can be increased by moving enzymes towards the source.

Note that for the 1D problem analyzed in Fig. 2, the single source at x = 0 is the position with the highest substrate concentration for any value of the product αET, independently of the enzyme arrangement (see purple lines in Fig. 2c–e). Hence an individual enzyme would always optimize its own productivity at x = 0. However, for αET > 1, the total productivity of the population of enzymes is optimized only when some enzymes are located at positions x > 0 with non-maximal substrate concentrations. The optimal profile is thus the result of a bet-hedging strategy: Some productivity of individual enzymes is sacrificed to optimize the reaction flux produced by the entire population of enzymes. How relevant is the transition for biological systems? Given that the ratio kcat/KM varies by orders of magnitude, 102–109 M−1 s−114 and assuming a cross-section of 1 μm2 for our 1D system, the corresponding α = Lkcat/(KMD) with L = 1 μm, D = 102–103 μm2 s−1 is in the range from 10−10 to 10−2, such that the transition can occur for enzyme numbers \({E}_{{{{{{{{\rm{T}}}}}}}}}^{{{{{{{{\rm{t}}}}}}}}}\) in the range 102–1010. For comparison, the range of protein copy numbers in a yeast cell is 1–10638, suggesting that different enzymatic systems cover both sides of the transition.

General condition for transitions in the optimal enzyme arrangement

Transitions in the optimal enzyme arrangement of the above type, from a regime in which enzymes are colocalized with the source of \({{{{{{{\mathcal{S}}}}}}}}\) to a regime where enzymes are distributed within the system, have been observed in a range of reaction-diffusion models22. We therefore asked whether there was an underlying principle determining when such transitions occur, and whether it can be generalized, e.g., to systems with more complex geometries. Figure 2 suggests that the marginal returns landscape leads to a general condition for localization-delocalization transitions. For ET below the transition value, the landscape is strictly decreasing, with the position generating the highest returns coinciding with the source of substrate. As the transition is reached and passed, the landscape becomes flat as positions in the vicinity of the source begin to generate the same returns as the source position. This behavior generalizes to higher dimensional systems (see Supplementary Note 4): Enzymes should be placed only at the source on the surface and not in the interior, as long as

$$\frac{\partial }{\partial {{{{{{{\bf{n}}}}}}}}({{{{{{{\bf{s}}}}}}}})}\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de} > \,0,$$

corresponding to a negative slope of the marginal returns landscape from the source at s into the interior of the system, as in Fig. 2b for ET < α−1. By contrast, if Eq. (9) evaluated at s becomes an equality, the positions adjacent to s generate the same returns as s, so that the optimal enzyme profile features enzymes both at the boundary s and in the interior of the system adjacent to s.

The abstract mathematical condition Eq. (9) can be turned into an experimentally meaningful condition (see Supplementary Note 4) by expressing it as a comparison between the local net diffusive flux jD(s) of \({{{{{{{\mathcal{S}}}}}}}}\) away from the surface, and the local flux \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\) of product formation due to surface enzymes,

$${j}^{D}({{{{{{{\bf{s}}}}}}}})\equiv D\frac{\partial \rho }{\partial {{{{{{{\bf{n}}}}}}}}({{{{{{{\bf{s}}}}}}}})} > \,{k}_{{{{{{{{\rm{cat}}}}}}}}}{e}_{S}({{{{{{{\bf{s}}}}}}}})F[\rho ({{{{{{{\bf{s}}}}}}}})]\equiv {j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}}).$$

If this inequality holds, no enzymes should be placed in the interior of the system in the vicinity of s. For low amounts of enzymes, the optimal strategy is to place enzymes at position s to counter the diffusive flux jD(s). This is optimal up to the point at which the diffusive flux jD(s) equals the reaction flux \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\), which defines the transition point of the localization–delocalization transition.

Further combining Eq. (10) with the boundary condition Eq. (2) yields \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\, < \,(j({{{{{{{\bf{s}}}}}}}})-\rho ({{{{{{{\bf{s}}}}}}}}){{{{{{{\bf{v}}}}}}}}({{{{{{{\bf{s}}}}}}}})\cdot \hat{n}({{{{{{{\bf{s}}}}}}}}))/2\), which simplifies in the case of no advection (v = 0) to \({j}^{{{{{{{{\mathcal{P}}}}}}}}}\, < \,j({{{{{{{\bf{s}}}}}}}})/2\). Thus, in systems with purely diffusive \({{{{{{{\mathcal{S}}}}}}}}\) transport, a localization–delocalization transition occurs when the reaction flux equals exactly half the influx of \({{{{{{{\mathcal{S}}}}}}}}\). Note that Eq. (10) is general, independent of v and σ and other details of the system in question. It is required only that the boundary with influx follows Eq. (2). Other aspects of the model will affect ρ(r), but not the form of Eq. (10), showing that the diffusive motion of \({{{{{{{\mathcal{S}}}}}}}}\) and the strength of the reaction are the crucial determinants of the transition point. To illustrate this generality, we compared the fluxes jD(s) and \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\) as ET was varied, in systems with different spatial dimensions as well as systems with and without decay and advection of \({{{{{{{\mathcal{S}}}}}}}}\). As shown in Fig. 3, in all cases both Eq. (10) below the transition value of ET and equality above the transition were satisfied.

Fig. 3: Test of the general condition for transitions in the optimal enzyme arrangement.
figure 3

The local reaction flux, \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\), and net diffusive flux, jD(s), as a fraction of \({{{{{{{\mathcal{S}}}}}}}}\) influx, j(s), are plotted for different models against the amount of enzymes in the system, ET, rescaled by the transition amount, \({E}_{{{{{{{{\rm{T}}}}}}}}}^{{{{{{{{\rm{t}}}}}}}}}\). In all cases, \({j}^{D} > {j}^{{{{{{{{\mathcal{P}}}}}}}}}\) until they coincide at the transition point, as predicted by Eq. (10). When v = 0, \({j}^{{{{{{{{\mathcal{P}}}}}}}}}={j}^{D}=j/2\) at and above the transition. Lines show analytical solutions of the constrained optimization, while points represent numerical optimizations. For the two-source model, the two curves show the two unequal sources, each rescaled with the corresponding \({E}_{{{{{{{{\rm{T}}}}}}}}}^{{{{{{{{\rm{t}}}}}}}}}\) value; see Supplementary Note 6 and Fig. S1 for a detailed analysis of this model. The data plotted in the figure are provided as Supplementary Data 1.

The inequality condition Eq. (10) is a strictly local condition. In systems with multiple or spatially varying sources of substrate there will in general not be a single global transition but rather a sequence of local transitions at different positions s at different ET levels. We therefore investigated a system with two unequal sources of \({{{{{{{\mathcal{S}}}}}}}}\) (see Supplementary Note 6). In such a system the optimal enzyme profile typically undergoes three transitions (see Fig. S1). For small ET, enzymes accumulate where the influx of \({{{{{{{\mathcal{S}}}}}}}}\) is the highest. As ET is increased, the marginal returns for placing enzymes in the vicinity of the two sources of \({{{{{{{\mathcal{S}}}}}}}}\) become more similar, until at a threshold value of ET they become equal. Above this value of ET, enzymes accumulate at both sources in a configuration with two unequal clusters. Increasing ET further, a second transition is reached where the optimal enzyme profile begins to extend from the stronger source into the system. Finally, at yet larger ET, the optimal enzyme profile begins to extend also from the weaker source. For the latter two transitions, at which the optimal enzyme arrangement changes from membrane-localized to extended, we confirmed that the inequality Eq. (10) held below the transition point and equality above (Fig. 3 green and blue).

Geometrical interpretation and analogy to portfolio selection

Our optimal enzyme allocation problem has a geometrical interpretation in the space of (discretized) enzyme configurations e. A component ei of the vector e corresponds to the amount of enzymes allocated to position i, and the dimension of e to the number of possible enzyme positions. Hence, the subspace with constant total enzyme amount ET is the hyperplane intersecting each axis at ei = ET. Each point in the enzyme configuration space has an associated flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\), and the allocation problem amounts to finding the point of maximal flux within the hyperplane.

Figure 4 illustrates the geometrical problem for the simplest case with only two possible enzyme positions (here, we assume a substrate source at position one, and loss of substrate via one of the loss mechanisms of Fig. 1b). In Fig. 4, ET hyperplanes are indicated by dashed black lines, while the dashed green curves are lines of constant flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\). Since the marginal returns vector \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\) is the flux gradient, the lines of constant flux must be locally perpendicular to it. Adding extra enzymes at any location with nonzero substrate concentration will increase the total reaction flux, implying that the direction of the marginal returns vector always lies in the first quadrant (all components positive). Furthermore, the direction must turn clockwise as we move along a line of constant flux in the direction of increasing e2, since the second component of the marginal returns vector must decrease as we allocate a larger fraction of enzymes to position two, while the first component must increase due to the diminishing returns effect caused by substrate depletion. Hence, the lines of constant flux are convex.

Fig. 4: Geometrical analysis of the optimal enzyme configuration in a system with two sites.
figure 4

Dashed black lines show lines of constant ET = e1 + e2, while dashed green lines show lines of constant reaction flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\). The optimal configuration \({{{{{{{{\bf{e}}}}}}}}}^{* }=({e}_{1}^{* },{e}_{2}^{* })\) for each value of ET forms an optimal trajectory e*(ET) (orange). Green arrows show the marginal returns vector \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\). The tangent vector \(\frac{d{{{{{{{{\bf{e}}}}}}}}}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) (blue arrows) shows how added enzymes should be optimally partitioned between the two sites.

Geometrically, the solution of the optimal allocation problem corresponds to the touching point e* between a given ET line and the \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) line with the largest \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) value that still touches the ET line. At small ET values, the \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) line is steeper than the ET line, such that e*(ET) lies on the e1 axis (orange line in Fig. 4). However, at a certain threshold value of ET, the ET line becomes tangential to the \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) line. At this point, the marginal returns from position 1 and 2 become equal, i.e., the marginal returns vector points in the (1, 1) direction. When ET is further increased, the optimal path e*(ET) departs from the e1 axis and follows the tangent point between the ET and \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) lines, maintaining equal marginal returns. Note that, due to the convexity of the lines of constant \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\), this tangent point is the global optimum at a given ET value.

The above geometrical interpretation is somewhat analogous to Markowitz’ geometrical analysis of investment portfolio optimization11. Markowitz considered the problem of minimizing the variance of a portfolio of investments at a constant level of returns (returns-variance analysis). The space of portfolios, which is determined by the relative amounts invested in different securities, is analogous to the space of enzyme configurations e. Markovitz noted that optimal portfolios are tangent points between lines of constant expected returns and lines of constant variance. One key difference to our case is that the returns are independent of the portfolio choice in Markovitz’ case, leading to simple straight lines of constant returns in the space of portfolios. Another key difference is that the variance of the returns has played no role in our analysis so far, since we considered enzymes in a steady-state environment. If, instead, we would consider a fluctuating environment in which, for instance, the substrate source is only available for a finite time T, then the variation of the flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}(t)\) would become relevant. The total amount of product formed during this time, \({{{{{{{{\mathcal{P}}}}}}}}}_{T}\), would be

$${{{{{{{{\mathcal{P}}}}}}}}}_{T}=\int\nolimits_{0}^{T}{J}^{{{{{{{{\mathcal{P}}}}}}}}}(t){{{{{{{\rm{d}}}}}}}}t= \langle {J}^{{{{{{{{\mathcal{P}}}}}}}}} \rangle T+\int\nolimits_{0}^{T}\delta {J}^{{{{{{{{\mathcal{P}}}}}}}}}(t){{{{{{{\rm{d}}}}}}}}t,$$

where \(\delta {J}^{{{{{{{{\mathcal{P}}}}}}}}}(t)={J}^{{{{{{{{\mathcal{P}}}}}}}}}(t)- \langle {J}^{{{{{{{{\mathcal{P}}}}}}}}} \rangle\) is the time-dependent fluctuation of the flux around its mean value \(\langle {J}^{{{{{{{{\mathcal{P}}}}}}}}} \rangle\), caused by the stochasticity of the enzymatic reaction and substrate diffusion. The integral over \(\delta {J}^{{{{{{{{\mathcal{P}}}}}}}}}(t)\) scales as \(\sqrt{T}\), due to the central limit theorem, such that its contribution to \({{{{{{{{\mathcal{P}}}}}}}}}_{T}\) becomes negligible in the long time limit. However, for times T comparable to the intrinsic time-scales of the system (associated with the processes of diffusion, reaction, and decay), the contribution of the fluctuations could become sizeable. In such scenarios, a generalization of Markovitz’ returns-variance analysis would be more appropriate than an optimization of \(\langle {J}^{{{{{{{{\mathcal{P}}}}}}}}} \rangle\).

Additive construction of optimal enzyme arrangements

The above geometrical analysis leads us to an additive construction scheme, which generates the trajectory of optimal enzyme configurations as enzymes are added to the system. Generalizing from the example of Fig. 4, we consider a system in which space is discretized into N sites, denoting by ei = e(ri) the density of enzymes at position ri and by ρi = ρ(ri) the corresponding substrate density. For a given total enzyme level ET, there will be an optimal enzyme configuration \({{{{{{{{\bf{e}}}}}}}}}^{* }=\left({e}_{1}^{* },{e}_{2}^{* },\ldots ,{e}_{N}^{* }\right)\) that maximizes \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) on the (N − 1)-dimensional hyperplane defined by \({E}_{{{{{{{{\rm{T}}}}}}}}}=\mathop{\sum }\nolimits_{i = 1}^{N}{e}_{i}\). As in Fig. 4, the optimal configurations at different ET values trace out a trajectory e*(ET) in e space. We seek a procedure to construct e*(ET). We begin with no enzymes and iteratively add enzymes until the target ET value is reached. According to the principle of homogeneous marginal returns, the largest components of \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\) define the sites at which enzymes should be added in the next step. Addition may initially be restricted to a single site, with further “construction sites” being introduced gradually as different ET thresholds are crossed.

Since enzymes should be added at all positions where the marginal returns take on their maximal value, we must determine how to partition new enzymes between these positions. This partitioning corresponds to the tangent vector \(\frac{d{{{{{{{{\bf{e}}}}}}}}}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) of the optimal trajectory, which can be obtained from the variation of the marginal returns as enzymes are added (see Supplementary Note 7.1),

$$\frac{d}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}={{{{{{{\bf{H}}}}}}}}\frac{d{{{{{{{{\bf{e}}}}}}}}}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}.$$

Here, derivatives \(\frac{d}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) are taken tangentially to the line of optimal enzyme configurations and H is the N × N Hessian matrix of \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) in the space of enzyme densities, \({H}_{ij}=\frac{{d}^{2}{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{e}_{i}d{e}_{j}}\). In the subspace of only those sites where enzymes should be added (sites at which \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{e}_{i}}={\lambda }_{e}\)), the left hand side of Eq. (12) becomes

$$\frac{d}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{{\bf{e}}}}}}}}}_{(n)}}=\frac{d{\lambda }_{e}}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}{{{{{{{{\bf{1}}}}}}}}}_{(n)},$$

where the subscript (n) indicates that we are considering only the n-dimensional subspace of sites with equal returns and 1(n) is a n-dimensional vector of ones, yielding

$${{{{{{{{\bf{H}}}}}}}}}_{(n)}\frac{d{{{{{{{{\bf{e}}}}}}}}}_{(n)}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}=\frac{d{\lambda }_{e}}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}{{{{{{{{\bf{1}}}}}}}}}_{(n)}.$$

This n-dimensional linear system can be solved for the tangent \(\frac{d{{{{{{{{\bf{e}}}}}}}}}_{(n)}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) to the optimal trajectory. In general we do not know \(\frac{d{\lambda }_{e}}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) a priori. However, this scalar prefactor affects only the length, and not the direction, of \(\frac{d{{{{{{{{\bf{e}}}}}}}}}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\). Hence it suffices to treat \(\frac{d{\lambda }_{e}}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) as an arbitrary constant, and subsequently to rescale the resulting \(\frac{d{{{{{{{{\bf{e}}}}}}}}}^{* }}{d{E}_{{{{{{{{\rm{T}}}}}}}}}}\) to unit length once its direction is known. Taken together, we obtain the following additive construction scheme for the optimal enzyme arrangement:

  1. 1.

    Begin with e = 0.

  2. 2.

    For each site ri, evaluate the marginal returns \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{e}_{i}}\) for adding enzymes at that position.

  3. 3.

    Identify the subset of positions at which the returns are equal (within numerical tolerance) to the maximal value.

  4. 4.

    For this subset of positions, evaluate the Hessian matrix H(n) of the flux with respect to the enzyme densities.

  5. 5.

    Solve H(n)δe* = 1 for δe*, and normalize such that the total change in the amount of enzymes \({\sum }_{i}\delta {e}_{i}^{* }=\delta {E}_{{{{{{{{\rm{T}}}}}}}}}\).

  6. 6.

    Update the optimal enzyme arrangement, e* → e* + δe*.

  7. 7.

    Repeat from step 2 until the target total enzyme amount ET is reached.

The discretization of the system, which is required for the above construction scheme, can be chosen using a criterion based on Eq. (10) (see Supplementary Note 7.2). Compared to the stochastic search algorithms that have previously been used to find optimal enzyme arrangements in systems with simple geometries21,22, the additive construction scheme derived here has several advantages. In terms of computational effort, it generally performs better than stochastic optimization (see Supplementary Note 7.3), in particular for more complex systems. Moreover, while stochastic optimization proceeds by trial-and-error and can get stuck in local optima, the construction scheme follows a rational principle. By design, the construction scheme not only generates the optimal enzyme arrangement for the given total enzyme amount ET, but all optimal configurations for total enzyme amounts up to this level. As seen in the example considered below, this trajectory of optimal configurations leads to additional insight about the properties of the particular system at hand.

The construction scheme can also be adapted to other allocation problems in which investments and returns are coupled. As long as the resources to be invested follow a linear budget constraint, the adaptation amounts to a modification of the objective function. For instance, as mentioned above, one could consider an objective function penalizing high variance as in Markovitz’ problem11. One could also consider problems where the capital of the investor grows exponentially (iterative reinvestment) as in Kelly’s problem10 or more complex variants39. In each case, one needs to compute the marginal returns and the Hessian of the new objective function with respect to the resources invested in the different assets, and determine the optimal allocation of resources as the total budget gradually increases via the construction scheme. In Supplementary Note 8.2, we present a generalized Kelly’s problem with coupled investments and returns, for which the objective function becomes the long-term capital growth rate and the above additive construction scheme can be used.

Two-dimensional example

Figure 5 illustrates the additive construction scheme for a two-dimensional (2D) system with an absorbing outer boundary and three inner compartments acting as substrate sources. The compartments leak a constant and uniform substrate flux along their boundaries. Figure 5a compares two optimal enzyme configurations with a different enzyme amounts ET. For low ET, enzymes localize non-uniformly at the boundaries of the sources. For higher ET, the optimal enzyme profile extends into the interior of the system. However, the highest densities of enzymes are found in the regions between the sources and the outer boundary of the system, where the gradient of substrate concentration is steepest. A significant fraction of enzymes are thus devoted to substrates that, by the nature of where they are produced, are likely to rapidly diffuse out of the system.

Fig. 5: Two-dimensional model system to illustrate the HMR criterion and the application of the additive construction scheme for optimal enzyme arrangements.
figure 5

The system has an absorbing outer boundary and three inner compartments that act as substrate sources (dashed rectangles). a Optimal enzyme density e(x, y) (grayscale) at two different total enzyme amounts (ET = 40 and 400), calculated using the construction scheme. The colored squares indicate positions at which e(x, y) is analyzed in b, c as a function of ET, to illustrate the HMR criterion. b Optimal enzyme densities and c ratios of marginal returns at the positions indicated by colored squares in a. When a ratio of marginal returns reaches one, a new position becomes occupied with enzymes (correspondence marked by dashed lines). d The flux gain of the optimized enzyme arrangement (flux Jopt) relative to a uniform arrangement (Juniform, orange) and a fully bound arrangement (Jbound, cyan), as a function of ET. The flux Juniform is produced by uniformly distributing the enzymes in the whole system, whereas Jbound is for all enzymes evenly distributed over the boundaries of the substrate sources. e Percentage of extra enzymes, ΔET/ET, required in the uniform (orange) and bound (cyan) configuration to obtain the same flux as the optimal enzyme arrangement, as a function of ET.

Remarkably, the sites with the highest enzyme densities at small ET do not always retain the highest densities as ET is increased. Figure 5b compares the enzyme densities as a function of ET at three positions (marked by colored squares in Fig. 5a). The blue location is the first at which enzymes are added. However, although enzymes are added at the green and red positions only later, the densities there become higher (inset). Figure 5c shows the respective ratios of the returns of the red and green position to the returns from the blue position. Enzymes are added at the green and red position only when the returns are equal and the ratios are one, illustrating the HMR criterion.

It is pertinent to ask how much more efficient an optimal enzyme arrangement is than a simple arrangement. For the 2D model of Fig. 5a, we consider two simple arrangements for comparison: A uniform distribution over the entire system producing a reaction flux Juniform, and a ‘bound’ configuration with all enzymes uniformly distributed over the compartment boundaries, producing a reaction flux Jbound. Figure 5d plots the ratios between the optimal reaction flux Jopt and these two reference fluxes, as a function of the enzyme amount ET. At low ET, the optimal reaction flux is almost 3-fold higher than Juniform (orange line), and about 40% higher than Jbound (cyan line). Both ratios become approximately 1 for high ET. However, in the case of the bound configuration, the behavior is non-monotonic. This behavior can be rationalized from the behavior of the optimal configuration as a function of ET (Fig. 5a). The latter begins with all enzymes localized to the position with the highest substrate concentration (blue square in Fig. 5a), and becomes closer to the bound configuration only at higher ET values. For even larger ET, the optimal profile places enzymes also in the bulk of the system, such that it progressively differs from the bound configuration and Jopt/Jbound increases accordingly. Taken together, Fig. 5d shows that optimizing the enzyme configuration can generate significantly higher reaction fluxes as compared to other enzyme configurations.

A suboptimal enzyme arrangement could be compensated for by using more enzymes, to achieve the same reaction flux. What is the required extra enzyme expense? Fig. 5e shows the percentage of extra enzymes ΔET/ET required in the uniform and bound arrangements, respectively, to achieve the flux Jopt as a function of ET. The extra enzyme expense is particularly large for the uniform configuration, where 100–200% more enzymes are required over the entire range. For the bound arrangement, the expense is lower, but still very significant over most of the ET range. Taken together, Fig. 5d, e illustrate that optimizing the enzyme arrangement can significantly boost reaction fluxes or significantly economize on enzymes. This also implies that a change in the enzyme arrangement produces a corresponding change in the reaction flux, i.e., spatial rearrangement can be exploited for regulation. Indeed, both eukaryotic and prokaryotic cells modify the spatial arrangement of metabolic enzymes to dynamically regulate metabolic fluxes7,8,40,41,42,43,44.


We presented a solution for the problem of optimally allocating enzymes in space, to maximize the reaction flux of an enzymatic reaction. Our solution encompasses a class of systems with potentially complex geometries, in which the substrate enters via internal or external boundaries, is transported via diffusion and possibly advection, and can be lost by leakage or competing reactions (Fig. 1). The solution is based on the concept of a ‘marginal returns landscape’ (Fig. 2), defined as the derivative \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}\) of the total reaction flux with respect to the local enzyme density (Eq. (7)). The optimal arrangement of enzymes is such that the marginal returns are spatially homogeneous over all positions with enzymes. This criterion of homogeneous marginal returns (HMR) can more generally be applied to betting games where each bet globally feeds back onto all returns (Supplementary Note 8). In the enzyme allocation problem, the feedback is generated by enzymes locally depleting their substrate, which affects the global substrate profile.

The HMR criterion leads to a general local condition for the occurrence of a localization-delocalization transition in the optimal enzyme arrangement (Eq. (10)), which compares the local diffusive flux jD(s) to the local reaction flux \({j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\) at a source position s: As long as \({j}^{D}({{{{{{{\bf{s}}}}}}}})\, > \,{j}^{{{{{{{{\mathcal{P}}}}}}}}}({{{{{{{\bf{s}}}}}}}})\), localization of enzymes at the source is optimal, while the two fluxes are equal at the transition point and above (Fig. 3). This flux condition is not affected by any advective transport of the substrate, which may be present in the system, e.g., due to cytoplasmic streaming or transport by molecular motors. This independence is due to the deterministic nature of advective transport – the HMR criterion is fundamentally a bet-hedging strategy to deal with the probabilistic nature of diffusive transport.

The simplicity of this flux condition makes it practical for application to experimental systems, especially for synthetic systems where the local reaction flux can be measured and where the local diffusive flux can be related to the controlled local influx of substrate. For an in vivo system, in which enzyme localization is observed and local fluxes can be quantified, the condition can be used to estimate whether the observed enzyme localization indeed maximizes the reaction flux45, or whether it is more likely to play a regulatory role7,8. Generally, the objective of maximizing a metabolic flux is expected to be relevant for cells that are stressed43 or starved of certain nutrients40,41. If the mechanism mediating the enzyme localization is known, one can compare the reaction flux produced by the localized configuration with the flux produced by a control experiment for which enzyme localization is inhibited43,46.

Our findings support the agenda of rationalizing biological strategies with economic principles such as bet-hedging47,48,49, division of labor50, and Pareto fronts51. In our case, the HMR criterion allowed us to derive a scheme for constructing optimal enzyme arrangements (Figs. 4 and 5), similar to how the Kelly criterion10 and returns-variance analysis11 provide rules for optimally placing bets or optimally constructing portfolios. Our construction scheme is obtained by analyzing how the marginal returns change at each position as the amount of enzymes in the system is increased (Eq. (14)). It constitutes an exact deterministic procedure, which is applicable to systems with arbitrary geometries and multiple sources. Here, we presented the simplest general form of the scheme. Various modifications can be made to improve its efficiency for particular systems. Using the system geometry as a guide, one can limit the sites at which the marginal returns need to be evaluated in each update step. For example, at low ET values the positions with the highest returns coincide with sources of \({{{{{{{\mathcal{S}}}}}}}}\). Generally it suffices to compute the marginal returns only at source positions, sites where enzymes are already present, and neighboring sites. One could further speed up the algorithm by enabling larger increments δET with higher-order update schemes for e*.

We explicitly considered absorbing and reflective boundaries, also allowing for non-uniform and discontinuous influx profiles. However our results can be extended to systems with partially permeable boundaries, corresponding to k(s) = 1 and h(s) = p(s) > 0 in Eq. (3), where p(s) is the permeability. For such systems, the HMR criterion still holds. Similarly, the condition of Eq. (9) still determines transitions in the optimal enzyme profile. However, expressing this condition in terms of substrate fluxes will lead to a more complicated expression than Eq. (10). A permeable boundary typically increases the transition threshold for ET. For example, in the 1D system of Fig. 2, a non-zero permeability at the origin shifts the threshold value of ET from α−1 to α−1(1 + p(0)L/D).

Our continuous reaction–diffusion model neglects the finite size of enzyme molecules that limits the attainable enzyme density52. Imposing a maximal density condition \(e({{{{{{{\bf{r}}}}}}}})\le {e}_{\max }\) at each point18 could be incorporated into our analytical framework as an additional constraint in the Lagrangian. This would introduce an effective position-dependent cost in Eq. (7), resulting in a marginal returns landscape that is a function of position. The construction scheme could still be employed with the additional condition that enzymes cannot be added at positions where \({e}_{i}={e}_{\max }\), such that Eq. (14) would be restricted to positions with sub-maximal enzyme densities.

The construction scheme for optimal enzyme arrangements appears suited for applications in synthetic biology53. The attachment of enzymes to membranes can be controlled by fusing enzymes to transmembrane proteins54,55 or by using protein scaffolds56,57. The arrangement of enzymes in the interior of membrane-enclosed systems can be partially controlled with RNA assemblies58, synthetic protein scaffolds59, or fusion proteins18. Enzyme positioning on surfaces can be controlled with nanometer precision via single-molecule cut-and-paste surface assembly60,61, and in 3D by arranging enzymes on DNA scaffolds62,63,64,65,66. Some enzyme immobilization techniques can affect the enzymatic activity by changing the apparent KM and kcat of the immobilized enzyme67,68,69. For our model, this implies that we would have different KM and kcat values depending on the localization of the enzymes. Such a spatially dependent enzyme activity can be incorporated into our variational approach, with no effects onto the HMR criterion and the additive construction scheme that derives from it. The arrangement of enzymes can also be partially controlled via microtubule-directed transport70. Moreover, recent studies suggest that the motion of some enzymes can be affected by substrate gradients71,72,73, causing in some cases a so-called enzyme chemotaxis motion for which enzymes swim upstream the corresponding substrate gradient74,75,76. This motion favors the colocalization of enzymes with the sources of the corresponding substrate. The accumulation of enzymes at the sources of substrate has the effect of smoothening the substrate gradients due to the reaction, hence inhibiting further chemotaxis77. This mechanism could be a way for the enzymes to self-arrange into a smooth configuration with some enzymes localized at the substrate sources and others diffusing in the bulk of the system, with a tendency of being close to the sources.

In this work, we explicitly considered a single-step enzymatic reaction. However, synthetic biologists, as well as cells, face the challenge of optimizing the spatial arrangement of enzymes catalyzing cascades of metabolic reactions, i.e., linear chains of different enzymatic reactions for which the product of one enzyme is used as a substrate by the next enzyme. If the objective is to maximize the reaction flux of the final product of the cascade, one can compute the marginal returns of this flux, \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}\), with respect to the addition of extra enzymes of the different types, at different positions. The extra enzymes added affect the final reaction flux of the cascade by altering the concentrations of intermediates. If the different enzymes all contribute to the total enzyme budget constraint, then we expect the HMR criterion to hold and to find that \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{de({{{{{{{\bf{r}}}}}}}})}\) at the optimum is constant for the different enzyme types, at different positions. We therefore expect that a similar construction algorithm as the one derived here can be obtained for the optimal spatial arrangement of enzymes for an entire metabolic cascade (see Supplementary Note 9). Hence, combining our rational construction scheme with the arsenal of enzyme immobilization techniques described above, one could optimize synthetic bioreactors for the production of drug molecules59,78,79 or biofuels80,81.


Computation of \(\frac{dJ}{d{{{{{{{\bf{e}}}}}}}}}\) and H for linear reactions

For a discrete reaction-diffusion system with linear reactions, following the dynamics of Eq. (1), the steady-state equation can be written in matrix form as

$$({{{{{{{\bf{D}}}}}}}}+{{{{{{{\bf{V}}}}}}}}){{{{{{{\boldsymbol{\rho }}}}}}}}-\alpha \,{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{\boldsymbol{\rho }}}}}}}}-\sigma {{{{{{{\boldsymbol{\rho }}}}}}}}={{{{{{{\bf{A}}}}}}}},$$

where D and V are the diffusion and advection operator on the lattice respectively, ρ the substrate density and A the substrate influx vector, while  denotes the element-wise (Hadamard) product. The reaction flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) is given by the scalar product \({J}^{{{{{{{{\mathcal{P}}}}}}}}}=\alpha \,{{{{{{{\bf{e}}}}}}}}\cdot {{{{{{{\boldsymbol{\rho }}}}}}}}\). Thus e enters \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) both directly and through the solution ρ of Eq. (15). These multiple dependencies of \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) on e are summarized by the dependency graph in Fig. 6, where the matrix M = D + V − α diag(e) − σ diag(1) is the operator that applied to ρ gives the substrate source vector Mρ = A, diag(e) is the diagonal matrix with diagonal elements given by e and diag(1) is the identity matrix.

Fig. 6: Dependency graph for a discrete reaction-diffusion system with linear reaction kinetics.
figure 6

For linear kinetics, the reaction flux \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) is proportional to the dot product of the enzyme profile e and the substrate profile ρ. The graphs shows that e affects \({J}^{{{{{{{{\mathcal{P}}}}}}}}}\) both directly and indirectly. In fact, for a given e we have a reaction-diffusion operator M, whose inverse can be applied to the substrate source vector A to determine the substrate profile ρ = M−1A. Thus to determine the total derivative \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\), one needs to back-propagate the derivatives through these dependencies.

The marginal returns vector \(\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\) can be evaluated by back-propagating the derivative of the reaction flux with respect to the enzyme vector through the dependency graph. We find that

$$\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}=\frac{\partial {J}^{{{{{{{{\mathcal{P}}}}}}}}}}{\partial {{{{{{{\bf{e}}}}}}}}}+{\left(\frac{d{{{{{{{\boldsymbol{\rho }}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\right)}^{t}\frac{\partial {J}^{{{{{{{{\mathcal{P}}}}}}}}}}{\partial {{{{{{{\boldsymbol{\rho }}}}}}}}}$$
$$=\frac{\partial {J}^{{{{{{{{\mathcal{P}}}}}}}}}}{\partial {{{{{{{\bf{e}}}}}}}}}+{\left(\frac{d({{{{{{{{\bf{M}}}}}}}}}^{-1}{{{{{{{\bf{A}}}}}}}})}{d{{{{{{{\bf{M}}}}}}}}}\frac{d{{{{{{{\bf{M}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\right)}^{t}\frac{\partial {J}^{{{{{{{{\mathcal{P}}}}}}}}}}{\partial {{{{{{{\boldsymbol{\rho }}}}}}}}},$$

where \(\frac{d{{{{{{{\boldsymbol{\rho }}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\) is a matrix with (i, j)th element given by \(\frac{d{\rho }_{i}}{d{e}_{j}}\), and t denotes the transpose. Each of the derivatives appearing in Eq. (17) has a simple form, which we substitute to obtain the marginal returns vector,

$$\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}=\alpha {{{{{{{\boldsymbol{\rho }}}}}}}}\odot \left[{{{{{{{\bf{1}}}}}}}}+\alpha {({{{{{{{{\bf{M}}}}}}}}}^{-1})}^{t}{{{{{{{\bf{e}}}}}}}}\right],$$

where 1 is a vector of ones.

By taking a second derivative with respect to e, and again by back-propagating the derivatives, we can determine the Hessian,

$${{{{{{{\bf{H}}}}}}}} = \, {\alpha }^{2}\left\{\left[{{{{{{{{\bf{M}}}}}}}}}^{-1}\odot \left(\{{{{{{{{\bf{1}}}}}}}}+\alpha {({{{{{{{{\bf{M}}}}}}}}}^{-1})}^{t}{{{{{{{\bf{e}}}}}}}}\}\otimes {{{{{{{\boldsymbol{\rho }}}}}}}}\right)\right]\right.\\ +\left.{\left[{{{{{{{{\bf{M}}}}}}}}}^{-1}\odot \left(\{{{{{{{{\bf{1}}}}}}}}+\alpha {({{{{{{{{\bf{M}}}}}}}}}^{-1})}^{t}{{{{{{{\bf{e}}}}}}}}\}\otimes {{{{{{{\boldsymbol{\rho }}}}}}}}\right)\right]}^{t}\right\},$$

where  indicates the outer product.

Non-linear reactions

For non-linear reaction kinetics the reaction-diffusion equation becomes

$$({{{{{{{\bf{D}}}}}}}}+{{{{{{{\bf{V}}}}}}}}){{{{{{{\boldsymbol{\rho }}}}}}}}-\alpha {{{{{{{\bf{e}}}}}}}}\odot {{{{{{{\bf{F}}}}}}}}-\sigma {{{{{{{\boldsymbol{\rho }}}}}}}}={{{{{{{\bf{A}}}}}}}},$$

where F is the vector with Fi = F[ρi]. Since F[ρ] is non-linear, it is no longer possible to write the reaction-diffusion equation as a linear system that can be solved for ρ. As a result the dependency graph includes a loop, making it inconvenient to back-propagate derivatives. Instead, taking derivatives of the reaction-diffusion equation with respect to e, we can directly solve for

$$\frac{d{{{{{{{\boldsymbol{\rho }}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}=\alpha {{{{{{{{\bf{N}}}}}}}}}^{-1}{{{{{{{\rm{diag}}}}}}}}({{{{{{{\bf{F}}}}}}}}),$$

where \({{{{{{{\bf{N}}}}}}}}={{{{{{{\bf{D}}}}}}}}+{{{{{{{\bf{V}}}}}}}}-\alpha \,{{{{{{{\rm{diag}}}}}}}}({{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} })-\sigma \,{{{{{{{\rm{diag}}}}}}}}({{{{{{{\bf{1}}}}}}}})\) and \({F}_{i}^{{\prime} }={F}^{{\prime} }[{\rho }_{i}]\). We then take derivatives of \({J}^{{{{{{{{\mathcal{P}}}}}}}}}=\alpha {{{{{{{\bf{e}}}}}}}}\cdot {{{{{{{\bf{F}}}}}}}}\) with respect to e, to obtain the marginal returns vector,

$$\frac{d{J}^{{{{{{{{\mathcal{P}}}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}} = \, \alpha \left[{{{{{{{\bf{F}}}}}}}}+{\left(\frac{d{{{{{{{\boldsymbol{\rho }}}}}}}}}{d{{{{{{{\bf{e}}}}}}}}}\right)}^{t}\{{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} }\}\right]\\ = \,\alpha {{{{{{{\bf{F}}}}}}}}\odot \left[{{{{{{{\bf{1}}}}}}}}+\alpha {({{{{{{{{\bf{N}}}}}}}}}^{-1})}^{t}\{{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} }\}\right].$$

By taking a further derivative of the returns vector with respect to e we find the components of the Hessian,

$${{{{{{{{\bf{H}}}}}}}}}_{j,k} = \, {\alpha }^{2}\left\{{{{{{{{{\bf{N}}}}}}}}}_{j,k}^{-1}{\left[{{{{{{{\bf{F}}}}}}}}\otimes \left({{{{{{{{\bf{F}}}}}}}}}^{{\prime} }+\alpha {({{{{{{{{\bf{N}}}}}}}}}^{-1})}^{t}\{{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} 2}\}\right)\right]}_{k,j}\right. \\ \left.+\,{{{{{{{{\bf{N}}}}}}}}}_{k,j}^{-1}{\left[{{{{{{{\bf{F}}}}}}}}\otimes \left({{{{{{{{\bf{F}}}}}}}}}^{{\prime} }+\alpha {({{{{{{{{\bf{N}}}}}}}}}^{-1})}^{t}\{{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} 2}\}\right)\right]}_{j,k}\right\} \\ +{\alpha }^{3}{F}_{j}{F}_{k}\mathop{\sum}\limits_{i}{{{{{{{{\bf{N}}}}}}}}}_{i,j}^{-1}{e}_{i}{F}_{i}^{{\prime\prime} }{{{{{{{{\bf{N}}}}}}}}}_{i,k}^{-1}\left[1+\alpha {\left[{({{{{{{{{\bf{N}}}}}}}}}^{-1})}^{t}\{{{{{{{{\bf{e}}}}}}}}\odot {{{{{{{{\bf{F}}}}}}}}}^{{\prime} }\}\right]}_{i}\right],$$

which simplifies to Eq. (19) for linear reactions with F'' = 0.