betaFeedback

WorksEngineering

Policy Synthesis for Finite Populations of MDP Agents under Aggregate Reach-Avoid Chance Constraints

Abstract

Consider a finite population of agents with decoupled Markov transition dynamics and empirical-density feedback, subject to the following constraints: with probability at least 1−δr1-δ_r, at least a fraction αrα_r of agents must reach a target region at some time t∗t^*, while, at each time up to t∗t^*, the unsafe population fraction must remain below βuβ_u with probability at least 1−δu1-δ_u. However, standard mean-field methods enforce these constraints only in expectation, which fails to account for stochastic fluctuations at finite fleet size NN. To address this control problem, we propagate the second-order moment (variance) of the empirical density alongside the mean-field trajectory via a discrete-time Lyapunov recursion, and apply the Cantelli inequality to convert chance constraints into tractable deterministic conditions on the moments of the empirical density. We then incorporate these moment-based surrogate constraints into a gradient-based sequential convex approximation procedure for density-feedback policy synthesis. We further introduce additional moment-error bounds to construct a rigorous finite-NN certificate. The method is evaluated on a gridworld environment and a power-system EV-charging aggregation problem and compared with a standard deterministic population-level LP baseline.

Introduction

Controlling large populations of autonomous agents subject to safety and mission requirements is a fundamental challenge in swarm robotics [2, 4, 11], multi-agent systems [3], and smart-grid applications [26]. Tracking the state of every agent individually becomes intractable as NN grows because the resulting joint state space scales exponentially with NN; mean-field methods instead describe the population through an aggregate distribution whose dimension is independent of NN [1, 12, 13].

For finite NN, however, the empirical population density exhibits O(1/N)O(1/\sqrt{N}) stochastic fluctuations around its mean-field limit, so a policy whose limiting trajectory satisfies a constraint may still violate that constraint with non-negligible probability. We therefore study policy synthesis for a finite-NN population subject to aggregate reach–avoid chance constraints: with probability at least 1−δr1-\delta_r, at least a fraction αr\alpha_r of the agents must occupy the target region at some time t∗t^*, while, at every time up to t∗t^*, the unsafe-region occupancy must not exceed βu\beta_u with probability at least 1−δu1-\delta_u.

Related work. Mean-field games study equilibria among noncooperative agents, whereas mean-field control (MFC) considers a cooperative population whose aggregate objective is optimized by a centralized planner. Foundational continuous-time mean-field game theory characterizes population equilibria through coupled backward optimality and forward population-dynamics equations [12, 13]. For discrete-time mean-field MDPs, Bäuerle establishes the existence of optimal policies and convergence of finite-population control problems to their mean-field limits [7]. Related mean-field reinforcement learning (MFRL) studies develop and analyze learning algorithms for both mean-field games and cooperative mean-field control [14, 15, 16, 17].

For the class of reach-avoid chance constraints, stochastic reach–avoid methods has been developed to ensure probabilistic specifications for individual stochastic systems [6]. Yet, the method does not extend directly to enforce constraints on the empirical density of a finite multi-agent population when individual agents are stochastic systems. For MFC, safety constraints have been imposed on the deterministic population distribution or the system’s mean-field limit [1, 3, 4, 5]. Safe MFRL method [23] accounts for uncertainty in unknown transition dynamics when learning policies subject to global population constraints, but it does not account for stochastic fluctuations of the realized empirical density at finite NN.

Relating the proposed problem to other work focusing on stochastic variability in control design. Risk-sensitive mean-field games [20] use an exponential objective to account for variability in an individual agent’s accumulated return, rather than fluctuations in the aggregate occupancy of a finite population. Covariance steering uses the mean and covariance of a stochastic system’s state to enforce trajectory-level chance constraints [9], while distribution- and density-steering methods control state distributions under non-Gaussian disturbances or in robotic swarms [21, 22]. These approaches characterize either noise intrinsic to an individual system’s dynamics, or spatial dispersion of an continuum-population density. In contrast, the covariance we aim to constrain is the O(1/N)O(1/N) sampling covariance of the discrete empirical occupancy vector, which arises only because the population is finite and vanishes as N→∞N\to\infty.

Related finite-population work [19] formulates mean-field-type multi-agent control as a measure-valued MDP and develops discretization-based approximations with near-optimality guarantees. This measure-valued state representation avoids the exponentially large joint state space, but the planning method discretizes the measure-valued state space into a finite set of quantized empirical distributions, whose number grows combinatorially with the population size and the number of quantization bins. Moreover, the resulting approximate policies carry no chance-constraint guarantee for the finite-NN empirical density. For uncontrolled stochastic population models, [8] derives finite-size corrections to the mean-field limit at large but finite NN. This is done by solving a Lyapunov equation which yields a bias-correction term of order 1/N1/N that sharpens the mean-field estimate of a performance metric’s expected value. This work does not characterize the variance of the finite-NN population distribution, nor does it address chance-constrained policy synthesis.

Contribution. We study a finite population of homogeneous MDP agents with population-independent transition kernels and density-feedback policies. The goal is to synthesize a policy that, when each agent follows this policy, their collective behavior optimizes an aggregate objective subject to reach–avoid chance constraints on the empirical density. We derive first-order recursions for the mean and covariance of the finite-population empirical density under density-feedback policies and use Cantelli’s inequality to obtain deterministic sufficient conditions for the reach–avoid chance constraints. Because the mean and covariance recursions are first-order approximations, we introduce bounds on the moment-approximation errors to the reach and avoid margins to derive rigorous finite-NN certificates. Using these constraint surrogates, we develop a model-based Sequential Convex Approximation (SCA) algorithm that updates the density-feedback policy parameters through a sequence of second-order cone programs, using automatic differentiation to linearize the reach–avoid constraints locally. The method is validated using two experiments.

Problem Formulation

Swarm MDP and Empirical Density

A finite-horizon MDP is M=(S,A,P,r,μ0)M=(\mathcal{S},\mathcal{A},P,r,\mu_0), where S\mathcal{S} and A\mathcal{A} are finite state and action spaces, P(s′∣s,a)P(s' \mid s,a) is the transition kernel, r:S×A→Rr:\mathcal{S}\times\mathcal{A}\to\mathbb{R} is the reward, and μ0∈Δ(S)\mu_0\in\Delta(\mathcal{S}) is the mean initial population density. A swarm of NN homogeneous agents evolves on MM. The empirical density is

μtN(s)=1N∑i=1N1[Xti=s],s∈S,(1)\mu_t^N(s)=\frac{1}{N}\sum_{i=1}^{N}\mathbf{1}[X_t^i=s],\quad s\in\mathcal{S}, \tag*{(1)}

where Xti∈SX_t^i\in\mathcal{S} is agent ii’s state at time tt. We allow μ0N\mu_0^N to be random with known mean μ0=E[μ0N]\mu_0=\mathbb{E}[\mu_0^N] and covariance Σ0\Sigma_0; deterministic initialization is recovered by setting Σ0=0\Sigma_0=0. Each agent selects actions via the time-varying density-feedback policy πθt(a∣s,μtN)\pi_{\theta_t}(a\mid s,\mu_t^N), parameterized by θ=(θ0,…,θT−1)∈RT×∣S∣×∣A∣×nfeat\theta=(\theta_0,\ldots,\theta_{T-1})\in\mathbb{R}^{T\times|\mathcal{S}|\times|\mathcal{A}|\times n_{\mathrm{feat}}}, where θt∈R∣S∣×∣A∣×nfeat\theta_t\in\mathbb{R}^{|\mathcal{S}|\times|\mathcal{A}|\times n_{\mathrm{feat}}} is the slice of parameters used at time tt and nfeatn_{\mathrm{feat}} is the number of features. Specifically, we use the softmax-linear policy

πθt(a∣s,μ)=exp⁡(θt[s,a,:]Tϕ(s,μ))∑a′∈Aexp⁡(θt[s,a′,:]Tϕ(s,μ)),(2)\pi_{\theta_t}(a\mid s,\mu)=\frac{\exp(\theta_t[s,a,:]^{\mathsf{T}}\phi(s,\mu))}{\sum_{a'\in\mathcal{A}}\exp(\theta_t[s,a',:]^{\mathsf{T}}\phi(s,\mu))}, \tag*{(2)}

where ϕ(s,μ)∈Rnfeat\phi(s,\mu)\in\mathbb{R}^{n_{\mathrm{feat}}} is a twice continuously differentiable feature vector that may include state and population-density information.

we write πθ\pi_\theta for brevity when the time index is clear from context. Because the transition kernel and reward are population-independent, the density-feedback policy couples the agents through the controlled transition dynamics.

Remark 1 (Density-Dependent Reward: General Case). The reward r(s,a)r(s,a) in Problem 1 depends only on an agent’s state-action pair and not on the population density. More general density-dependent rewards arise in congestion models and coverage control but are outside the present scope.

