Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees

Nate Veldt, Thomas Stanley, Benjamin W Priest, Trevor Steil, Keita Iwabuchi, T.s. Jayram, Geoffrey SandersICML 2025

Finding a Minimum Spanning Tree (MST) is a bread-and-butter task in machine learning, particularly for hierarchical clustering. However, there is a catch: if you are working in a general metric space (where you only have a distance function between points), finding the exact MST for $n$ points requires $\Omega(n^2)$ distance queries. When $n$ is in the millions, calculating a trillion distances is a non-starter.

Optimal MST vs Heuristic Forest

In their paper, Nate Veldt and colleagues present a clever way to break this quadratic bottleneck using a "forest completion" framework. They introduce a two-step approach that first builds a heuristic "initial forest" and then connects the components using a novel subquadratic algorithm. This provides the first constant-factor approximation for metric MSTs in $o(n^2)$ time, achieving up to 400x speedups in practice with negligible loss in tree quality.

The Curse of the Metric Space

The "Metric MST" problem assumes every pair of points in a dataset has a defined distance, and we want to find the tree of minimum total weight that connects them all. While efficient algorithms exist for Euclidean space (like using KD-trees), many modern ML tasks use non-Cartesian data: DNA sequences (Levenshtein distance), sets of ingredients (Jaccard distance), or graph embeddings.

In these arbitrary metric spaces, you generally have to check every single pair of points to find the MST. The challenge is to approximate the MST in subquadratic time without making restrictive assumptions about the dimensionality or type of the data.

The Metric Forest Completion (MFC) Framework

To bypass the $\Omega(n^2)$ bottleneck, the authors propose a two-step framework called Metric Forest Completion (MFC):

Metric Forest Completion Framework
  1. Initial Forest Generation: Use a fast, "cheap" heuristic to partition the data into $t$ components and find an MST within each component. Strategies include $k$-centering (clustering) or building a $k$-nearest neighbor graph.
  2. The Completion Step: Once you have a forest of disjoint trees, how do you connect them cheaply? The authors prove that even finding the optimal way to connect these trees still requires $\Omega(n^2)$ time. To bypass this, they introduce MFC-Approx.

MFC-Approx selects one "representative" point for each component. It then queries the distance from every point in the dataset to these $t$ representatives. By building a coarsened graph based on these queries, they find a way to link the components that is guaranteed to be a 2.62-approximation of the optimal completion.

The algorithm is "learning-augmented" because it treats the initial forest as a "prediction." They define a measure called $\gamma$-overlap—essentially how much of the true MST is captured by the initial forest. If the forest is good, the final tree is guaranteed to be very close to the true MST.

Key Insights and Results

The researchers evaluated their framework on a diverse set of synthetic and real-world benchmarks, including high-dimensional Euclidean data, string metrics (DNA sequences), and Jaccard metrics (clickstream data).

  • Massive Speedups: On high-dimensional data ($d=256$), the algorithm was 30x faster than the exact baseline. On lower-dimensional clustered data, speedups reached 300x to 400x.
  • High Quality: While the theoretical approximation bound is 2.62, empirical results were much better. In almost all real-world tests, the cost of the approximate tree was within 1% to 5% of the optimal MST.
  • The Power of Representatives: You don't need to find the absolute closest pair of points between two clusters to connect them effectively. Knowing the distance from all points to a single representative in each cluster provides enough information to bound the error.
  • Clustering is a Feature: MSTs are often used for clustering, but performing a rough clustering first actually makes the MST problem easier to solve quickly.

Limitations and Future Work

While highly effective, the framework has some limitations. In datasets with extreme outliers, the $k$-centering heuristic can create one massive cluster and many tiny ones, reducing the efficiency of the completion step. Additionally, for some datasets, the "cheap" first step (building the initial forest) actually became the most time-consuming part.

Future work could involve even faster ways to generate these starting fragments. Furthermore, because both the initial forest generation and the representative distance queries are "embarrassingly parallel," there is significant potential for scaling this approach on large, distributed systems.

Summary updated

BibTeX
@inproceedings{veldt2025approximate,
  author = {Nate Veldt and Thomas Stanley and Benjamin W Priest and Trevor Steil and Keita Iwabuchi and T.S. Jayram and Geoffrey Sanders},
  title = {{Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=r9Yp0v8toA},
}
Figure