Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Moving piles of sand
Picture two piles of sand with different shapes. To reshape the first pile into the second, you move each grain somewhere, and moving a grain far costs more than moving it close. The cheapest total effort is the earth mover’s distance, also called the Wasserstein distance.
Unlike other ways of comparing distributions, it notices how far things moved. Two piles 1 m apart are closer than two piles 1 km apart, even though neither pair overlaps at all.
Optimal transport assigns robots and drones to targets, matches stars between catalogues, compares sensor histograms, aligns point clouds and trains generative models. Its ability to measure distance between non-overlapping distributions is what made Wasserstein GANs train stably, and it underlies modern flow-matching generative models.
- 1. The earth mover's distance measures…
- 2. Shifting a distribution 2 units to the right changes its Wasserstein-1 distance from the original by…
- 3. Assigning drones to formation slots with minimum total travel is…
Level 1: Beginner
★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.Monge and Kantorovich
- Monge (1781): find a map T pushing μ to ν that minimizes . A map may not exist, for example when splitting one point mass into two.
- Kantorovich (1942): allow mass to split. Find a coupling (transport plan) with marginals μ and ν:
For discrete distributions this is a linear program over the matrix P with row sums a and column sums b. With n equal masses on each side, an optimal plan is a permutation: the assignment problem.
Wasserstein distances
. In 1-D, sort and match: , the area between the CDFs.
- 1. W₁ between samples {0, 1, 2} and {3, 4, 5}:
- 2. Kantorovich's formulation optimizes over…
- 3. In 1-D, W₁ equals…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Closed forms
- Gaussians: . In 1-D this reduces to . This is the Fréchet Inception Distance (FID) used to evaluate image generators.
- Duality (Kantorovich–Rubinstein): . WGANs (Arjovsky, Chintala and Bottou, 2017) train a critic f constrained to be 1-Lipschitz.
Why not KL or JS?
For point masses at 0 and δ, KL = ∞ and JS = ln 2 for every δ ≠ 0, so their gradient in δ is zero. decreases smoothly as the distributions approach. Generators whose samples miss the data support get no signal from JS, but do from W.
Entropic OT and Sinkhorn
Add an entropy penalty: . The solution is with Gibbs kernel . Sinkhorn’s algorithm alternately rescales rows and columns to match the marginals (Cuturi, 2013). It is fast, parallel and differentiable. As it approaches exact OT, but it converges more slowly. Work in the log domain for stability.
- 1. W₂ between N(0, 1) and N(0, 9) in 1-D:
- 2. For two point masses at different locations, JS divergence is…
- 3. Sinkhorn's algorithm alternately…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.1-D OT is sorting
For convex costs on the line, the monotone (quantile) coupling is optimal. Any crossing pair with can be uncrossed without increasing cost, by convexity. With that coupling, (swap the order of integration). ∎
Cyclical monotonicity
An optimal plan’s support is c-cyclically monotone: no permutation of matched pairs lowers the cost. With 2-cycles, . For squared Euclidean cost this becomes . Matched displacements never “cross”, which is why simultaneous straight-line flights of an optimal assignment keep their separation (Turpin, Michael and Kumar, 2014).
Brenier’s theorem
For and μ absolutely continuous, the optimal plan is a map with φ convex (Brenier, 1991). This links OT to convex analysis, PDEs (Monge–Ampère) and modern flow-matching generative models.
Exercise 3.1: W₂ between N(1, 4) and N(4, 16)
The standard deviations are 2 and 4, so .
- 1. For squared Euclidean cost, optimal maps are…
- 2. Cyclical monotonicity with 2-cycles says an optimal matching has…
- 3. In 1-D, the optimal coupling for convex cost is…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Assigning a drone swarm to a formation
40 drones parked at least 6 m apart on a 100 m field must fly straight lines into a ring of radius 30 m, all arriving together. We solve for the assignment that minimizes total squared distance exactly, with Bertsekas’ auction algorithm and ε-scaling (Bertsekas, 1988).
| Method | total squared distance | longest flight | closest approach |
|---|---|---|---|
| Optimal transport (auction) | 11 456 m² | 30.2 m | 4.41 m |
| Greedy nearest-first | 12 971 m² (+13%) | 38.5 m | 0.39 m |
| Sinkhorn, ε = 0.002 | 11 703 m² | — | — |
No pairwise swap improves the auction solution. Its trajectories keep at least apart, as the CAPT guarantee requires. Greedy leaves near-collisions. Drone light shows, multi-rover task allocation and satellite constellation reconfiguration use this kind of assignment.
Optimal transport in AI, robotics and aerospace
- Generative models: Wasserstein GANs, OT-based flow matching and Schrödinger bridges; FID for evaluation.
- Robotics: multi-robot task assignment and formation control (CAPT); point-cloud registration; comparing occupancy maps.
- Aerospace: constellation reconfiguration; matching detections to catalogues; distribution shift between simulated and real sensor data.
- ML at large: domain adaptation, the sliced Wasserstein distance for speed, and Wasserstein barycenters for averaging shapes (Peyré and Cuturi, 2019).
References
- C. Villani (2008). Optimal Transport: Old and New. Springer.
- G. Peyré, M. Cuturi (2019). “Computational optimal transport.” Foundations and Trends in ML, 11.
- M. Cuturi (2013). “Sinkhorn distances: lightspeed computation of optimal transport.” NeurIPS.
- M. Arjovsky, S. Chintala, L. Bottou (2017). “Wasserstein generative adversarial networks.” ICML.
- Y. Brenier (1991). “Polar factorization and monotone rearrangement of vector-valued functions.” Comm. Pure Appl. Math., 44.
- D. Bertsekas (1988). “The auction algorithm: a distributed relaxation method for the assignment problem.” Annals of OR, 14.
- M. Turpin, N. Michael, V. Kumar (2014). “CAPT: concurrent assignment and planning of trajectories for multiple robots.” IJRR, 33.
- Y. Lipman, R. Chen, H. Ben-Hamu, M. Nickel, M. Le (2023). “Flow matching for generative modeling.” ICLR.