Reach-Avoid Chance Constraints

Let T,U⊆S\mathcal{T},\mathcal{U}\subseteq\mathcal{S} be disjoint target and unsafe regions, and define the free region as F=S∖(T∪U)\mathcal{F}=\mathcal{S}\setminus(\mathcal{T}\cup\mathcal{U}). Define the aggregate density in region R\mathcal{R} as μtN(R)=∑s∈RμtN(s)\mu_t^N(\mathcal{R})=\sum_{s\in\mathcal{R}}\mu_t^N(s). Let [T]:={1,…,T}[T]:=\{1,\ldots,T\} denote the set of time steps.

Problem 1 (Chance-Constrained Reach-Avoid). Given αr,βu,δr,δu∈(0,1)\alpha_r,\beta_u,\delta_r,\delta_u\in(0,1), find policy parameters θ∗\theta^* and a reach time t∗∈[T]t^*\in[T] solving

max⁡θ,t∗∈[T]J(θ)=EPπθ[∑t=0T−1Rt](3)\max_{\theta,t^*\in[T]} J(\theta)=\mathbb{E}^{\mathbb{P}^{\pi_\theta}}\left[\sum_{t=0}^{T-1}R_t\right] \tag*{(3)}
s.t.\mathrm{s.t.}
Pπθ(μt∗N(T)≥αr)≥1−δr,(4)\mathbb{P}^{\pi_\theta}\left(\mu_{t^*}^N(\mathcal{T})\geq\alpha_r\right)\geq1-\delta_r, \tag*{(4)}
Pπθ(μtN(U)≤βu)≥1−δu,∀t≤t∗,(5)\mathbb{P}^{\pi_\theta}\left(\mu_t^N(\mathcal{U})\leq\beta_u\right)\geq1-\delta_u,\quad\forall t\leq t^*, \tag*{(5)}

where Rt=∑s,ar(s,a)μtN(s)πθt(a∣s,μtN)R_t=\sum_{s,a}r(s,a)\mu_t^N(s)\pi_{\theta_t}(a\mid s,\mu_t^N) is the population-average one-step reward conditional on μtN\mu_t^N.

The constraints in (3b)–(3c) are bound the reach and avoid violation probabilities separately, with the avoid guarantee imposed at each time t≤t∗t\leq t^*.

Mean-Field Dynamics and Covariance Propagation

Mean-Field Trajectory

For a fixed finite horizon and under the regularity and initial-concentration assumptions stated below, μtN\mu_t^N concentrates around the deterministic mean-field trajectory μˉt\bar{\mu}_t as N→∞N\to\infty. This trajectory is defined by the mean-field flow equation [1]:

μˉt+1(s′;θ)=∑s,aP(s′∣s,a)πθt(a∣s,μˉt)μˉt(s),(6)\bar{\mu}_{t+1}(s';\theta)=\sum_{s,a}P(s'\mid s,a)\pi_{\theta_t}(a\mid s,\bar{\mu}_t)\bar{\mu}_t(s), \tag*{(6)}
μˉ0=μ0.(7)\bar{\mu}_0=\mu_0. \tag*{(7)}

We distinguish μˉt\bar{\mu}_t from the true finite-NN expectation mtN:=E[μtN]m_t^N:=\mathbb{E}[\mu_t^N]. Define the conditional-mean map

gθt(μ)(s′):=∑s,aP(s′∣s,a)πθt(a∣s,μ)μ(s).(8)g_{\theta_t}(\mu)(s'):=\sum_{s,a}P(s'\mid s,a)\pi_{\theta_t}(a\mid s,\mu)\mu(s). \tag*{(8)}

As shown below, the finite-population process satisfies E[μt+1N∣μtN]=gθt(μtN)\mathbb{E}[\mu_{t+1}^N\mid\mu_t^N]=g_{\theta_t}(\mu_t^N) exactly, whereas the deterministic trajectory satisfies μˉt+1=gθt(μˉt)\bar{\mu}_{t+1}=g_{\theta_t}(\bar{\mu}_t). By Jensen’s inequality,

mt+1N=E[gθt(μtN)]≠gθt(mtN)(9)m_{t+1}^N=\mathbb{E}[g_{\theta_t}(\mu_t^N)]\ne g_{\theta_t}(m_t^N) \tag*{(9)}

in general when density feedback makes gθtg_{\theta_t} nonlinear. So setting μˉt=mtN\bar{\mu}_t=m_t^N on the right-hand side does not reproduce mt+1Nm_{t+1}^N on the left. Accordingly, μˉt\bar{\mu}_t is a nominal deterministic population trajectory and a leading-order approximation to the finite-NN mean, not the exact expectation.

Define the time-tt occupation measure by

zt(s,a;θ):=πθt(a∣s,μˉt(θ))μˉt(s;θ).(10)z_t(s,a;\theta) := \pi_{\theta t}(a \mid s,\bar{\mu}_t(\theta))\bar{\mu}_t(s;\theta). \tag*{(10)}

For compactness, define ft(θ,μ)(s,a):=πθt(a∣s,μ)μ(s)f_t(\theta,\mu)(s,a) := \pi_{\theta t}(a \mid s,\mu)\mu(s) and zt(θ)=ft(θ,μˉt(θ))z_t(\theta)=f_t(\theta,\bar{\mu}_t(\theta)). The flow matrix F∈R∣S∣×∣S∣∣A∣F \in\mathbb{R}^{|S|\times|S||A|} is defined by F[s′,sa]=P(s′∣s,a)F[s',sa] = P(s' \mid s,a). The mean-field flow can then be written compactly as

μˉt+1(θ)=Fzt(θ)=Fft(θ,μˉt(θ)),μˉ0=μ0.(11)\bar{\mu}_{t+1}(\theta) = Fz_t(\theta) = Ff_t(\theta,\bar{\mu}_t(\theta)), \qquad\bar{\mu}_0=\mu_0. \tag*{(11)}

Exact Conditional Moments and First-Order Covariance Propagation

The empirical density itself is a finite-state Markov process under a density-feedback policy. For an arbitrary density μ\mu, define the effective one-agent transition matrix

Qθt(μ)[s′,s]:=∑a∈Aπθt(a∣s,μ)P(s′∣s,a).(12)Q_{\theta t}(\mu)[s',s] := \sum_{a\in A}\pi_{\theta t}(a\mid s,\mu)P(s'\mid s,a). \tag*{(12)}

The conditional-mean map in (6) then satisfies gθt(μ)=Qθt(μ)μ=Fft(θ,μ)g_{\theta t}(\mu)=Q_{\theta t}(\mu)\mu=Ff_t(\theta,\mu). Conditional on μtN=μ\mu_t^N=\mu for an attainable empirical density μ∈ΔN(S):={ν∈Δ(S):Nν(s)∈Z≥0 ∀s}\mu\in\Delta_N(S):=\{\nu\in\Delta(S):N\nu(s)\in\mathbb{Z}_{\ge0}\ \forall s\}, there are Nμ(s)N\mu(s) agents in state ss. Given this count vector, agents randomize their actions independently and their physical transitions are conditionally independent. Consequently,

E[μt+1N∣μtN=μ]=gθt(μ)(13)\mathbb{E}[\mu_{t+1}^N\mid\mu_t^N=\mu]=g_{\theta t}(\mu) \tag*{(13)}

exactly. Define

qs(μ):=Qθt(μ)[⋅,s],(14)q_s(\mu):=Q_{\theta t}(\mu)[\cdot,s], \tag*{(14)}
Λθt(μ):=∑s∈Sμ(s)[Diag⁡(qs(μ))−qs(μ)qs(μ)⊤].(15)\Lambda_{\theta t}(\mu):=\sum_{s\in S}\mu(s)\left[\operatorname{Diag}(q_s(\mu))-q_s(\mu)q_s(\mu)^\top\right]. \tag*{(15)}

Summing the covariances of the conditionally independent categorical next-state indicators gives the exact identity

Cov⁡(μt+1N∣μtN=μ)=1NΛθt(μ).(16)\operatorname{Cov}(\mu_{t+1}^N\mid\mu_t^N=\mu)=\frac{1}{N}\Lambda_{\theta t}(\mu). \tag*{(16)}

For density feedback, fluctuations of μtN\mu_t^N propagate through the Jacobian of gθtg_{\theta t}. Let

Ht(θ):=∂gθt(μ)∂μ∣μˉt=FJtμ(θ),(17)H_t(\theta):=\left.\frac{\partial g_{\theta t}(\mu)}{\partial\mu}\right|_{\bar{\mu}_t}=FJ_t^\mu(\theta), \tag*{(17)}

where, coordinatewise,

Jtμ(s,a)[s′′]=πθt(a∣s,μˉt)δss′′+μˉt(s)∂∂μ(s′′)πθt(a∣s,μ)∣μˉt.(18)J_t^\mu(s,a)[s'']=\pi_{\theta t}(a\mid s,\bar{\mu}_t)\delta_{ss''}+\bar{\mu}_t(s)\left.\frac{\partial}{\partial\mu(s'')}\pi_{\theta t}(a\mid s,\mu)\right|_{\bar{\mu}_t}. \tag*{(18)}

