On Computing Diverse Solutions in the Earth Movers Distance

Aritra Banik, Mayank Goswami, Abhishek SahuNeurIPS 2026

TL;DR

When algorithms return multiple "diverse" options—like generating distinct wrong answers for a multiple-choice quiz—measuring diversity with standard Euclidean or Hamming distances fails to capture semantic similarity. Earth Mover's Distance (EMD) captures meaning much better, so this paper maps out the computational complexity of finding maximally diverse sets of points under EMD. While finding exact solutions is computationally brutal, the authors introduce clever geometric shortcuts that get arbitrarily close to optimal in manageable time.

What Problem Does This Paper Address?

Consider two sentences: "A guy with a red jacket is standing on a boat" and "A man wearing a lifevest is sitting in a canoe." To a human, they mean nearly the same thing. To standard distance metrics like Hamming or Euclidean distance (even over word embeddings), they look miles apart. Earth Mover's Distance (EMD)—which calculates the minimum "work" needed to pair up and move one set of points onto another—bridges this semantic gap.

Meanwhile, optimization has recently embraced the "DiverseX" paradigm: instead of giving a user one optimal solution, give them $r$ distinct solutions so they can choose based on unstated preferences, fairness, or robustness. Combining these two worlds raises a natural question: given $n$ points, how fast can we find $r$ subsets (each of size $k$) such that the minimum EMD between any pair is as large as possible? Brute force takes $\Omega(n^{kr})$ time. The authors also ask a related question useful for spotting contradictory text: given one $k$-subset, how fast can we find the single farthest $k$-subset from it?

Methods

Calculating the EMD between two known sets is a standard bipartite matching problem. Searching the space of all possible subsets to maximize EMD requires entirely different geometric tricks:

  • Bounding Box & Grid Snapping (Euclidean EPAS): To get a $(1-\varepsilon)$-approximation in Euclidean space, the authors isolate extreme outer points to build a core bounding box $\mathcal{B}$, leaving at most $4k$ points outside (in 2D for $r=2$). They overlay a fine grid onto $\mathcal{B}$ and snap interior points to the nearest grid vertex. Because the number of grid cells depends only on $\varepsilon$ (and $k, d$), they can exhaustively check valid combinations of snapped points in Fixed-Parameter Tractable (FPT) time—meaning the combinatorial explosion is confined to small parameters like $k$ and $\varepsilon$, keeping the dependence on $n$ polynomial—and lift the winner back to real points with tiny error.
Figure 1: A pictorial presentation of B.
  • 1D Projections (Polynomial-Time Approximation): When exponential dependence on $k$ is too slow, the authors project $d$-dimensional Euclidean points onto each of the $d$ coordinate axes. Solving 1D EMD diversity on a line is fast and exact—you simply pick the leftmost $k$ and rightmost $k$ points. Taking the best axis gives a clean $d$-approximation.
  • Concentric Disk Arrangements (Farthest $k$-Set): For general metrics, the authors grow disks around the query points until $n-k$ points are covered. They then slice the space using concentric rings of step size $\varepsilon d^\star$, grouping points in each resulting region to shrink the search space down to an FPT-sized pool.

Datasets

Not discussed in the paper. (This is a purely theoretical computer science work proving mathematical bounds and algorithmic guarantees.)

Key Insights and Ideas

  • Geometry tames combinatorial explosion: Even when $n$ is massive, the optimal diverse sets are heavily dictated by extreme boundary points, while dense interior regions can be Safely coarsened onto a grid whose size is completely independent of $n$.
  • 1D lines capture high-dimensional spread: By the basic geometry of Euclidean norms, projecting optimal matched pairs onto coordinate axes preserves at least $1/d$ of their distance. A hard high-dimensional matching search reduces to sorting numbers on $d$ lines.
  • Approximation is mandatory, not a flaw: In general metric spaces, getting better than a $2$-approximation in FPT time is fundamentally impossible (under standard complexity assumptions)—making their $2$-approximation algorithm Mathematically tight.

Key Results

The authors establish a comprehensive map of hardness lower bounds (using W[1]-hardness, the parameterized cousin of NP-hardness indicating no FPT algorithm likely exists) alongside matching algorithms:

