This library contains four helper functions and two classes [4].
The four helper functions are compareOneToOne, compareOneToMany, compareAll, and focusArea. All the functions take in input the data and an options list. Using the options is possible to configure the Kantorivich-Wasserstein solver, so that it uses different algorithms with different parameters.
The helper functions are built on top of two main classes: Histogram2D and Solver.
Note that in non-convex maps, the algorithm builds the convex-hull of the input bins and pads the weights with zeros.
In the case of spatial histograms with weights that do not sum up to 1, all the weights can optionally be rescaled in such a way the overall sum of the weights of every single histogram is equal to 1.0: \(w_i \gets \frac{w_i}{\sum_{i=1,\dots,n} w_i}\).
This way, the spatial histograms have a natural interpretation as discrete probability measures.
For a detailed introduction on Computational Optimal Transport, we refer the reader to [3].