Wednesday, June 8, 2022

Visualization of Optimal transport

Visualization of Optimal transport

Visualization of optimal transport

Let X={x1,...,xn}R2X=\{x_1,...,x_n\}\subset \mathbb R^2 be a set of nn locations. Each location xix_i is associated with a mass ai>0a_i>0. Let a=(a1,...,an)R+na=(a_1,...,a_n)\in \mathbb R^n_+. Similarly, define some other locations Y={y1,....ym}R2Y=\{y_1,....y_m\}\subset \mathbb R^2 and b=(b1,...,bm)R+mb=(b_1,...,b_m)\in \mathbb R^m_+. We assume that the total mass of XX and YY are equal, i.e. i=1nai=i=1mbi\sum_{i=1}^n a_i=\sum_{i=1}^m b_i.

Loosely speaking, Optimal transport is an optimal way to move masses from XX to YY so that it minimizes the distance. Note that the masses can be splitted or merged during the “migration”. In the following figures, the heat-map represents the “blurring” mass of the plane.

Code: Jupyter Notebook
Reference: Optimal Transport by Gabriel Peyré

Popular Posts