1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Optimal Transport Algorithms
//!
//! This module provides implementations of optimal transport distances and solvers:
//!
//! - **Sliced Wasserstein Distance**: O(n log n) via random 1D projections
//! - **Sinkhorn Algorithm**: Log-stabilized entropic regularization
//! - **Gromov-Wasserstein**: Cross-space structure comparison
//!
//! ## Theory
//!
//! Optimal transport measures the minimum "cost" to transform one probability
//! distribution into another. The Wasserstein distance (Earth Mover's Distance)
//! is defined as:
//!
//! W_p(μ, ν) = (inf_{γ ∈ Π(μ,ν)} ∫∫ c(x,y)^p dγ(x,y))^{1/p}
//!
//! where Π(μ,ν) is the set of all couplings with marginals μ and ν.
//!
//! ## Use Cases in Vector Search
//!
//! - Cross-lingual document retrieval (comparing embedding distributions)
//! - Image region matching (comparing feature distributions)
//! - Time series pattern matching
//! - Document similarity via word embedding distributions
pub use WassersteinConfig;
pub use GromovWasserstein;
pub use ;
pub use SlicedWasserstein;
/// Trait for optimal transport distance computations