Manuscript Offprint
arXiv:2610.41548Contact-based optimization for collision-free motion planning for a million robots
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Jan Kamm*, Antonio Terpin*, Raffaello D'Andrea

Figure 1. Sequential contact insertion. (a) Initialization with unconstrained trajectories. (b) Algorithm loop: detect separation violations, insert a contact, and solve the algebraic system until collision-free. Colored tubes in (a,b) show planar robot trajectories in space-time, with time as the vertical axis; black dots mark contacts. (c) Full spatial trajectories for robots moving from a grid to a double helix. Blue and rust identify the two target strands.
https://github.com/jankammeth/sci
https://pypi.org/project/sci-solver/
Abstract—Multi-agent robotic systems have attracted growing interest in recent years, with applications ranging from coordinated drone shows to autonomous operations on land, in the air, and on water. At the planning level, robot motion is often modeled using double-integrator dynamics (with low-level controllers handling the physical dynamics during execution) with a minimum-energy objective subject to collision-avoidance constraints and limits on position, velocity, and acceleration. The complexity of the problem resides in the constraints, which couple the trajectories and make the optimization problem nonconvex. Existing numerical approaches typically discretize and optimize entire trajectories, which becomes expensive for large fleets. We exploit the structure of optimal trajectories by organizing optimization around contacts, at which robots reach the minimum allowed separation. We formulate a coupled algebraic system in contact variables and reconstruct trajectories analytically between contacts. Our algorithm, sequential contact insertion (SCI), starts from unconstrained trajectories, inserts contacts at separation violations, and jointly adjusts their times and states. Numerical experiments demonstrate planning for one million robots in minutes and thousands of robots in fractions of a second. On problems feasible for a fixed-grid sequential convex programming (SCP) baseline, SCI achieves median speedups of several orders of magnitude at matching solution accuracy.
I. INTRODUCTION
Multi-agent robotic systems have attracted growing interest in recent years, with applications ranging from coordinated
drone shows to autonomous operations on land [26], in the air [1], and on water [17]. Planning collision-free motion for a robot fleet is difficult because each robot's trajectory constrains the motion of the others. We consider transitions between prescribed initial and final states over a fixed time horizon with double-integrator dynamics, a squared-acceleration objective, collision-avoidance and box constraints on position, velocity, and acceleration. This model is commonly used in the literature for fleet motion planning [1, 3, 4, 17, 18], typically paired with low-level controllers that handle the physical dynamics during execution. The complexity of the problem resides in the pairwise separation constraints that make the joint optimization problem nonconvex. The problem is therefore often solved numerically [12, 15, 21, 23, 24, 25], with sequential convex programming (SCP) as a popular choice [1, 9, 14, 20, 27].
A different route to efficient planning, and the one explored in this paper, is to exploit the structure of optimal trajectories. State-constrained optimal control supplies conditions for unconstrained and constrained trajectory pieces and for matching them [6, 13]. Shooting methods use these conditions to construct a finite system of equations for these pieces and the times at which they meet [6]. For collision avoidance, Beaver et al. [4] derive such matching conditions for one agent relative to a prescribed reference trajectory. For single-robot planning around fixed obstacles, Beaver, Tron, and Cassandras [5] solve trajectory equations within a search over obstacle-vertex sequences. For fleets, Beaver and Malikopoulos [3]
- These authors contributed equally to this work. Corresponding author: Jan Kamm (jakamm@ethz.ch). All authors are with the Institute for Dynamic Systems and Control, ETH Zurich, Zurich, Switzerland.
solve a square algebraic system for each robot's trajectory while holding higher-priority trajectories fixed. Finally, Kamm et al. [16] completely characterize optimal two-robot motion with resting endpoints for the squared-acceleration objective considered here. We exploit this characterization within our numerical algorithm to construct solutions for larger fleets.
In this work, we formulate fleet planning in terms of pairwise contacts, at which robots reach the prescribed minimum separation. The stationarity conditions yield a coupled algebraic system for the contact times and states, from which the trajectories between contacts are reconstructed analytically. The contact graph decomposes this system into independent groups of interacting robots. Our approach accounts for position, velocity, and acceleration box constraints. Sequential contact insertion (SCI) starts from independent robot trajectories, inserts contacts at separation violations, and jointly adjusts their times and states. Figure 1 illustrates the algorithm and a grid-to-double-helix transfer for robots. We scale SCI to robots, which is, to our knowledge, a scale unprecedented in the literature. For fleet sizes amenable to existing methods, SCI obtains median speedups of several orders of magnitude over an SCP baseline at matching accuracy.
A. Fleet model
Consider robots in , , and a fixed time horizon . Robot has position and prescribed initial and terminal states and . Let be the prescribed minimum separation distance between any two robots. Throughout, we assume that the endpoint configurations are strictly separated: for and . Componentwise position, velocity, and acceleration limits are prescribed by constant, nonempty boxes , , respectively; the bounds and are vectors in , , and the inequalities are understood componentwise.
We use double-integrator dynamics and optimize position trajectories with absolutely continuous velocities and square-integrable accelerations. We seek the fleet trajectory that minimizes total squared acceleration subject to endpoint states, collision avoidance, and box bounds:
The constraints hold for every robot . Separation, position, and velocity bounds hold for all ; acceleration bounds hold almost everywhere.
B. Barycentric decomposition
Define the barycenter and centered positions . The pairwise relative positions determine separation, while the acceleration cost splits as . The boxes constrain and its derivatives, coupling barycentric and centered motion. When all boxes equal , the barycenter minimizes its own squared-acceleration cost with fixed endpoint states. At every local minimum of this specialization, it is the cubic Hermite interpolant of the mean endpoint positions and velocities [8, Section 2.5].
C. Necessary conditions
For each pair, define the active set . An isolated point of this set is an isolated contact; an interval of positive length represents sustained contact. For the continuous collision, position, and velocity constraints, the Riesz representation theorem identifies dual multipliers with finite Radon measures. Collision multipliers satisfy and . For , write , where the nonnegative component measures are supported on the corresponding active lower and upper bounds by complementary slackness [13]. At a local minimum admitting normal multipliers, stationarity reads
where is an auxiliary momentum and denotes the distributional derivative on .
Unrestricted boxes: When all boxes equal , the state-bound multipliers vanish and , reducing (2) to
This extends the two-robot contact conditions of Kamm et al. [16] to fleets. Each pair contributes equal and opposite terms to its two robots; the sum couples all encounters involving a robot. On an interval without contacts involving robot , the right-hand side vanishes and , so its motion is cubic.
The acceleration is continuous, and the jerk , taken as the right-continuous representative of , has one-sided limits. Write for a jump between these limits. Then, at an isolated contact involving only the pair , define the contact weight and set , , and for all other robots. We have that adjacent trajectory pieces satisfy the matching conditions and , jerk jumps are equal and opposite along the line joining two robots, and at every interior contact time .
III. CONTACT-BASED TRAJECTORY RECONSTRUCTION
A. Finite multiplier representation
We approximate the collision multipliers by a finite list of point contacts. Contact has a prescribed pair , time , and weight : . Here
is the unit Dirac measure at . We approximate position multipliers by atoms, and velocity multipliers by atoms and constant interval densities.
The contact graph has one vertex per robot and an edge for each pair in the contact list. Its connected components are the contact components. Box bounds act on individual robots, so they preserve this decomposition.
To start, take all boxes to be . Within each component, use local robot labels and distinct contact times . With the component's cubic Hermite barycenter fixed, the coordinates , , determine its trajectories. Set . Then , , and for .
A contact between robots at time has relative state and , with and . These conditions enforce contact and tangency.
Each contact vector stores , , , , and the states of the N-2 remaining independent relative coordinates:
The omitted coordinate follows from and . has scalar entries; normalization and tangency leave degrees of freedom. Between consecutive contact times, each is reconstructed by cubic Hermite interpolation [16]. The first and last pieces use the prescribed endpoint states. Thus determines the component trajectory, with continuous position and velocity.
B. Matching equations
In the relative coordinates , the conditions for acceleration continuity and jerk jumps from Section II-C become and . When , continuity of acceleration and jerk makes the adjoining pieces of the same cubic.
Appending normalization and tangency to these conditions gives , a system of scalar equations in as many unknowns. The equations at involve only the two adjacent cubic pieces, hence only , its neighboring contacts, and the fixed endpoint data. Accordingly, the Jacobian of F is block tridiagonal, with blocks of size .
Consider stationary trajectories admitting multipliers with finite support and at most one pair with a nonzero multiplier per instant in each contact component.
Proposition 1 (Contact representation): The continuously feasible reconstructions of roots of with are exactly the stationary fleet trajectories in this class.
Proof: For a continuously feasible reconstruction of a root, the reconstruction formulas and matching conditions give continuous acceleration and the jerk jumps of Section II-C. Its fourth distributional derivative is therefore the atomic right-hand side of (3), with nonnegative weights and support on contacts. Conversely, summing (3) over each component cancels the multiplier contributions, fixing its barycenter to the prescribed Hermite cubic. Between atoms, trajectories are cubic and recovered by Hermite interpolation. At atoms, feasibility gives tangency and the stationarity equation gives the matching conditions. Reading off contact states and weights yields a root reconstructing the trajectory.
Sustained contact: If the relative position changes during sustained contact, the motion cannot be represented by finitely many cubic pieces. Approximating it with vanishing error requires growing contact counts. SCI approximates sustained contact by clusters of point contacts, checking separation between them to a prescribed tolerance.
Box bounds: To include box bound, let for , where the nonnegative component measures are supported on the corresponding active lower and upper bounds. With auxiliary momentum , stationarity gives and . Position and velocity bounds modify the momentum; acceleration bounds clip it componentwise [2, Equation 6]. We approximate collision and position multipliers by atoms, and velocity multipliers by atoms and constant interval densities. The resulting momenta are piecewise affine; projection and integration give piecewise-polynomial trajectories.
IV. ALGORITHM: SCI
Contact removal provides a correction mechanism for greedy insertion. Algorithm 1 uses absolute tolerances for matching and endpoint states, for multiplier nonnegativity, and for separation. The algorithm returns unresolved if matching or insertion fails or the time budget is exhausted. Success means that the endpoint, matching, multiplier-sign, and continuous separation checks pass within these tolerances.
Algorithm 1 SCI without box bounds
Input: Endpoint states,
Output:
1:
2: loop
3: loop
4:
5:
6: if then return
7: if or then break
8:
9:
10: end loop
11:
12: if then return
13:
14: if then return
15: end loop
Grouping: GROUPS(c) maintains contact components incrementally. Insertion merges components; removal checks for splits locally. Only affected components are rebuilt and solved. Isolated robots retain their unconstrained cubics.
Matching: MATCH solves each group's system by damped Newton iteration with an analytical block-tridiagonal Jacobian and banded linear solves. Backtracking decreases the residual while preserving contact order. Recovery eliminates intermediate states using the cubic Green function [16] and solves for with Powell's hybrid method [19] and trust-region least squares. Further recovery uses radius continuation and energy-based initialization. Repeated convergence to roots with negative multipliers triggers shifted deflation [11] to seek another root. Matching requires and absolute componentwise endpoint-state errors at most in each group.
Bounded correction: For fixed support times and unit collision normals, we minimize under endpoint conditions, acceleration boxes, and selected linear state and separation inequalities. The separation support allows trajectories to move away from an inserted contact. We solve the convex subproblem through its dual over endpoint and non-negative inequality multipliers. Supports with zero multipliers are removed; continuous violations supply new supports, and collision normals are updated between solves. Velocity intervals impose the average bound , , whose multipliers represent constant densities on . Acceptance requires endpoint accuracy and continuous checks of every box bound and pairwise separation.
Detection: CLOSEST returns the closest pair across the fleet, its time , and distance . The convex-hull property of Bernstein coefficients [10] bounds motion over adaptively subdivided time intervals. Bounding-volume hierarchies with dual-tree traversal prune distant robot pairs [7]. For surviving pairs, we minimize squared distance over segment endpoints and stationary points.
Insertion: INSERT initializes a contact from the trajectory with . Coincident insertion times are offset within the neighboring time gap. We insert violations deepest first, with each contact component participating at most once per batch.
V. NUMERICAL EXPERIMENTS
Unless stated otherwise, the experiments use planar fleets with and zero endpoint velocities. We sample initial and final configurations independently in a disk of radius , rejecting configurations with pairwise distances below 0.8. The horizon is . The saved measurements were obtained on an Apple M3 Pro with 36GB of memory. We use the current SCI implementation and archived SCP measurements on the same instances. The scaling and baseline comparisons use unrestricted boxes; Experiment 7 tests finite position, velocity, and acceleration limits.
The baseline follows the sparse direct transcription of Kamm et al. [17, Section III-C], with piecewise-constant accelerations on equal intervals and OSQP [22] for the quadratic subproblems. In these comparisons, both methods start from the unconstrained solution. Unless varied below, , or 0.2% of . For cubic contact matching, , , and the Newton iteration limit

