NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Exact Computation of a Manifold Metric, via Lipschitz Embeddings and Shortest Paths on a Graph

Timothy Chu, Gary Miller, Donald Sheehy

This paper, "Exact Computation of a Manifold Metric, via Lipschitz Embeddings and Shortest Paths on a Graph," presents a surprising bridge between continuous manifold geometry and discrete graph algorithms. The authors prove that a complex, density-dependent metric used in machine learning is exactly equivalent to a simple shortest-path calculation on a graph.

TL;DR

The authors prove that the "nearest neighbor metric"—a continuous manifold distance that adapts to data density—is exactly equal to the "edge-squared metric," a discrete shortest-path distance on a graph where edge weights are squared Euclidean distances. This discovery transforms a difficult continuous optimization problem into a discrete one solvable in polynomial time, enabling new efficient algorithms for spanners and persistent homology.

What Problem Does This Paper Address?

In machine learning and data analysis, Euclidean distance often fails to capture the "true" similarity between points. If two points are in the same dense cluster, we often want them to be "closer" than two points separated by a sparse region, even if their straight-line distance is the same.

To address this, researchers use data-sensitive metrics (or density-based distances). These metrics scale distances inversely based on the local density of data points. The nearest neighbor metric ($d_N$) is a prime example: the "cost" of moving through space is proportional to the distance to the nearest data point.

The fundamental challenge is that computing $d_N$ between two points involves finding the minimum cost path among an uncountable number of possible continuous paths. While calculus of variations suggests these paths are piecewise hyperbolic arcs, computing them exactly was previously thought to be extremely difficult, leading researchers to rely on approximations.

Figure 1: In this figure we have a collection of points. The length or cost of the green curve between the two blue points is the integral along the curve scaled by the distance to the nearest point.

Methods

The authors' core contribution is proving Theorem 1.1: for any finite set of points $P$, the continuous nearest neighbor metric $d_N$ is identical to the discrete edge-squared metric $d_2$. The edge-squared metric is simply the shortest path distance on a complete graph where the weight of an edge $(u, v)$ is $\|u - v\|^2$.

Their proof uses a sophisticated three-step "lifting" technique:

  1. Box Embedding: They show that if points are vertices of an axis-aligned box in high dimensions, the shortest paths are indeed straight lines, and $d_N = d_2$.
  2. Lipschitz Mapping: They use a novel embedding based on Schoenberg’s screw functions to map points from $\mathbb{R}^d$ to a higher-dimensional space $\mathbb{R}^n$, placing them on the vertices of a box while preserving the $d_2$ distances.
  3. Lipschitz Extension: Using the Kirszbraun theorem, they extend this mapping to the entire space in a way that relates the lengths of paths in the original space to paths in the high-dimensional box space.

Datasets

As a theoretical paper, it does not use standard empirical benchmarks. Instead, it defines the types of inputs for which the results hold:

  • Finite point sets in $\mathbb{R}^d$.
  • Finite collections of compact, path-connected sets (geometric bodies), showing the metric is robust even for complex shapes.
  • Points drawn i.i.d. from Lipschitz probability densities to prove results about $k$-nearest neighbor ($k$-NN) graphs.
Figure 2: The metric also applies to compact bodies. Theorem 1.1 establishes that the shortest path goes straight from body to body.

Key Insights and Ideas

  • Discrete-Continuous Equivalence: The most striking insight is that a previously published 3-approximation for $d_N$ is actually an exact algorithm. The continuous geodesic path between two data points is simply a sequence of straight-line segments connecting other data points.
  • Piecewise Linearity: While paths between arbitrary points in space are hyperbolic, the optimal path between data points is piecewise linear.
  • The $p$-power Metric Spectrum: The authors frame these metrics as part of a family where edge weights are $\|u - v\|^p$. When $p=1$, you get standard Euclidean distance; when $p=2$, you get the nearest neighbor metric; and as $p \to \infty$, the metric converges to the Euclidean Minimum Spanning Tree (MST).
  • Robustness to Geometry: The proof holds even if the "points" are actually complex, non-convex, path-connected bodies.

Key Results

  • Exact Polynomial Time Algorithm: $d_N$ can now be computed exactly using standard all-pairs shortest path algorithms (like Floyd-Warshall or Dijkstra) on the edge-squared graph.
  • Fast Spanners: The authors provide an algorithm to compute $(1+\epsilon)$-spanners for $d_N$ in $O(n \log n + n\epsilon^{-d/2} \log \frac{1}{\epsilon})$ time. These spanners are sparser and faster to compute than optimal Euclidean spanners.
  • $k$-NN Graphs as 1-Spanners: For points sampled from "nice" distributions, a standard $k$-NN graph (with squared weights) is a perfect 1-spanner for $d_N$ with $k = O(\log n)$. This means off-the-shelf $k$-NN graph generators can be used to compute this manifold metric.
  • Persistent Homology: The results allow for the exact, polynomial-time computation of the intrinsic persistent homology of the nearest neighbor metric.

Limitations and Future Work

  • High Dimensionality: The spanner construction has an exponential dependency on the dimension $d$ ($\epsilon^{-d/2}$), which is a common "curse of dimensionality" in computational geometry.
  • Generalizations: The authors suggest exploring whether these techniques apply to other cost functions, such as those based on the $k^{th}$ nearest neighbor rather than just the $1^{st}$.
  • Empirical Validation: While the theory is robust, the authors note that the performance of these metrics in practical machine learning tasks (like real-world clustering or classification) remains an open area for experimental study.

Summary updated

BibTeX
@inproceedings{chu2020exact,
  author = {Timothy Chu and Gary Miller and Donald Sheehy},
  title = {{Exact Computation of a Manifold Metric, via Lipschitz Embeddings and Shortest Paths on a Graph}},
  booktitle = {SODA},
  year = {2020},
  doi = {10.1137/1.9781611975994.25},
}
Figure