---
title: Quadratic Bipartite Matching Loss
url: https://www.emergentmind.com/topics/bipartite-matching-loss
type: topic
---

# Quadratic Bipartite Matching Loss

The quadratic stochastic Euclidean bipartite matching loss is a cost functional arising in the optimal assignment between two independently sampled point clouds over a domain $\Omega \subset \mathbb{R}^d$. When each point cloud consists of $N$ points sampled according to a density $\rho(x)$ and $N \gg 1$, the objective is to determine a permutation mapping that minimizes the average squared Euclidean distance between matched pairs. This framework is closely related to stochastic optimal transport and extends Monge–Kantorovich theory by capturing finite-$N$ fluctuations through a linearized, electrostatic analogy—with explicit formulae for the expected optimal cost and the two-point correlation function of the matching field [1510.02320].

## 1. Mathematical Formulation and Problem Structure

Consider a bounded domain $\Omega\subset\mathbb{R}^d$, or its d-dimensional flat torus version $\mathsf{T}^d = [0,1]^d$ with periodic boundary conditions. Two independent point sets, $R = \{r_i\}_{i=1}^N$ and $B = \{b_j\}_{j=1}^N$, are sampled i.i.d. from the density $\rho(x) > 0$ on $\Omega$. The assignment $\sigma^* \in S_N$ solves:
\[
C_N^* = \min_{\sigma \in S_N} \frac{1}{N} \sum_{i=1}^N \| r_i - b_{\sigma(i)} \|^2.
\]
The loss quantifies the minimal average squared displacement required to match sources to targets.

## 2. Empirical Measures and Continuum Limit

Define empirical measures:
\[
\rho_R(x) = \frac{1}{N} \sum_{i=1}^N \delta(x - r_i), \qquad \rho_B(x) = \frac{1}{N} \sum_{j=1}^N \delta(x - b_j),
\]
and their difference $\varrho(x) = \rho_R(x) - \rho_B(x)$. As $N \to \infty$, both $\rho_R$ and $\rho_B$ converge weakly to $\rho(x)$. This continuum perspective enables the reformulation of the matching loss using fields and measures, facilitating analytic derivations.

## 3. Electrostatic Analogy and Linearization

The optimal displacement field $m(x)$ transporting $\rho_R$ to $\rho_B$ is (in the weak sense) the gradient of a potential: $m(x) = \nabla \phi(x)$. The push-forward constraint linearizes, yielding the PDE:
\[
\nabla \cdot [\rho(x) \nabla \phi(x)] = \varrho(x), \qquad \nabla \phi \cdot n|_{\partial\Omega} = 0 \quad (\text{Neumann BC}),
\]
or periodic BC on $\mathsf{T}^d$. Introducing the Green's function $G_\rho(x, y)$ solving:
\[
\nabla_x \cdot [\rho(x)\nabla_x G_\rho(x, y)] = \delta(x - y) - \frac{1}{|\Omega|}, \qquad \frac{\partial}{\partial n_x} G_\rho(x, y)|_{x \in \partial\Omega} = 0,
\]
the displacement field admits
\[
m(x) = \nabla \phi(x) = \int_\Omega \nabla_x G_\rho(x, y) \,\varrho(y)\,dy.
\]

## 4. Two-Point Correlation Function

Averaging over all random instantiations of $r_i, b_j$, the two-point correlation for the displacement field is
\[
C(x, y) \coloneqq \overline{m(x) \cdot m(y)} = \iint \nabla_x G_\rho(x, z)\nabla_y G_\rho(y, w)\overline{\varrho(z)\varrho(w)}\,dz\,dw,
\]
with
\[
\overline{\varrho(z)\varrho(w)} = 2\frac{\rho(z)}{N} [\delta(z - w) - \rho(w)].
\]
This yields (up to an $N$-dependent short-distance cutoff):
\[
C(x, y) = \frac{2}{N} \int_\Omega \rho(z)\, \nabla_x G_\rho(x, z)\cdot\nabla_y G_\rho(y, z)\,dz
- \frac{2}{N} \iint_{\Omega\times\Omega} \rho(z)\rho(w)\,\nabla_x G_\rho(x, z)\cdot\nabla_y G_\rho(y, w)\,dz\,dw.
\]

## 5. Continuum Formula for Expected Optimal Cost

The average optimal matching loss in the continuum approximation uses the diagonal part of the correlation:
\[
C_N^* \approx \int_\Omega \| m(x) \|^2 \rho(x)\,dx = \int_\Omega C(x, x)\rho(x)\,dx,
\]
which leads to the general formula:
\[
\boxed{
\mathbb{E}\left[C_N^*\right] \simeq \int_\Omega C(x, x)\rho(x)\,dx = \frac{2}{N} \iint_{\Omega \times \Omega} \rho(x)\left[\rho(y) G_\rho(x, y) - \frac{1}{|\Omega|} G_\rho(x, x)\right]dx\,dy.
}
\]
A short-distance cutoff proportional to the typical nearest-neighbor spacing $\delta_N \sim N^{-1/d}$ in the integrals is required to regularize divergences.

## 6. Flat Hypertorus and Explicit Asymptotics

On $\mathsf{T}^d$ with Poisson density ($\rho \equiv 1$), the Green function $G_d(x-y)$ solves:
\[
\Delta_x\, G_d(x - y) = \delta(x - y) - 1, \qquad \int_{\mathsf{T}^d} G_d = 0.
\]
The corresponding ansatz:
\[
C(x, y) \approx -\frac{2}{N} G_d(x-y), \qquad \mathbb{E}[C_N^*] \approx -\frac{2}{N} G_d(0),
\]
yields (mode-sum or zeta-function regularization):
- $d = 1$: $C(x, y) = \frac{1 - 6|x - y|(1 - |x - y|)}{6N}$, $\mathbb{E}[C_N^*] = \frac{1}{6N} + o(1/N)$,
- $d = 2$: $\mathbb{E}[C_N^*] = \frac{\ln N}{2\pi N} + \frac{\gamma}{N} + o(1/N)$ for constant $\gamma$,
- $d > 2$: $\mathbb{E}[C_N^*] \sim C_d\, N^{-2/d}$ as $N \to \infty$, with $C_d = \frac{2}{d(2\pi)^d S_{d-1} \zeta\left(1 + \frac{d}{2}\right)}$.

## 7. Generalizations and Theoretical Context

For nonuniform density $\rho(x)$ and general domains, correlation functions and expected loss follow the described Green-function prescription. Mean-field scaling $\mathbb{E}[C_N^*] \sim N^{-2/d}$ (with logarithmic correction for $d=2$) is recovered. This approach extends Monge–Kantorovich theory to stochastic settings by modeling finite-$N$ effects via a weakly linearized electrostatic analogy, capturing random fluctuations in discrete matching problems [1510.02320].

A plausible implication is that this framework facilitates the systematic study of stochastic transport costs beyond mean-field, including spatial correlation structures and finite-size scaling in bipartite matching problems, with rigorous connection to probabilistic transport theory.

Source: https://www.emergentmind.com/topics/bipartite-matching-loss