English

Fitting Tree Metrics and Ultrametrics in Data Streams

Data Structures and Algorithms 2025-04-25 v1

Abstract

Fitting distances to tree metrics and ultrametrics are two widely used methods in hierarchical clustering, primarily explored within the context of numerical taxonomy. Given a positive distance function D:(V2)R>0D:\binom{V}{2}\rightarrow\mathbb{R}_{>0}, the goal is to find a tree (or ultrametric) TT including all elements of set VV such that the difference between the distances among vertices in TT and those specified by DD is minimized. In this paper, we initiate the study of ultrametric and tree metric fitting problems in the semi-streaming model, where the distances between pairs of elements from VV (with V=n|V|=n), defined by the function DD, can arrive in an arbitrary order. We study these problems under various distance norms: For the 0\ell_0 objective, we provide a single-pass polynomial-time O~(n)\tilde{O}(n)-space O(1)O(1) approximation algorithm for ultrametrics and prove that no single-pass exact algorithm exists, even with exponential time. Next, we show that the algorithm for 0\ell_0 implies an O(Δ/δ)O(\Delta/\delta) approximation for the 1\ell_1 objective, where Δ\Delta is the maximum and δ\delta is the minimum absolute difference between distances in the input. This bound matches the best-known approximation for the RAM model using a combinatorial algorithm when Δ/δ=O(n)\Delta/\delta=O(n). For the \ell_\infty objective, we provide a complete characterization of the ultrametric fitting problem. We present a single-pass polynomial-time O~(n)\tilde{O}(n)-space 2-approximation algorithm and show that no better than 2-approximation is possible, even with exponential time. We also show that, with an additional pass, it is possible to achieve a polynomial-time exact algorithm for ultrametrics. Finally, we extend the results for all these objectives to tree metrics by using only one additional pass through the stream and without asymptotically increasing the approximation factor.

Keywords

Cite

@article{arxiv.2504.17776,
  title  = {Fitting Tree Metrics and Ultrametrics in Data Streams},
  author = {Amir Carmel and Debarati Das and Evangelos Kipouridis and Evangelos Pipis},
  journal= {arXiv preprint arXiv:2504.17776},
  year   = {2025}
}

Comments

Accepted for publication in the 52nd EATCS International Colloquium on Automata, Languages, and Programming (ICALP)

R2 v1 2026-06-28T23:10:21.593Z