When the policy is density independent, the second term vanishes and Ht(θ)=Qθt(μˉt)H_t(\theta)=Q_{\theta t}(\bar{\mu}_t).

We say that the initial empirical density satisfies the initial concentration condition if

μ0N−μ0=Op(N−1/2).(19)\mu_0^N-\mu_0=O_p(N^{-1/2}). \tag*{(19)}

This condition holds for deterministic initialization and for independently sampled initial states; in the latter case,

E[∥μ0N−μ0∥2]=1−∥μ0∥2N.(20)\mathbb{E}\left[\lVert\mu_0^N-\mu_0\rVert^2\right]=\frac{1-\lVert\mu_0\rVert^2}{N}. \tag*{(20)}

Proposition 1 (First-Order Covariance Approximation). Assume a fixed horizon, the initial concentration condition, and that gθtg_{\theta t} is twice continuously differentiable in a neighborhood of the nominal trajectory. Linearizing the conditional-mean map around the nominal trajectory gives the following first-order approximation Σ^t\widehat{\Sigma}_t to Σt:=Cov⁡(μtN)\Sigma_t:=\operatorname{Cov}(\mu_t^N):

Σ^t+1=HtΣ^tHt⊤+1NΛθt(μˉt).(21)\widehat{\Sigma}_{t+1}=H_t\widehat{\Sigma}_tH_t^\top+\frac{1}{N}\Lambda_{\theta t}(\bar{\mu}_t). \tag*{(21)}

The recursion is initialized with Σ^0=Σ0\widehat{\Sigma}_0=\Sigma_0, including Σ^0=0\widehat{\Sigma}_0=0 for deterministic initialization.

Proof sketch. The law of total covariance and (11)–(14) give

Σt+1=1NE[Λθt(μtN)]+Cov⁡(gθt(μtN)).(22)\Sigma_{t+1}=\frac{1}{N}\mathbb{E}[\Lambda_{\theta t}(\mu_t^N)]+\operatorname{Cov}(g_{\theta t}(\mu_t^N)). \tag*{(22)}

Linearizing the conditional-mean map around μˉt\bar{\mu}_t yields

gθt(μtN)=gθt(μˉt)+Ht(μtN−μˉt)+higher-order terms.g_{\theta t}(\mu_t^N)=g_{\theta t}(\bar{\mu}_t)+H_t(\mu_t^N-\bar{\mu}_t)+\text{higher-order terms}.

Under this linearization, HtΣ^tHt⊤H_t\widehat{\Sigma}_tH_t^\top describes how existing population fluctuations propagate to the next time step. Because μtN\mu_t^N fluctuates around μˉt\bar{\mu}_t at rate Op(N−1/2)O_p(N^{-1/2}), the variation of Λθt(μtN)\Lambda_{\theta t}(\mu_t^N) contributes only a smaller-order term after multiplication by 1/N1/N; we therefore evaluate Λθt\Lambda_{\theta t} at μˉt\bar{\mu}_t. This gives (19). □\square

Remark 2 (Aggregate action constraints). For constraints on actions aggregated across the population, an analogous first-order variance approximation can be derived for the empirical occupation measure; see Appendix .

Cantelli Chance-Constraint Certification

The standard MF approach enforces only the nominal constraints μˉt(T)≥αr\bar{\mu}_t(\mathcal{T})\ge\alpha_r and μˉt(U)≤βu\bar{\mu}_t(\mathcal{U})\le\beta_u, but these mean-field conditions alone do not imply the finite-NN chance constraints (3b)–(3c). Write mtN:=E[μtN]m_t^N:=\mathbb{E}[\mu_t^N] for the exact finite-population mean and mt(R):=cR⊤mtNm_t(\mathcal{R}):=c_{\mathcal{R}}^\top m_t^N for the expected fraction of agents in R\mathcal{R}. Here, cR(s)=1[s∈R]c_{\mathcal{R}}(s)=\mathbf{1}[s\in\mathcal{R}] is the indicator vector for R\mathcal{R}.

We use Cantelli’s inequality to derive deterministic sufficient conditions based on the first two moments, following a construction similar to that used in chance-constrained MPC [10].

Proposition 2 (Cantelli Bounds). For any tt and policy π\pi, the reach bound below holds when mtN(T)≥αrm_t^N(\mathcal{T})\ge\alpha_r, and the avoid bound holds when mtN(U)≤βum_t^N(\mathcal{U})\le\beta_u:

P(μtN(T)≥αr)≥1−σt2(T)σt2(T)+(mtN(T)−αr)2,(23)\mathbb{P}(\mu_t^N(\mathcal{T})\ge\alpha_r)\ge1-\frac{\sigma_t^2(\mathcal{T})}{\sigma_t^2(\mathcal{T})+(m_t^N(\mathcal{T})-\alpha_r)^2}, \tag*{(23)}
P(μtN(U)≤βu)≥1−σt2(U)σt2(U)+(βu−mtN(U))2.(24)\mathbb{P}(\mu_t^N(\mathcal{U})\le\beta_u)\ge1-\frac{\sigma_t^2(\mathcal{U})}{\sigma_t^2(\mathcal{U})+(\beta_u-m_t^N(\mathcal{U}))^2}. \tag*{(24)}

where σt2(R)=cR⊤ΣtcR\sigma_t^2(\mathcal{R})=c_{\mathcal{R}}^\top\Sigma_t c_{\mathcal{R}} denotes the exact finite-population variance. Specifically, when the relevant variance is zero, the corresponding probability bound equals one, and the Cantelli condition reduces to mtN(T)≥αrm_t^N(\mathcal{T})\ge\alpha_r for reach or mtN(U)≤βum_t^N(\mathcal{U})\le\beta_u for avoid.

Proof. For the reach bound, let X=μtN(T)X=\mu_t^N(\mathcal{T}) and dr=mtN(T)−αr≥0d_r=m_t^N(\mathcal{T})-\alpha_r\geq0. If σt2(T)>0\sigma_t^2(\mathcal{T})>0, Cantelli’s inequality gives

P(X−mtN(T)≤−dr)≤σt2(T)σt2(T)+dr2.\mathbb{P}(X-m_t^N(\mathcal{T})\leq-d_r)\leq\frac{\sigma_t^2(\mathcal{T})}{\sigma_t^2(\mathcal{T})+d_r^2}.

Since {X<αr}⊆{X−mtN(T)≤−dr}\{X<\alpha_r\}\subseteq\{X-m_t^N(\mathcal{T})\leq-d_r\}, taking complements yields (21). If the variance is zero, XX is constant almost surely and the conclusion follows directly. The bound on the avoid condition is derived analogously. □

Lemma 1 (Sufficient Cantelli Conditions). Setting κr=(1−δr)/δr\kappa_r=\sqrt{(1-\delta_r)/\delta_r} and κu=(1−δu)/δu\kappa_u=\sqrt{(1-\delta_u)/\delta_u}, the chance constraints (3b)–(3c) are implied by:

mt∗N(T)−αr≥κrσt∗(T),(25)m_{t^*}^N(\mathcal{T})-\alpha_r\geq\kappa_r\sigma_{t^*}(\mathcal{T}), \tag*{(25)}
βu−mtN(U)≥κuσt(U),∀t≤t∗.(26)\beta_u-m_t^N(\mathcal{U})\geq\kappa_u\sigma_t(\mathcal{U}),\qquad\forall t\leq t^*. \tag*{(26)}

Proof. For the reach constraint, let dr:=mt∗N(T)−αrd_r:=m_{t^*}^N(\mathcal{T})-\alpha_r. Condition (23) ensures dr≥0d_r\geq0 and

dr2≥1−δrδrσt∗2(T).d_r^2\geq\frac{1-\delta_r}{\delta_r}\sigma_{t^*}^2(\mathcal{T}).

Therefore,

σt∗2(T)σt∗2(T)+dr2≤δr,\frac{\sigma_{t^*}^2(\mathcal{T})}{\sigma_{t^*}^2(\mathcal{T})+d_r^2}\leq\delta_r,

and substituting this inequality into (21) gives the required probability bound. For the avoid constraint, set du:=βu−mtN(U)d_u:=\beta_u-m_t^N(\mathcal{U}). Condition (24) gives du≥0d_u\geq0 and du2≥((1−δu)/δu)σt2(U)d_u^2\geq((1-\delta_u)/\delta_u)\sigma_t^2(\mathcal{U}), so the same argument applied to (22) yields the avoid bound. If either variance is zero, the corresponding random variable is constant almost surely and the conclusion follows directly. □