Figure 2. Grid-to-double-helix transition (Experiment 1). Snapshots for ; trails show the preceding 20 s. Top: contact counts, robots in contacts, and computation time versus fleet size, with one run per size.

Figure 3. Fleet-size study over 50 seeds per size (Experiment 2). Top: computation time for solver-converged runs. Figure 4 compares runtimes at matched continuous-time separation targets. Bottom: final SCI contact counts, maximum per pair (red, left halves) and total (blue, right halves). Widths show estimated densities; horizontal ticks mark medians.
is 100. The baseline uses at most 20 outer iterations with position-change tolerance ; OSQP uses absolute tolerance , zero relative tolerance, and at most iterations. The comparison studies use a 300s time limit.
Success requires solver convergence, satisfaction of the imposed box bounds, and pairwise separation of at least : throughout for SCI, and at the enforced grid points for SCP. The continuous-time separation success rate counts successful runs whose piecewise-polynomial trajectories also meet this bound throughout . Both rates use all attempted instances, including failures and timeouts, in their denominator; these values coincide for SCI. In plots with

Figure 4. Continuous-time separation success rates over 50 instances at , as a function of runtime budget up to 300 s (Experiment 3). Line styles identify targets relative to .
shaded bands, lines show medians; darker and lighter bands show the interquartile and central 95% ranges across seeds.
Experiment 1 (A million robots). We compute transitions from a planar grid to a double helix for fleets of 500 to 1,000,000 robots (Figure 2). The workspace grows with fleet size while the initial grid spacing remains 2m. We use a horizon of 100s and a separation tolerance of 1 cm. Results. For 1,000 robots, we compute trajectories with 118 contacts in 0.124 s. For robots, we obtain 151,071 contacts in 525.4 s.
Experiment 2 (Fleet size). We study the effect of fleet size on runtime and success rate, using 50 seeds for each . Results. SCI has a 100% success rate across 500 instances. At , its median runtime is 0.009 s, with medians of 6 final contacts and 65 matching unknowns across the contact components (Figure 3). At , the baseline has a 98% success rate and median runtime 106.6 s; its continuous-time separation success rate is 0%. Its median continuous-time separation deficit is 2.8% of . At , SCI computes trajectories 12289 times faster than SCP.
Experiment 3 (Separation accuracy and cost). For 50 instances at , we set , corresponding to 2%, 0.2%, and 0.02% of . The baseline is run at with OSQP absolute tolerance . For each instance and target, the continuous-time attainment curve credits the baseline with its fastest successful tested grid whose trajectory meets the continuous-time separation target, without charging for the other resolutions. Results. Across a hundredfold tightening of the separation tolerance, SCI retains a 100% success rate and a nearly unchanged median runtime of 0.006 s, with a median contact count of 4. Isolated contacts satisfy the same matching equations at every separation tolerance; approximations of sustained contact require denser contact clusters as the tolerance tightens. By contrast, SCP requires finer time grids, and its continuous-time separation success rate falls from 96% to 40% and 14% at the three targets (Figure 4). At the 2% target, the median speedup on the 45 interacting instances where both methods meet continuous-time separation is 3296. At 0.2%
and 0.02%, median speedups are 43122 (17 instances) and 83487 (4 instances). Against the coarsest successful baseline grid at each target, the maximum relative cost difference across 75 paired successes is 0.019%.
Experiment 4 (Congestion). This test probes the sparse and densely congested extremes of the sampled fleets. At fixed and , we scale the workspace by , with 50 seeds per scale. Results. As decreases from 1.5 to 0.4, the median SCI contact count increases from 1 to 5 and runtime from 0.002 s to 0.009 s. The baseline exhibits a similar trend, increasing from 1.938 s to 11.578 s. Success rates are 100% for SCI and 98% for the baseline across 300 instances. The baseline's continuous-time separation success rate is 32.7%.
Experiment 5 (Algorithmic ablations). Using the same 50 seeds at and , we replace the analytical Jacobian with finite differences, or insert at the earliest violating local distance minimum instead of the worst violation. All other settings remain fixed. Runtime ratios use instances solved successfully by both the default SCI configuration and the corresponding variant. Results. At , the median runtime ratio for finite differences is 12.48; success rates are 100% for the default variant and 100% for finite differences across 150 instances. Earliest insertion has median runtime ratios of 5.91, 4.29, and 3.89 at the three workspace scales, respectively; matching stagnates on 4 of the 50 dense instances.
Experiment 6 (Spatial dimension). We test and with . Endpoints are sampled in a -dimensional ball, whose radius is calibrated on 256 separate seeds to match the planar mean number of unconstrained interacting pairs. Each is evaluated on 50 further seeds. Results. SCI succeeds on all instances. At , its median runtime stays within 0.00254–0.0035 s across dimensions. Its speedup over SCP increases with dimension (, , ), using median runtimes. At , SCP times out on 37 out of 50 instances.
Experiment 7 (Box bounds). We solve (1) with SCI on 102 instances with and feasible SCP reference trajectories. All instances impose velocity and acceleration limits; 23 also impose position limits. We compare runtimes with the same instances after removing all box bounds. Results. All 102 bounded instances pass continuous feasibility checks at tolerance . The median runtime is the same, 0.20 s.
VI. CONCLUSION
By optimizing contacts, SCI plans motion for a million robots in minutes and for thousands in fractions of a second. Our method reconstructs trajectories analytically and checks collision avoidance and position, velocity, and acceleration bounds continuously. We hope that our work will inspire further research and create new possibilities in multi-agent applications.
REFERENCES
[1] Federico Augugliaro, Angela P. Schoellig, and Raffaello D'Andrea. Generation of collision-free trajectories for a quadcopter fleet: A sequential convex programming approach. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2012.
[2] Heinz H. Bauschke, Regina S. Burachik, and C. Yalçın Kaya. Constraint splitting and projection methods for optimal control of double integrator, 2018.
[3] Logan E. Beaver and Andreas A. Malikopoulos. An energy-optimal framework for assignment and trajectory generation in teams of autonomous agents. Syst. Control Lett., art. 104670, 2020.
[4] Logan E. Beaver, Michael Dorothy, Christopher Kroninger, and Andreas A. Malikopoulos. Energy-optimal motion planning for agents: Barycentric motion and collision avoidance constraints. In 2021 American Control Conference (ACC). IEEE, 2021.
[5] Logan E. Beaver, Roberto Tron, and Christos G. Cassandras. A graph-based approach to generate energy-optimal robot trajectories in polygonal environments. IFAC-PapersOnLine, 2023.
[6] J. Frédéric Bonnans and Audrey Hermant. Well-posedness of the shooting algorithm for state constrained optimal control problems with a single constraint and control. SIAM J. Control Optim., 2007.
[7] Ryan R. Curtin, William B. March, Parikshit Ram, David V. Anderson, Alexander G. Gray, and Charles L. Isbell, Jr. Tree-independent dual-tree algorithms. In Proceedings of the 30th International Conference on Machine Learning. PMLR, 2013.
[8] Magnus Egerstedt and Clyde Martin. Control Theoretic Splines: Optimal Control, Statistics, and Path Planning. Princeton University Press, Princeton, NJ, 2010.
[9] Purnanand Elango, Dayou Luo, Abhinav G. Kamath, Samet Uzun, Taewan Kim, and Behçet Açıkmeşe. Continuous-time successive convexification for constrained trajectory optimization. Automatica, art. 112464, 2025.
[10] Rida T. Farouki. The Bernstein polynomial basis: A centennial retrospective. Comput. Aided Geom. Des., 2012.
[11] Patrick E. Farrell, Ásgeir Birkisson, and Simon W. Funke. Deflation techniques for finding distinct solutions of nonlinear partial differential equations. SIAM J. Sci. Comput., 2015.
[12] Panagiotis D. Grontas, Antonio Terpin, Efe Balta, Raffaello D'Andrea, and John Lygeros. Inlet: Optimizing hard-constrained neural networks with orthogonal projection layers. In International Conference on Learning Representations (ICLR), 2026.
[13] Richard F. Hartl, Suresh P. Sethi, and Raymond G. Vickson. A survey of the maximum principles for optimal control problems with state constraints. SIAM Rev., 1995.
[14] Kris Hauser. Semi-infinite programming for trajectory optimization with non-convex obstacles. Int. J. Robot. Res., 2021.
[15] Wolfgang Hönig, James A. Preiss, T. K. Satish Kumar, Gaurav S. Sukhatme, and Nora Ayanian. Trajectory planning for quadrotor swarms. IEEE Trans. Robot., 2018.
[16] Jan Kamm, Antonio Terpin, and Raffaello D'Andrea. A complete analytical characterization of optimal collision-free motion for two robots. Manuscript in preparation, 2026.
[17] Jan Kamm, Antonio Terpin, Raffaello D'Andrea, and Aswin Ramachandran. Motion planning for hundreds of floating robots. In 2026 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2026.
[18] Carlos E. Luis and Angela P. Schoellig. Trajectory generation for multiagent point-to-point transitions via distributed model predictive control. IEEE Robot. Autom. Lett., 2019.
[19] Michael J. D. Powell. A hybrid method for nonlinear equations. In Philip Rabinowitz, editor, Numerical Methods for Nonlinear Algebraic Equations. Gordon and Breach, London, 1970.
[20] John Schulman, Jonathan Ho, Alex Lee, Ibrahim Awwal, Henry Bradlow, and Pieter Abbeel. Finding locally optimal, collision-free trajectories with sequential convex optimization. In Proceedings of Robotics: Science and Systems IX, Berlin, Germany, 2013.
[21] Rahul Shome, Kiril Solovey, Andrew Dobson, Dan Halperin, and Kostas E. Bekris. dRRT*: Scalable and informed asymptotically-optimal multi-robot motion planning. Auton. Robots, 2020.
[22] Bartolomeo Stellato, Goran Banjac, Paul Goulart, Alberto Bemporad, and Stephen Boyd. OSQP: An operator splitting solver for quadratic programs. Math. Program. Comput., 2020.
[23] Antonio Terpin, Sylvain Fricker, Michel Perez, Mathias Hudoba de Badyn, and Florian Dörfler. Distributed feedback optimisation for robotic coordination. In 2022 American Control Conference (ACC). IEEE, 2022.
[24] Antonio Terpin, Nicolas Lanzetti, and Florian Dörfler. Dynamic programming in probability spaces via optimal transport. SIAM J. Control Optim., 2024.
[25] Wannes Van Loock, Goele Pipeleers, and Jan Swevers. B-spline parameterized optimal motion trajectories for robotic systems with guaranteed constraint satisfaction. Mech. Sci., 2015.
[26] Peter R. Wurman, Raffaello D'Andrea, and Mick Mountz. Coordinating hundreds of cooperative, autonomous vehicles in warehouses. AI Mag., 2008.
[27] Duo Zhang, Chen Liang, Xifeng Gao, Kui Wu, and Zherong Pan. Provably feasible semi-infinite program under collision constraints via subdivision. IEEE Trans. Robot., 2024.