Table 1. Already for k = 1 and variable r, Metric (k, r)-Diversity Maximization coincides with the classical max-min dispersion problem. This case is NP-hard by a direct reduction from Cliqe: given a graph G = (V, E), take P = V , set d(u, u) = 0, and, for distinct u, v, set d(u, v) = 2 if {u, v} ∈E and d(u, v) = 1 otherwise. These distances form a metric, and the optimal diversity is 2 if and only if G contains a clique of size r. Consequently, for any fixed ε ∈(0, 1), a polynomial-time (2 −ε)-approximation would imply P = NP.
  • Euclidean $(k, r)$-Diversity (for $r \le k$): W[1]-hard to solve exactly (even in 2D), but admits an Efficient Parameterized Approximation Scheme (EPAS) achieving a $(1-\varepsilon)$-approximation in $f(k, d, \varepsilon) \cdot n^{\mathcal{O}(1)}$ (near-linear in $n$) time.
  • Euclidean $(k, 2)$-Diversity (Fast): A $d$-approximation in $\text{poly}(n, k, d)$ time (a $2$-approximation in the plane).
  • Metric $(k, 2)$-Diversity: W[1]-hard to approximate better than $2 - o(1)$, matched by a $2$-approximate FPT algorithm running in near-quadratic time in $n$.
  • General Cost $(k, r)$-Diversity: W[1]-hard even to approximate within $k/(\log k)^{\mathcal{O}(1)}$.
  • Farthest $k$-Set: NP-hard, but admits a $(1-\varepsilon)$-approximate EPAS in $(k/\varepsilon)^{\mathcal{O}(k)} \cdot \text{poly}(n)$ time for any cost function.

Limitations and Future Work

While the FPT algorithms scale nicely (near-linearly or near-quadratically) with the dataset size $n$, they carry a heavy exponential dependence on parameters like $k$, $d$, and $1/\varepsilon$—for instance, $(k/\varepsilon)^{\mathcal{O}(k)}$. In practical ML pipelines where $k$ isn't tiny, this constant factor bites hard, leaving a gap between theoretical tractability and real-world speed. For future work, the authors highlight extending these discrete subset problems to the continuous setting: finding $r$ probability distributions (with bounded entropy) on a manifold that are maximally dispersed in Wasserstein space, which could help initialize diverse learners so at least one converges quickly.

Summary updated

Abstract

Classically used for image retrieval tasks in computer vision, the Earth Movers Distance (EMD), also called the Wasserstein distance, has found numerous applications in natural language processing (NLP) and machine learning (ML). In NLP it is used as a measure of distance between sets of embeddings, and in ML it has been used to understand training dynamics, distributionally robust optimization, and many other tasks under active research. On the other hand, computing diverse solutions to optimization problems has also gained a lot of attention recently. In this DiverseX paradigm, one wants to develop algorithms that return a set of $r$ solutions that are maximally diverse; a common measure of diversity is the average or the minimum distance between the $r\choose{2}$ pairs of solutions. This paradigm is useful in generating more choices for the user, in fairness, and in robustness and security applications. In this work, we address the complexity of finding a diverse set of solutions in the EMD metric. Given an $n$ point metric space $(X,d)$ and integers $k \geq 1$ and $r \geq 2$, we consider the problem of computing $r$ many subsets of $X$, each of cardinality $k$, such that the minimum EMD between these sets is maximized. Motivated by applications from NLP, we also consider the problem of computing the farthest $k$-subset (from a given $k$-subset) in the EMD metric. On the lower bound side, we first show that assuming the Maximum-Span Hypothesis, it is W[1]-hard (with parameters $k$ and $r$) to obtain $k/(\log k)^{O(1)}$-approximation for non-metric cost functions, and W[1]-hard to obtain a $2-o(1)$ approximation for metric spaces. We also show that the problem restricted to the Euclidean setting with $\ell_2$ norm is W[1]-hard. Our first main algorithmic result is an $f(k, d, \varepsilon)n^{(O(1)}$ time $(1-\varepsilon)$ approximation algorithm for the $d$-dimensional Euclidean setting, which is tight in view of the above hardness results. Using different techniques, we also present a similar result for the farthest point problem in arbitrary metric spaces. Our second main algorithmic result is geared towards the search for polynomial time algorithms, where we present an $O(d)$ approximation for the Euclidean setting in $\text{poly}(n,k,d)$ time when $r=2$. Finally, we present $FPT(k)$ time, 2-approximate algorithms for arbitrary metric spaces when $r=2$. Since the class of problems we study requires to *find* diverse solutions in the EMD metric, our results use a combination of various geometric techniques that deviate from the techniques used to compute the EMD metric between a *given pair* of solutions, and may be of independent interest.
BibTeX
@inproceedings{banik2026computing,
  author = {Aritra Banik and Mayank Goswami and Abhishek Sahu},
  title = {{On Computing Diverse Solutions in the Earth Movers Distance}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Di32FbHcJU},
}
Figure