Corollary 1 (Robust Finite-NN Certificate). Let Σ^t\widehat{\Sigma}_t be the covariance approximation produced by Proposition 1. Suppose validated deterministic bounds bt,R,et,R≥0b_{t,R},e_{t,R}\geq0 are available for the mean and variance approximation errors, respectively, such that

∣cR⊤(mtN−μˉt)∣≤bt,R,cR⊤ΣtcR≤cR⊤Σ^tcR+et,R.(27)\left|c_R^\top(m_t^N-\bar{\mu}_t)\right|\leq b_{t,R},\qquad c_R^\top\Sigma_t c_R\leq c_R^\top\widehat{\Sigma}_t c_R+e_{t,R}. \tag*{(27)}

Then the exact finite-NN chance constraints are implied by

cT⊤μˉt∗−bt∗,T−αr≥κrcT⊤Σ^t∗cT+et∗,T,(28)c_{\mathcal{T}}^\top\bar{\mu}_{t^*}-b_{t^*,\mathcal{T}}-\alpha_r\geq\kappa_r\sqrt{c_{\mathcal{T}}^\top\widehat{\Sigma}_{t^*}c_{\mathcal{T}}+e_{t^*,\mathcal{T}}}, \tag*{(28)}
βu−cU⊤μˉt−bt,U≥κucU⊤Σ^tcU+et,U,∀t≤t∗.(29)\beta_u-c_{\mathcal{U}}^\top\bar{\mu}_t-b_{t,\mathcal{U}}\geq\kappa_u\sqrt{c_{\mathcal{U}}^\top\widehat{\Sigma}_t c_{\mathcal{U}}+e_{t,\mathcal{U}}},\qquad\forall t\leq t^*. \tag*{(29)}

Proof. The first enclosure lower-bounds the exact reach mean and upper-bounds the exact unsafe mean; the second upper-bounds the relevant exact variance. Thus (26)–(27) imply the conditions of Lemma 1. □

Replacing the moments in (23)–(24) with cR⊤μˉt(θ)c_R^\top\bar{\mu}_t(\theta) and Σ^t(θ)\widehat{\Sigma}_t(\theta), for R∈{T,U}R\in\{\mathcal{T},\mathcal{U}\}, gives surrogate constraints. These constraints are nonlinear in θ\theta through (9) and (19).

Chance-Constrained Mean-Field Policy Synthesis

Using the mean-field and first-order covariance approximations, we formulate the following approximate synthesis problem:

max⁡θ,t∗J(θ)=∑t=0T−1∑s,ar(s,a)μˉt(s;θ)πθ(a∣s,μˉt(θ))=∑t=0T−1∑s,ar(s,a)zt(s,a;θ)s.t.(27),(26),(9),(19).\begin{aligned} \max_{\theta,t^*}\quad J(\theta) &=\sum_{t=0}^{T-1}\sum_{s,a}r(s,a)\bar{\mu}_t(s;\theta)\pi_\theta(a\mid s,\bar{\mu}_t(\theta))\\ &=\sum_{t=0}^{T-1}\sum_{s,a}r(s,a)z_t(s,a;\theta)\\ \text{s.t.}\quad&(27),(26),(9),(19). \end{aligned}

Recall that ztz_t is the occupancy measure.

Because the problem is nonconvex, we solve it using the sequential convex approximation (SCA) method. At each SCA iteration, we linearize the mean-field trajectory and solve a trust-region SOCP that takes one policy-improvement step subject to the Cantelli reach-avoid constraints. We first derive the required Jacobians, then formulate the SOCP subproblem, and finally describe the trust-region update and the search over candidate reach times.

Linearization of the objective function

Given the policy parameter θ(k)\theta^{(k)} at iteration kk, the objective function has the following first-order Taylor expansion:

J(θ(k)+Δθ)=∑t=0T−1∑s,ar(s,a)zt(s,a;θ(k)+Δθ)≈∑t=0T−1∑s,ar(s,a)[zt(s,a;θ(k))+∇θzt(s,a;θ(k))Δθ].\begin{aligned} J(\theta^{(k)}+\Delta\theta) &=\sum_{t=0}^{T-1}\sum_{s,a}r(s,a)z_t(s,a;\theta^{(k)}+\Delta\theta)\\ &\approx\sum_{t=0}^{T-1}\sum_{s,a}r(s,a)\left[z_t(s,a;\theta^{(k)})+\nabla_\theta z_t(s,a;\theta^{(k)})\Delta\theta\right]. \end{aligned}

Recall that zt(s,a;θ)=μˉt(s;θ)πθ(a∣s,μˉt(θ))z_t(s,a;\theta)=\bar{\mu}_t(s;\theta)\pi_\theta(a\mid s,\bar{\mu}_t(\theta)), which is a function of θ\theta through both the parameterized policy and μˉt(θ)\bar{\mu}_t(\theta). Let zt(θ)=ft(θ,μˉt(θ))z_t(\theta)=f_t(\theta,\bar{\mu}_t(\theta)), and Dt(k):=∂μˉt/∂θ∣θ(k)∈R∣S∣×nθD_t^{(k)}:=\left.\partial\bar{\mu}_t/\partial\theta\right|_{\theta^{(k)}}\in\mathbb{R}^{|S|\times n_\theta} denote the Jacobian of the mean-field density with respect to the policy parameters, with D0(k)=0D_0^{(k)}=0 because μˉ0=μ0\bar{\mu}_0=\mu_0 is fixed. Here nθ=∣T∣∣S∣∣A∣nfeatn_\theta=|T||S||A|n_{\mathrm{feat}} is the total number of policy parameters.

Proposition 3. The Jacobian of ztz_t at iterate θ(k)\theta^{(k)} is

∂zt(θ)∂θ∣θ=θ(k)=:Gt(k)=Jtθ+JtμDt(k),(30)\left.\frac{\partial z_t(\theta)}{\partial\theta}\right|_{\theta=\theta^{(k)}}=:G_t^{(k)}=J_t^\theta+J_t^\mu D_t^{(k)}, \tag*{(30)}

where Jtθ:=∂θft∣(θ(k),μˉt(k))J_t^\theta:=\left.\partial_\theta f_t\right|_{(\theta^{(k)},\bar{\mu}_t^{(k)})} and Jtμ:=∂μft∣(θ(k),μˉt(k))J_t^\mu:=\left.\partial_\mu f_t\right|_{(\theta^{(k)},\bar{\mu}_t^{(k)})}, and Dt(k)D_t^{(k)} propagates forward via

Dt+1(k)=FGt(k),D0(k)=0.(31)D_{t+1}^{(k)}=F G_t^{(k)},\qquad D_0^{(k)}=0. \tag*{(31)}

Consequently, the linearized occupation measure and mean trajectory are ztlin(Δθ)=zt(k)+Gt(k)Δθz_t^{\mathrm{lin}}(\Delta\theta)=z_t^{(k)}+G_t^{(k)}\Delta\theta and μˉtlin(Δθ)=μˉt(k)+Dt(k)Δθ\bar{\mu}_t^{\mathrm{lin}}(\Delta\theta)=\bar{\mu}_t^{(k)}+D_t^{(k)}\Delta\theta.

Proof. By (9), μˉt+1(θ)=Fzt(θ)=Fft(θ,μˉt(θ))\bar{\mu}_{t+1}(\theta)=Fz_t(\theta)=Ff_t(\theta,\bar{\mu}_t(\theta)). Since ftf_t depends on θ\theta both directly and through μˉt(θ)\bar{\mu}_t(\theta), the chain rule with ∂θft=Jtθ\partial_\theta f_t = J_t^\theta, ∂μft=Jtμ\partial_\mu f_t = J_t^\mu, dμˉt/dθ=Dt(k)d\bar{\mu}_t/d\theta= D_t^{(k)} gives exactly (30):

Gt(k)=dztdθ∣θ(k)=Jtθ+JtμDt(k).G_t^{(k)} = \left.\frac{dz_t}{d\theta}\right|_{\theta^{(k)}} = J_t^\theta+ J_t^\mu D_t^{(k)}.

Here, Jtθ(s,a)=μˉt(k)(s)∇θπθt(a∣s,μˉt(k))J_t^\theta(s,a) = \bar{\mu}_t^{(k)}(s)\nabla_\theta\pi_{\theta_t}(a \mid s,\bar{\mu}_t^{(k)}) and

Jtμ(s,a)[s′′]=π(k)(a∣s,μˉt(k))δss′′+μˉt(k)(s)∂μ(s′′)πθ(a∣s,μ)∣μˉt(k).J_t^\mu(s,a)[s^{\prime\prime}] = \pi^{(k)}(a \mid s,\bar{\mu}_t^{(k)})\delta_{ss^{\prime\prime}} + \bar{\mu}_t^{(k)}(s)\partial_{\mu(s^{\prime\prime})}\pi_\theta(a \mid s,\mu)\big|_{\bar{\mu}_t^{(k)}}.

