- The paper introduces a decoupled two-layer architecture that separates tracking and optimization to ensure both transient and steady-state safety.
- The method uses first-order control barrier functions and dynamic safety margins to certify safety while preserving the original KKT optimality conditions.
- Numerical results validate the approach's superiority over high-order methods by achieving safe optimal output agreement even in nonconvex environments.
Reference-Governed Distributed Safe Gradient Flow for Safe Optimal Output Agreement of Multi-Agent Systems
This paper addresses the challenge of achieving safe optimal output agreement in distributed nonlinear multi-agent systems subject to output safety constraints. Existing methods, particularly those deploying direct feedback optimization in the plant input, often necessitate high-order control barrier functions (HOCBFs) to guarantee constraint satisfaction. This approach can be tuning-sensitive, introduce undesirable equilibrium conditions, and impede convergence to the true optimum. Furthermore, ensuring transient safety during convergence as opposed to only steady-state feasibility remains a fundamental hurdle in distributed feedback optimization.
The key innovation of the paper is a reference-governed two-layer architecture. The lower layer leverages internal-model-based output regulation to provide robust tracking, while the upper layer drives distributed optimization by filtering reference gradient flows through first-order control barrier function (CBF) constraints. This separation allows the use of first-order CBFs—easier to tune and analyzable in the Lyapunov framework—to ensure both transient and steady-state output safety. Dynamic safety margins (DSMs) are constructed, certifying transient safety while preserving the original KKT geometry of the constrained static optimization problem.
The architectural overview is depicted in Figure 1.

Figure 1: Reference-governed distributed safe-gradient-flow framework.
Technical Contributions
Two-Layer Reference-Governed Architecture
The lower layer employs internal-model-based output regulators that regulate physical outputs to time-varying references. A reference-dependent Lyapunov function Vi​(χi​,gi​) is constructed for each agent, measuring the state deviation under a frozen reference. Safety is certified through dynamic safety margins (DSMs), which quantify the available energy before violating safety boundaries.
The upper layer acts as a distributed reference governor, generating reference trajectories gi​ that are steered toward the solution of a constrained distributed optimization problem. The reference trajectories are shaped by first-order CBFs applied directly to the reference dynamics, guaranteeing forward invariance of safe sets and facilitating modular small-gain analysis.
Distributed Safe Gradient Flow via Network-Sparse QPs
The upper-layer optimization is posed as a network-sparse quadratic program (QP) which, for each agent, minimizes deviation from the local cost gradient plus consensus and CBF-based constraints. Key elements of this construction:
- Agreement Enforcement: Consensus is imposed through equality constraints in the velocity of the references.
- Reference-Space CBFs: First-order CBF constraints are imposed for both steady-state output admissibility and Lyapunov-based DSMs.
- Sparsity: Only neighbor coupling appears in the QP, suiting distributed real-time computation.
The design ensures feasibility and forward invariance of all constraints, and the QP is regular whenever the KKT solution of the original static problem is regular.
Theoretical Analysis
Preservation of Steady-State Optimality
A detailed analysis is presented for the preservation of the KKT structure in the coupled dynamics. The QP constraints for reference safety and DSMs are shown to be compatible with the original problem's KKT conditions under mild technical assumptions. Specifically, the constraint set defined by the CBFs matches that of the static optimization problem, and the dynamic safety constraints do not introduce additional spurious steady-state equilibria when DSM-compatibility holds.
Lyapunov Small-Gain Convergence
The convergence of the coupled system is established via a Lyapunov small-gain theorem. The main results demonstrate:
- Transient safety is guaranteed through forward invariance of the Lyapunov and safety-DSM sublevel sets.
- Trajectories of all agents remain within the safe output set for all time.
- Asymptotic convergence to the optimal steady-state output agreement is achieved if the convexity and regularity conditions are met.
The full convergence proof is based on a composite Lyapunov function for the stacked tracking and optimization layers, utilizing quantitative input-to-output stability bounds and QP perturbation analysis.
Adaptive Tangential Objective Shaping for Nonconvex Constraints
A notable extension is provided for handling nonconvex output safety constraints. The authors identify the phenomenon of spurious stable boundary equilibria—unintended fixed points induced by CBF-QP flows near nonconvex safe set boundaries. By introducing an adaptive tangential shaping term that excites directions tangent to the boundary, the method destabilizes such equilibria and enables trajectories to escape non-optimal constraint surfaces. The adaptation law ensures that the shaping is locally activated where the descent direction aligns with the constraint normal, preserving regular KKT structure elsewhere.
Numerical Results
Comprehensive simulation studies validate the proposed method against state-of-the-art baselines, including SGF-HOCBF and projected primal-dual feedback optimization.
- SGF-HOCBF: Maintains safety during transients but may fail to converge to the true constrained optimizer if system pre-stabilization induces anisotropy, instead converging to suboptimal boundary points.
- Projected Primal-Dual Optimization: Converges to the correct steady-state solution but does not guarantee transient output safety; outputs can transiently violate safety sets.
- Proposed DSM Method: Ensures strict output safety at all times and achieves convergence to the unique KKT point even under both isotropic and anisotropic tracking layers.
Empirical results are displayed in Figure 2-Figure 3.

Figure 2: Trajectories of the SGF-HOCBF baseline under isotropic and anisotropic pre-stabilization.

Figure 4: Trajectories of the projected primal-dual feedback optimization baseline. The method handles steady-state inequality constraints, but transient output safety is not guaranteed.


Figure 5: Trajectories of the proposed DSM reference governor under isotropic and anisotropic tracking gains.


Figure 6: Average distance to the constrained optimal solution r⋆.


Figure 3: Safety diagnostics of the proposed DSM reference governor.
In scenarios involving a nonconvex circular obstacle, adaptive tangential shaping succeeds in steering the system around nonconvex-induced undesirable equilibria, achieving both safety and global optimality as shown in Figure 7.

Figure 7: Trajectories with a nonconvex circular obstacle: DSM reference governor without shaping and with adaptive tangential objective shaping.
Implications and Outlook
The reference-governed distributed safe gradient-flow paradigm provides a robust foundation for safe distributed optimization in multi-agent systems. It decouples the responsibilities of physical tracking and optimization, facilitating tractable analysis and reduced tuning sensitivity. Theoretical guarantees of optimality preservation and forward-invariance-based safety make the approach a compelling alternative to high-order feedback optimization schemes.
Practical implications span safety-critical automation domains, including multi-robot coordination, power networks, and intelligent transportation. The modularity of the architecture enables adaptation to heterogeneous agent models and time-varying network topologies with moderate adjustments. The results on nonconvex constraint handling suggest that integrating local adaptive shaping into distributed optimization can significantly improve robustness to environmental complexity.
Potential extensions include: treating inter-agent collision constraints, analysis of nonconvex optimality in distributed settings, scalability studies for large-scale networks, and real-time distributed QP implementation. The presented framework sets an analytical and algorithmic precedent for future distributed safe control and learning methods in constrained environments.
Conclusion
This work synthesizes a reference-governed, DSM-based distributed safe gradient flow algorithm for multi-agent output agreement under safety constraints. The decoupled two-layer approach preserves both transient and steady-state safety, is compatible with standard convex optimization geometry, and admits small-gain-based convergence analysis. The method outperforms prior HOCBF and primal-dual feedback optimization baselines in both safety and optimality. Preliminary nonconvex extensions demonstrate the ability to escape stable, undesirable equilibria with locally adaptive objective shaping. These developments point toward a broad class of scalable, safety-critical distributed optimization and control strategies for cyber-physical networks.