The flow matrix FF is constant, θ\theta-independent, so differentiating μˉt+1(θ)=Fzt(θ)\bar{\mu}_{t+1}(\theta) = Fz_t(\theta) directly gives Dt+1(k)=F dzt/dθ=FGt(k)D_{t+1}^{(k)} = F\,dz_t/d\theta= FG_t^{(k)}, i.e. (31). Substituting the expression for Gt(k)G_t^{(k)} above into this combines the pair (29)–(30) into a single linear recursion in Dt(k)D_t^{(k)}:

Dt+1(k)=FJtμDt(k)+FJtθ,D0(k)=0.(32)D_{t+1}^{(k)} = FJ_t^\mu D_t^{(k)} + FJ_t^\theta,\qquad D_0^{(k)} = 0. \tag*{(32)}

The first term propagates the density sensitivity, while the second captures the direct effect of the policy parameters. Gt(k)G_t^{(k)} is then recovered from Dt(k)D_t^{(k)} via (30).

For θ=θ(k)+Δθ\theta= \theta^{(k)} + \Delta\theta,

zt(θ(k)+Δθ)≈zt(θ(k))+Gt(k)Δθ=zt(k)+Gt(k)Δθ,z_t(\theta^{(k)}+\Delta\theta) \approx z_t(\theta^{(k)}) + G_t^{(k)}\Delta\theta= z_t^{(k)} + G_t^{(k)}\Delta\theta,
μˉt(θ(k)+Δθ)≈μˉt(θ(k))+Dt(k)Δθ=μˉt(k)+Dt(k)Δθ.\bar{\mu}_t(\theta^{(k)}+\Delta\theta) \approx\bar{\mu}_t(\theta^{(k)}) + D_t^{(k)}\Delta\theta= \bar{\mu}_t^{(k)} + D_t^{(k)}\Delta\theta.

SOCP Subproblem

For a finite-NN certificate, let bt,R(k)b_{t,\mathcal{R}}^{(k)} and et,R(k)e_{t,\mathcal{R}}^{(k)} be validated upper bounds satisfying (25) throughout the current trust region. Linearising the mean and freezing these bounds gives the kk-th SCA subproblem:

max⁡Δθ, ξ≥0 ∑t=0T−1rT(zt(k)+Gt(k)Δθ)−λ∑tξt(33)\max_{\Delta\theta,\,\xi\ge0}\ \sum_{t=0}^{T-1}\mathbf{r}^{\mathsf{T}}\left(z_t^{(k)}+G_t^{(k)}\Delta\theta\right)-\lambda\sum_t\xi_t \tag*{(33)}
s.t.cμˉ∗Tμˉ∗lin(Δθ)≥αr+bt∗,T(k)+κrσ^t∗,T(k),(34)\text{s.t.}\quad\mathbf{c}_{\bar{\mu}_*}^{\mathsf{T}}\bar{\mu}_*^{\mathrm{lin}}(\Delta\theta)\ge\alpha_r+b_{t_*,T}^{(k)}+\kappa_r\widehat{\sigma}_{t_*,T}^{(k)}, \tag*{(34)}
cμˉtTμˉtlin(Δθ)−ξt≤βu−bt,U(k)−κuσ^t,U(k),∀t≤t∗,(35)\mathbf{c}_{\bar{\mu}_t}^{\mathsf{T}}\bar{\mu}_t^{\mathrm{lin}}(\Delta\theta)-\xi_t\le\beta_u-b_{t,U}^{(k)}-\kappa_u\widehat{\sigma}_{t,U}^{(k)},\qquad\forall t\le t^*, \tag*{(35)}
∥Δθ∥2≤ρ(k).(36)\lVert\Delta\theta\rVert_2\le\rho^{(k)}. \tag*{(36)}

where ξt\xi_t are slack variables, r\mathbf{r} is the reward function written in the vector form, t∗t^* is fixed (see below), ρ(k)>0\rho^{(k)}>0 is the trust-region radius,

μˉtlin(Δθ):=μˉt(k)+Dt(k)Δθ(37)\bar{\mu}_t^{\mathrm{lin}}(\Delta\theta):=\bar{\mu}_t^{(k)}+D_t^{(k)}\Delta\theta \tag*{(37)}

is the linearized mean trajectory of Proposition 3, and

σ^t,R(k):=max⁡(cRTΣ^t(k)cR+et,R(k),0),R∈{T,U},(38)\widehat{\sigma}_{t,\mathcal{R}}^{(k)}:=\sqrt{\max\left(\mathbf{c}_{\mathcal{R}}^{\mathsf{T}}\widehat{\Sigma}_t^{(k)}\mathbf{c}_{\mathcal{R}}+e_{t,\mathcal{R}}^{(k)},0\right)},\qquad\mathcal{R}\in\{\mathcal{T},\mathcal{U}\}, \tag*{(38)}

is a certified upper bound on the Cantelli standard deviation of region R\mathcal{R}. Here Σ^t(k)\widehat{\Sigma}_t^{(k)} is the first-order covariance recursion evaluated at the current iterate. The resulting constraints are the robust conditions (26)–(27) with a linearized mean. Problem (32) is an SOCP (the objective and constraints are affine in Δθ\Delta\theta; the trust region is a second-order cone constraint), solvable in polynomial time.

a) Fixed-covariance surrogate: The mean trajectory is linearized as μˉtlin(Δθ)\bar{\mu}_t^{\mathrm{lin}}(\Delta\theta), whereas the covariance surrogate is held at Σ^t(k)\widehat{\Sigma}_t^{(k)}. This is because Σ^t(θ)\widehat{\Sigma}_t(\theta) depends on θ\theta through the nonlinear Lyapunov recursion (19), which contains the term Ht(θ)Σ^t(θ)Ht(θ)TH_t(\theta)\widehat{\Sigma}_t(\theta)H_t(\theta)^{\mathsf{T}}. Freezing σ^t,R(k)\widehat{\sigma}_{t,\mathcal{R}}^{(k)} keeps the constraints affine in Δθ\Delta\theta and preserves the SOCP form of the subproblem. The trust region keeps this approximation local, and the covariance is recomputed after every accepted step. By Proposition 1, the change in covariance over a gradient step is typically O(∥Δθ∥/N)O(\lVert\Delta\theta\rVert/N). Such a small error can be negligible or absorbed into the error et,Re_{t,\mathcal{R}} of Corollary 1.

b) Trust-Region Update: For each SCA run, t∗t^* is fixed to one candidate reach time. Since a step that improves JJ can violate the robust constraints after linearization, we accept or reject it using an L1L_1-penalty merit function evaluated at the nonlinear robust margins,

M(θ):=J(θ)−λM[max⁡(0,−greach(θ))+max⁡(0,−gavoid(θ))].(39)M(\theta):=J(\theta)-\lambda_M\left[\max(0,-g_{\mathrm{reach}}(\theta))+\max(0,-g_{\mathrm{avoid}}(\theta))\right]. \tag*{(39)}

where we define the robust standard-deviation margin

qt,R(θ):=cRTΣ^t(θ)cR+et,R(θ).q_{t,\mathcal{R}}(\theta):=\sqrt{\mathbf{c}_{\mathcal{R}}^{\mathsf{T}}\widehat{\Sigma}_t(\theta)\mathbf{c}_{\mathcal{R}}+e_{t,\mathcal{R}}(\theta)}.

Then

greach(θ)=cμˉt∗Tμˉt∗(θ)−αr−bt∗,T(θ)−κrqt∗,T(θ),g_{\mathrm{reach}}(\theta)=\mathbf{c}_{\bar{\mu}_{t^*}}^{\mathsf{T}}\bar{\mu}_{t^*}(\theta)-\alpha_r-b_{t^*,T}(\theta)-\kappa_rq_{t^*,T}(\theta),
gavoid(θ)=min⁡t≤t∗[βu−cμˉtTμˉt(θ)−bt,U(θ)−κuqt,U(θ)].g_{\mathrm{avoid}}(\theta)=\min_{t\le t^*}\left[\beta_u-\mathbf{c}_{\bar{\mu}_t}^{\mathsf{T}}\bar{\mu}_t(\theta)-b_{t,U}(\theta)-\kappa_uq_{t,U}(\theta)\right].

The bounds bt,R(θ)b_{t,\mathcal{R}}(\theta) and et,R(θ)e_{t,\mathcal{R}}(\theta) are recomputed or validated at the candidate policy; λM>0\lambda_M>0 penalizes constraint violation. If the SOCP is feasible, set θ′=θ(k)+Δθ(k)\theta'=\theta^{(k)}+\Delta\theta^{(k)} and evaluate the candidate using the nonlinear merit function. The trust-region radius is then updated as:

ρ(k+1)={min⁡(βincρ(k),ρmax⁡)if M(θ′)≥M(θ(k))−ε,βdecρ(k)otherwise.(40)\rho^{(k+1)}= \begin{cases} \min(\beta_{\mathrm{inc}}\rho^{(k)},\rho_{\max}) & \text{if } M(\theta')\ge M(\theta^{(k)})-\varepsilon,\\ \beta_{\mathrm{dec}}\rho^{(k)} & \text{otherwise.} \end{cases} \tag*{(40)}

where βdec∈(0,1)\beta_{\mathrm{dec}}\in(0,1), βinc>1\beta_{\mathrm{inc}}>1, and ε≥0\varepsilon\ge0 is the acceptance tolerance. Candidates that fail the merit-function acceptance test are rejected and the trust-region radius is reduced.

If instead the SOCP (32) is infeasible, the trust region may be too small to reach the required constraint shifts. We therefore increase ρ(k)\rho^{(k)} up to ρmax⁡\rho_{\max}. If infeasibility persists at ρmax⁡\rho_{\max}, we terminate the current SCA run and proceed to the next candidate t∗t^*.

c) Choose candidate reach time: The existential reach constraint requires only that (32b) holds at some t∗t^*, not a specific terminal time TT. Given an initial warm-start policy, we enumerate the top-Kt∗K_{t^*} candidate time steps by their initial reach margins cμˉt∗Tμˉt∗(0)−αr−bt∗,T(0)−κrσ^t∗,T(0)\mathbf{c}_{\bar{\mu}_{t^*}}^{\mathsf{T}}\bar{\mu}_{t^*}^{(0)}-\alpha_r-b_{t^*,T}^{(0)}-\kappa_r\widehat{\sigma}_{t^*,T}^{(0)} (descending). We run SCA for each candidate in turn and stop when both margins in the merit function (35) satisfy rm:=greach≥0r_m:=g_{\mathrm{reach}}\ge0 and am:=gavoid≥0a_m:=g_{\mathrm{avoid}}\ge0. If no candidate satisfies both margins, we return the infeasible result with the largest M(θ)M(\theta) across all Kt∗K_{t^*} candidates. Because the search stops at the first candidate satisfying both margins, rather than comparing all Kt∗K_{t^*} candidates, the returned policy may be suboptimal in reward.

Algorithm 1: SCA for Reach-Avoid Swarm Control

Input: $\theta^{(0)}$, $N$, $K$, $K_{t}^{*}$, $\rho_{0}$, $\beta_{\mathrm{inc}}$, $\beta_{\mathrm{dec}}$, $\rho_{\max}$, $\lambda$, $\lambda_{M}$, $\epsilon$
Output: $\theta^{*}$, $\bar{\mu}^{*}$, $\Sigma_{b}^{*}$, $r_{m}^{*}$, $a_{m}^{*}$

1 Compute $(\bar{\mu}^{(0)}, \Sigma_{t}^{b,(0)})$ via forward sim. and Lyapunov recursion at $\theta^{(0)}$;
2 Compute or validate $b_{t,R}^{(0)}, e_{t,R}^{(0)}$ for the initial trust-region radius $\rho_{0}$;
3 Rank $t \in [T]$ by $c_{T}^{\top}\bar{\mu}_{t}^{T} - \alpha_{r} - b_{t,T}^{(0)} - \kappa_{r}\sigma_{T}^{b,(0)}$ descending; set $\mathcal{T}^{*} \leftarrow$ top-$K_{t}^{*}$ candidates;
4 foreach $t^{*} \in \mathcal{T}^{*}$ do
5 $\theta \leftarrow \theta^{(0)}$;
6 $\rho \leftarrow \rho_{0}$;
7 for $k = 0,\ldots,K-1$ do
8 Compute $(\bar{\mu}_{t}^{(k)}, \Sigma_{t}^{b,(k)})$;
9 Compute or validate $b_{t,R}^{(k)}, e_{t,R}^{(k)}$ for the current trust region;
10 Compute $G_{t}^{(k)}, D_{t}^{(k)}$ via Prop. 3;
11 Solve SOCP (32) $\to \Delta\theta^{(k)}$;
12 if infeasible then
13 if $\rho = \rho_{\max}$ then
14 break; // proceed to the next $t^{*}$
15 $\rho \leftarrow \min(\beta_{\mathrm{inc}}\rho,\rho_{\max})$; continue;
16 $\theta' \leftarrow \theta + \Delta\theta^{(k)}$
17 if $M(\theta') \ge M(\theta)-\epsilon$ then
18 $\theta \leftarrow \theta'$;
19 $\rho \leftarrow \min(\beta_{\mathrm{inc}}\rho,\rho_{\max})$;
20 else
21 $\rho \leftarrow \beta_{\mathrm{dec}}\rho$;
22 Evaluate $r_m$, $a_m$, $M(\theta)$;
23 if $r_m \ge 0$ and $a_m \ge 0$ then
24 Store the candidate;
25 break; // first candidate satisfying both margins
26 Store if $M(\theta)$ is the largest infeasible value so far;
27 return stored $(\theta^{*},\bar{\mu}^{*},\Sigma_{b}^{*},r_{m}^{*},a_{m}^{*})$

Experimental Validation

We validate the algorithm using two case studies.1 As a baseline, we use a mean-field LP that solves the mean-field relaxation of Problem 1 directly over the occupation measure zt(s,a)≥0z_t(s,a) \ge0, rather than over policy parameters θ\theta:

max⁡z0,…,zT−1≥0∑t=0T−1r⊤zt(41)\begin{aligned} \max_{z_0,\ldots,z_{T-1}\ge0}\quad&\sum_{t=0}^{T-1}r^{\top}z_t \tag*{(41)} \end{aligned}
s.t.μˉt+1=Fzt,μˉ0=μ0,(42)\begin{aligned} \text{s.t.}\quad&\bar{\mu}_{t+1}=Fz_t,\quad\bar{\mu}_0=\mu_0, \tag*{(42)} \end{aligned}
cT⊤μˉt∗≥αr,cU⊤μˉt≤βu∀t≤t∗,(43)c_T^{\top}\bar{\mu}_{t^{*}}\ge\alpha_r,\quad c_U^{\top}\bar{\mu}_t\le\beta_u\quad\forall t\le t^{*}, \tag*{(43)}

enforcing only the mean constraints. Since t∗t^{*} is existential, (37) is solved once for each candidate t∗∈[T]t^{*}\in[T] and the best feasible reward is kept. Because the objective and constraints are linear in ztz_t, (37) is an LP and is solved exactly. The policy is recovered as πt(a∣s)=zt∗(s,a)/μˉt∗(s)\pi_t(a\mid s)=z_t^{*}(s,a)/\bar{\mu}_t^{*}(s) (uniform where μˉt∗(s)=0\bar{\mu}_t^{*}(s)=0).

Gridworld Environment

Our first case study is a 6×66\times6 discrete gridworld (Figure 1, ∣S∣=36|S|=36, ∣A∣=5|A|=5: up/down/left/right/stay, T=20T=20). Transitions: intended action with probability 0.90.9; otherwise

6 × 6 gridworld environment

Figure 1. The 6×66\times6 gridworld environment. Start (red, SS) at (5,0)(5,0); wall at x=2x=2 with three impassable cells (black) and three open gap cells s1,s2,s3s_1,s_2,s_3 (orange) that every route must cross; three reach targets (green, TT) and one reward-only target (blue, RR), both past the wall.

a uniformly random other action executes instead (probability 0.1/40.1/4 each). Moves into a wall cell, or off the grid, leave the agent in place. Start: (5,0)(5,0). A wall at x=2x=2 separates the swarm from three reach targets T={(0,0),(0,3),(0,4)}\mathcal{T}=\{(0,0),(0,3),(0,4)\} (reward 0.50.5 each) and one reward-only target (0,5)(0,5) (reward 1.01.0, not in T\mathcal{T}): higher reward, but not reach-designated, mirroring the reward/safety tension of the reach-avoid setting considered here. The wall has three physically impassable cells (2,0),(2,2),(2,4)(2,0),(2,2),(2,4) and three openings (2,1),(2,3),(2,5)(2,1),(2,3),(2,5); every route from the start to any target must pass through one of these openings.

Rather than one avoid constraint, we consider three independent per-cell instances of the avoid clause in (37) (and its Cantelli counterpart (32c)), tracking each cell’s instantaneous occupancy (congestion): for opening ii, P(μtN(si)>0.30)≤0.40\mathbb{P}(\mu_t^N(s_i)>0.30)\le0.40, i.e. βu,i=0.30\beta_{u,i}=0.30, δu,i=0.40\delta_{u,i}=0.40 ((1−δu,i)/δu,i=1.5≈1.22\sqrt{(1-\delta_{u,i})/\delta_{u,i}}=\sqrt{1.5}\approx1.22), which means the probability that more than 30% of agents occupy the same opening simultaneously is at most 40%. Reach parameters: αr=0.3\alpha_r=0.3, δr=0.1\delta_r=0.1 (κr=3\kappa_r=3), which means with probability at least 90%, at least 30% of the agents reach the target.

Table 1 reports the surrogate Cantelli margins rm,amr_m,a_m at the t∗t^{*} selected by each method, together with Monte Carlo estimates over 500 trials (fleet sizes N∈{10,20,50,100}N\in\{10,20,50,100\}), using Algorithm 1 with the LP-based warm start. P^v\hat{P}_v reports the maximum over the three per-cell violation rates. The target values are P^reach≥0.90\hat{P}_{\mathrm{reach}}\ge0.90 and P^v≤0.40\hat{P}_v\le0.40.

MF-LP (baseline)SCA (proposed)
NNJ^\hat{J}P^r\hat{P}_rP^v\hat{P}_vemp. met?J^\hat{J}P^r\hat{P}_rP^v\hat{P}_vrm/amr_m/a_m
109.390.91✓0.91\checkmark0.38✓0.38\checkmark✓\checkmark9.381.00✓1.00\checkmark0.40✓0.40\checkmark−0.108✓/−0.194✓-0.108\checkmark/-0.194\checkmark
209.380.95✓0.95\checkmark0.39✓0.39\checkmark✓\checkmark8.971.00✓1.00\checkmark0.12✓0.12\checkmark+0.029✓/+0.000+0.029\checkmark/+0.000
509.371.00✓1.00\checkmark0.44×0.44\times×\times9.231.00✓1.00\checkmark0.08✓0.08\checkmark+0.000/+0.000+0.000/+0.000
1009.381.00✓1.00\checkmark0.47×0.47\times×\times9.281.00✓1.00\checkmark0.12✓0.12\checkmark+0.090/+0.000+0.090/+0.000

Table 1. Gridworld results. rmr_m, ama_m: surrogate Cantelli margins (≥0\ge0 indicates that the surrogate condition is satisfied). J^\hat{J}: empirical mean total reward. P^r\hat{P}_r: empirical reach probability. P^v\hat{P}_v: maximum empirical per-cell avoid violation rate. Emp. met? indicates whether both empirical reach and avoid requirements are met.

Key findings. (1) SCA achieves positive Cantelli margins and stays under budget (P^v≤0.12\hat{P}_v\le0.12) for N≥20N\ge20. At N=10N=10, the empirical reach rate is 100% and the empirical per-cell violation rate is also 40%. However, rm=−0.108r_m=-0.108 and am=−0.194a_m=-0.194 mean that the surrogate Cantelli conditions are not satisfied. This reflects the conservatism of the distribution-free Cantelli bound: the empirical trials meet both requirements even though the surrogate test does not.

In comparison, the MF-LP violation rate does not decrease with NN, rising from 0.38 at N=10N=10 to 0.47 at N=100N=100. This is because the MF-LP’s mean trajectory sits exactly at the boundary, μˉt(si)=βu,i=0.30\bar{\mu}_t(s_i)=\beta_{u,i}=0.30. By the central limit theorem, the occupancy μtN(si)\mu^N_t(s_i) is approximately Gaussian for large NN, and because a Gaussian is symmetric about its mean, P(μtN(si)>βu,i)≈50%\mathbb{P}(\mu^N_t(s_i)>\beta_{u,i})\approx50\%. Lastly, for N≥20N\geq20, the SCA reward is within 5% of the MF-LP reward: the three reach targets give SCA freedom to redistribute reward-collection time without sacrificing much of the safety margin.

EV-Charging Aggregator

Our second case study is an EV-charging application in which the avoid constraint is a transformer capacity limit on the aggregate action, i.e. on the occupation measure ztNz^N_t itself.

Environment. States S={0,…,10}\mathcal{S}=\{0,\ldots,10\} are state-of-charge (SOC) bins in 10% increments; the target set is T={8,9,10}\mathcal{T}=\{8,9,10\} (SOC ≥80%\geq80\%). Three actions: fast charging (reward 3; advances SOC by 2 bins w.p. 0.6, else 1 bin), slow charging (reward 1; advances by 1 bin w.p. 0.9, else unchanged), and idle/no-charging (reward 0; SOC unchanged deterministically). SOC 10 is absorbing. All agents start at SOC 0. The policy feature vector is ϕ(s,μ)=[1,s/10,μ(T)]\phi(s,\mu)=[1,s/10,\mu(\mathcal{T})]: a bias, normalized SOC, and a global density-feedback feature reporting how much of the fleet has already reached the target. Rather than bounding how many agents occupy an unsafe state, the operational constraint here is that, with probability at least 1−δu1-\delta_u, no more than a fraction βu\beta_u of the fleet may fast-charge simultaneously, at any time. Define the empirical occupation measure as ztN(s,a):=N−1∑i=1N1[Xti=s,Ati=a]z^N_t(s,a):=N^{-1}\sum_{i=1}^{N}\mathbf{1}[X^i_t=s,A^i_t=a], the fraction of agents in state ss taking action aa at time tt. With cF(s,a)=1[a=fast]c_F(s,a)=\mathbf{1}[a=\mathrm{fast}],

P(cFTztN≤βu)≥1−δu,∀t.(44)\mathbb{P}(c_F^\mathsf{T}z^N_t\leq\beta_u)\geq1-\delta_u,\qquad\forall t. \tag*{(44)}

For the aggregate-action constraint (44), we use the occupation-measure variance approximation in Appendix, with c=cFc=c_F. The surrogate Cantelli condition and SCA subproblem then use Gt(k)G^{(k)}_t, the Jacobian of ztz_t, for this constrained quantity. The following parameters are used: T=12T=12, αr=0.8\alpha_r=0.8, δr=0.1\delta_r=0.1 (κr=3\kappa_r=3), βu=0.5\beta_u=0.5, δu=0.3\delta_u=0.3 (κu=1.53\kappa_u=1.53). Unlike in the gridworld case study, the reach time is fixed at t∗=T=12t^*=T=12 because the requirement is that at least 80% of the fleet attain an SOC of at least 80% by the terminal time. The avoid/congestion constraint is then active over the entire charging window.

Key findings. (1) The MF-LP maximum per-time-step violation rate remains near the CLT-predicted 50% level (0.45–0.52) across all tested fleet sizes, which is a property of the LP’s mean-only formulation. (2) SCA uses the empirical reach rate is 100% and the empirical per-cell violation rate is also 40%. However, rm=−0.108r_m=-0.108 and am=−0.194a_m=-0.194 mean that the surrogate Cantelli conditions are not satisfied. This reflects the conservatism of the distribution-free Cantelli bound: the empirical trials meet both requirements even though the surrogate test does not.

NN\multicolumn{5}{c}{MF-LP (baseline)}\multicolumn{5}{c}{SCA (proposed)}
NNJ^\hat{J}P^r\hat{P}_rP^v\hat{P}_vemp. met?J^\hat{J}P^r\hat{P}_rP^v\hat{P}_vrm/amr_m/a_m
2019.111.00✓0.45××17.621.00✓0.27✓+.138ᵒ/−.134ᵒ
5019.091.00✓0.49××17.561.00✓0.06✓+.196ᵒ/+ .000ᵒ
10019.091.00✓0.52××17.991.00✓0.08✓+.199ᵒ/+ .000ᵒ
20019.091.00✓0.51××18.311.00✓0.07✓+.200ᵒ/+ .000ᵒ

Table II. EV-charging results. rm,amr_m,a_m: surrogate Cantelli margins (≥0\geq0 indicates that the surrogate condition is satisfied), with ama_m computed using (39). J^\hat{J}: empirical mean total reward. P^r\hat{P}_r: empirical reach probability. P^v\hat{P}_v: maximum empirical per-timestep marginal avoid violation rate. Emp. met? indicates whether both empirical requirements (P^r≥0.90\hat{P}_r\geq0.90 and P^v≤0.30\hat{P}_v\leq0.30) are met.

the occupation-measure variance approximation in (39). It satisfies the surrogate conditions for N≥50N\geq50 (am≈0a_m\approx0, P^v≤0.08\hat{P}_v\leq0.08 at N=50,100,200N=50,100,200). As NN grows, the aggregate charging fraction concentrates around its mean, reducing the uncertainty margin required by the surrogate constraint. For N≥50N\geq50, the observed violation rate remains at or below 0.08. Figure 2 illustrates the corresponding mean charging profiles: the MF-LP fast-charging fraction sits at the βu=0.5\beta_u=0.5 limit, whereas the SCA fraction remains around 0.42. We also observe that SCA’s slow-charging fraction is higher than MF-LP’s, especially at earlier timesteps: because SCA’s average fast-charging fraction is lower, it must rely more on slow-charging throughout to still satisfy the reach constraint.

Figure 2. Aggregate fast-charging, slow-charging, and idle fractions over time (summing to 1 at every tt), MF-LP’s optimal solution (top) versus the SCA solution at N=100N = 100 (bottom). MF-LP saturates the βu=0.5\beta_u = 0.5 cap at every timestep and avoids slow-charging until the departure deadline forces it (t=9t = 9–1111); SCA holds a margin below the cap throughout.

Lastly, as an ablation study, we tested replacing the scalar feature μ(T)\mu(\mathcal{T}) with the full density vector μ∈R∣S∣\mu\in\mathbb{R}^{|\mathcal{S}|} (raising nfeatn_{\mathrm{feat}} from 3 to 2+∣S∣=132+|\mathcal{S}|=13, and θ\theta from 1,188 to 5,148 parameters). The two feature designs produced similar results, so we omit the full-density results.

Computational performance. On an Apple M1 Pro with 16 GB RAM, the gridworld policy has 18,000 parameters and uses at most 25 SCA iterations for each of up to three candidate reach times. Including SCA and the 500-trial evaluations of both methods, the runtime per fleet size was 53–174 s. The EV policy has 1,188 parameters and uses one fixed reach time; the corresponding runtime was 12–15 s. The experiments used Python 3.14, JAX 0.11, and CVXPY 1.9.

Conclusion

We presented a policy synthesis framework for chance-constrained reach-avoid control of finite-NN swarms on discrete MDPs. The proposed method optimizes a density-feedback policy via Sequential Convex Approximation over a sequence of SOCPs for constrained policy gradient updates. In both case studies, the MF-LP baseline’s mean-only solution lies on the active constraint boundary, causing its violation probability to approach approximately 50% rather than vanish as NN increases. The standard-deviation penalties in the SCA constraints decrease at rate O(1/N)O(1/\sqrt{N}), reducing conservatism for larger populations. Future work includes extending this approach to true mean-field-type MDPs, where the transition kernel and reward function are coupled to the population’s empirical density, and to chance-constrained finite-NN MDPs with common noise.

Variance of Aggregate Occupation Measures

For a linear statistic Yt=cTZtNY_t = c^\mathsf{T}Z_t^N of the empirical occupation measure, where c∈R∣S∣∣A∣c \in\mathbb{R}^{|S||A|}, define

hc(μ):=∑s,ac(s,a)πθt(a∣s,μ)μ(s),h_c(\mu) := \sum_{s,a} c(s,a)\pi_{\theta_t}(a \mid s,\mu)\mu(s),
vt(s,c):=Var⁡a∼πθt(⋅∣s,μˉt)[c(s,a)].v_t(s,c) := \operatorname{Var}_{a \sim\pi_{\theta_t}(\cdot\mid s,\bar{\mu}_t)}[c(s,a)].

Conditioned on μtN\mu_t^N, agents at each state choose actions independently, so their action counts have multinomial distributions. Applying the law of total variance and linearizing the conditional mean hch_c around μˉt\bar{\mu}_t gives

Var⁡[Yt]≈1N∑sμˉt(s)vt(s,c)+∇hc(μˉt)TΣ^t∇hc(μˉt),(45)\operatorname{Var}[Y_t] \approx\frac{1}{N}\sum_s \bar{\mu}_t(s)v_t(s,c) + \nabla h_c(\bar{\mu}_t)^\mathsf{T}\widehat{\Sigma}_t\nabla h_c(\bar{\mu}_t), \tag*{(45)}

where Σ^t\widehat{\Sigma}_t is the state-density covariance approximation from Proposition 1. The first term is the conditional action-sampling variance; the second propagates state-density fluctuations through the density-dependent conditional mean. Define σ^t(c)\widehat{\sigma}_t(c) as the square root of the right-hand side of (39). For the EV-charging example, c=cFc = c_F selects the fraction of agents taking the fast-charging action.

References

  1. [1]B. Açıkmeşe and D. S. Bayard, “A Markov chain approach to probabilistic swarm guidance,” in Proc. ACC, 2012, pp. 6300–6307.
  2. [2]N. Demir, U. Eren, and B. Açıkmeşe, “Decentralized probabilistic density control of autonomous swarms with safety constraints,” Autonomous Robots, vol. 39, no. 4, pp. 537–554, 2015.DOI
  3. [3]M. El Chami, E. Y. Yu, and B. Açıkmeşe, “Convex synthesis of randomized policies for controlled Markov chains with density safety upper bound constraints,” in Proc. ACC, 2016, pp. 6290–6295.
  4. [4]X. Yang, Y. Hu, H. Gao, K. Ding, Z. Li, P. Zhu, Y. Sun, and C. Liu, “Risk-aware non-myopic motion planner for large-scale robotic swarm using CVaR constraints,” in Proc. IROS, 2024, pp. 5784–5790.arxiv.org/abs/2402.16690
  5. [5]S. Wu Fung and L. Nurbekyan, “Mean-field control barrier functions: A framework for real-time swarm control,” in Proc. ACC, 2025.arxiv.org/abs/2409.18945
  6. [6]D. Žikelić, M. Lechner, T. Henzinger, and K. Chatterjee, “Learning control policies for stochastic systems with reach-avoid guarantees,” in Proc. AAAI, 2023, pp. 11926–11935.
  7. [7]N. Bäuerle, “Mean field Markov decision processes,” Appl. Math. Optim., vol. 88, art. 12, 2023.
  8. [8]N. Gast and B. Van Houdt, “A refined mean field approximation,” Proc. ACM Meas. Anal. Comput. Syst., vol. 1, no. 2, art. 33, 2017.
  9. [9]K. Okamoto, M. Goldshtein, and P. Tsiotras, “Optimal covariance control for stochastic systems under chance constraints,” IEEE Control Syst. Lett., vol. 2, no. 2, pp. 266–271, 2018.arxiv.org/abs/1804.02829
  10. [10]M. Farina and R. Scattolini, “Model predictive control of linear systems with multiplicative unbounded uncertainty and chance constraints,” Automatica, vol. 70, pp. 258–265, 2016.DOI
  11. [11]B. Doerr and R. Linares, “Control of large swarms via random finite set theory,” in Proc. ACC, 2018, pp. 2904–2909.DOI
  12. [12]J.-M. R. Sary and P.-L. Lions, “Mean field games,” Japanese J. Math., vol. 2, pp. 229–260, 2007.
  13. [13]M. Huang, R. P. Malhamé, and P. E. Caines, “Large population stochastic dynamic games: closed-loop McKean-Vlasov systems and the Nash certainty equivalence principle,” Commun. Inf. Syst., vol. 6, no. 3, pp. 221–252, 2006.
  14. [14]Y. Yang, R. Luo, M. Li, M. Zhou, W. Zhang, and J. Wang, “Mean field multi-agent reinforcement learning,” in Proc. ICML, 2018, pp. 5571–5580.arxiv.org/abs/1802.05438
  15. [15]J.-P. Fouque, M. Laurière, and M. Zhang, “Convergence of actor-critic learning for mean field games and mean field control in continuous spaces,” arXiv:2511.06812, 2025.arxiv.org/abs/2511.06812
  16. [16]A. Angiuli, J.-P. Fouque, and M. Laurière, “Unified reinforcement Q-learning for mean field game and control problems,” Math. Control Signals Syst., vol. 34, pp. 217–271, 2022.
  17. [17]R. Carmona, M. Laurière, and Z. Tan, “Linear-quadratic mean-field reinforcement learning: convergence of policy gradient methods,” arXiv:1910.04295, 2019.
  18. [19]E. Bayraktar, N. Bäuerle, and A. D. Kara, “Finite approximations for mean field type multi-agent control and their near optimality,” Appl. Math. Optim., vol. 92, art. 7, 2025.arxiv.org/abs/2211.09633
  19. [20]N. Saldi, T. Başar, and M. Raginsky, “Approximate Markov-Nash equilibria for discrete-time risk-sensitive mean-field games,” Math. Oper. Res., vol. 45, no. 4, pp. 1596–1620, 2020.DOI
  20. [21]V. Sivashankar, J. Pilipovsky, M. Oishi, and P. Tsiotras, “Distribution steering for discrete-time linear systems with general disturbances using characteristic functions,” in Proc. ACC, 2022, pp. 4183–4190.
  21. [22]C. Sinigaglia, A. Manzoni, F. Braghin, and S. Berman, “Robust optimal density control of robotic swarms,” Automatica, vol. 176, art. 112218, 2025.arxiv.org/abs/2205.12592
  22. [23]M. Jusup, B. Pásztor, T. Janik, K. Zhang, F. Corman, A. Krause, and I. Bogunovic, “Safe model-based multi-agent mean-field reinforcement learning,” in Proc. 23rd Int. Conf. Autonomous Agents and Multiagent Systems (AAMAS), 2024, pp. 973–982.
  23. [26]R. Couillet, S. M. Perlaza, H. Tembine, and M. Debbah, “A mean field game analysis of electric vehicles in the smart grid,” in Proc. IEEE INFOCOM Workshops, 2012, pp. 79–84.DOI

Paper details

vlnc:W_598fd66v
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Engineering

Not recorded for this paper

View statement
Looking for related papers…
Contents