arXiv:2610.07690cs.DSOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.07690

How to Fix a Broken Metric: A Linear Kernel, Tight Bounds, and Tree Metrics

Sayan Bandyapadhyay, William Lochet, Daniel Lokshtanov, Saket Saurabh, Chinmay Sonar, Vaishali Surianarayanan, Jie Xue

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Given a complete graph whose edge weights represent dissimilarities, the METRIC VIOLATION DISTANCE problem asks whether at most k of the weights can be changed so that the resulting weights form a metric. Motivated by metric repair for noisy data, this problem has recently been studied primarily from the approximation algorithm community, where the best current algorithm is a O(log⁡n)\mathcal{O}(\log n)-approximation in polynomial time by Cohen-Addad, Fan, Lee and de Mesmay [SIAM J. Comput., 2025].

In the context of parameterized complexity, Fan, Gilbert, Raichel, Sonthalia and Van Buskirk proved the problem fixed-parameter tractable, in kO(k)nO(1)k^{\mathcal{O}(k)}n^{\mathcal{O}(1)} time [SWAT 2020]. Fomin, Golovach and More [IPEC 2026] showed that, in the case of ultrametric, the problem has a O(k2)O(k^2) kernel as well as a single-exponential running time. They also ask the following two questions about general metric: can the running time be made single-exponential and does the problem admit a polynomial kernel. They also ask what is the parameterized complexity of the tree-metric analogue? We answer all three questions.

We give a 2O(k)nO(1)2^{\mathcal{O}(k)}n^{\mathcal{O}(1)}-time algorithm, and this is best possible: unless ETH fails there is no 2o(k)nO(1)2^{o(k)}n^{\mathcal{O}(1)}-time algorithm, even when every input distance lies in {1,2,3}\{1,2,3\}. We also give a kernel with at most 6k vertices. The kernel is solution-lifting, so it may be placed in front of any approximation algorithm; used before the O(log⁡n)\mathcal{O}(\log n)-approximation of Cohen-Addad, Fan, Lee and de Mesmay it yields an approximation factor of O(log⁡OPT)\mathcal{O}(\log OPT), at no asymptotic cost in running time.

Both results extend to an interval generalization in which every edge ee carries an observed value MeM_e and an admissible range [Ae,Be][A_e, B_e] within which it may be reassigned; there the kernel has 7k7k vertices.

Finally, we show that TREE METRIC VIOLATION DISTANCE is fixed-parameter tractable, and solvable in kO(k)nO(1)k^{\mathcal{O}(k)}n^{\mathcal{O}(1)} time.

*Portland State University. sayanb@pdx.edu

†^{\dagger}CNRS, LIRMM. william.lochet@gmail.com

‡^{\ddagger}UCSB. daniello@ucsb.edu

§^{§}Institute of Mathematical Sciences. saket@imsc.res.in

^{¶}chinmaysonar96@gmail.com

1^{1}UC Santa Cruz. vaishalisurianarayanan@gmail.com

**New York University Shanghai. jiexue@nyu.edu

1 Introduction

Many algorithms in data analysis use distances in a metric space to represent dissimilarities between data points. This assumption is useful both conceptually and algorithmically: metric structure is central in clustering, metric embeddings, and many approximation algorithms. In practice, however, distances obtained from measurements, similarities, or incomplete data are often noisy, and may fail even the most basic metric constraint, namely the triangle inequality.

This motivates the problem of repairing a distance matrix. Classical metric repair, often formulated as metric nearness, asks for a nearby metric, typically with respect to an ℓp\ell_p-type objective [VGWS19, TJW25, BDST08]. Such repairs may change a large fraction of the input distances. The METRIC VIOLATION DISTANCE problem instead asks for a sparse repair: given pairwise distances δ:E(G)→R≥0\delta: E(G) \to \mathbb{R}_{\geq 0} on a complete graph, modify as few edge lengths as possible so that the resulting distances form a metric [GJ17, FRVB22]. Throughout, we work with the parameterized decision version: the input is (G,δ,k)(G, \delta, k), and the question is whether some S⊆E(G)S \subseteq E(G) with ∣S∣≤k|S| \leq k admits a reassignment of the lengths of its edges after which δ\delta is a metric. The parameter is kk, the number of distances one is allowed to touch, and we call such an SS a feasible support.

The problem has mainly been studied from the viewpoint of approximation algorithms. Fan, Raichel, and Van Buskirk initiated this line, proving hardness results and giving an O(OPT1/3)\mathcal{O}(\mathrm{OPT}^{1/3})-approximation [FRVB22]. More recently, Cohen-Addad, Fan, Lee, and de Mesmay gave an O(log⁡n)\mathcal{O}(\log n)-approximation for METRIC VIOLATION DISTANCE [CAFLdM25]. Whether the problem admits a constant-factor approximation remains open.

The same fitting approach has also been considered for more specific metrics, most notably ultrametrics and tree metrics [CAFLdM25, CG24, Kip23]. These metrics are central in applications where distances are expected to come from an underlying hierarchy: ultrametrics model hierarchical clusterings [AC11], while tree metrics are the basic distance model in phylogenetics and numerical taxonomy [SS62, CSE67, Far72]. A constant-factor approximation is known for these two variants [CAFLdM25, CG24, Kip23], but to our knowledge, nothing is known regarding their parameterized complexity.

In this paper we study the parameterized complexity of distance repair, parameterized by the number kk of distances that may be modified. Fan, Raichel and Van Buskirk [FRVB22] asked whether METRIC VIOLATION DISTANCE on complete graphs is fixed-parameter tractable in the solution size. This was answered by Fan, Gilbert, Raichel, Sonthalia and Van Buskirk [FGR+^{+}20], who gave a bounded search-tree algorithm for the more general class of ς\varsigma-chordal graphs, those in which every chordless cycle has length at most ς\varsigma. Complete graphs are 3-chordal, so their algorithm solves METRIC VIOLATION DISTANCE in kO(k)nO(1)k^{\mathcal{O}(k)}n^{\mathcal{O}(1)} time. Recently, Fomin Golovach and More [FGM26] raised three questions about this state of affairs:

(Q1) Can the kO(k)k^{\mathcal{O}(k)} dependence be improved to single-exponential?

(Q2) Does METRIC VIOLATION DISTANCE admit a polynomial kernel?

(Q3) What is the parameterized complexity of the tree-metric analogue?

We answer all three.

Questions (Q1) and (Q2) are natural, and (Q2) has a concrete obstruction behind it: Fan et al. explicitly observe [FGR+20,Sec.5][FGR^{+}20, Sec. 5] that the edges of the broken chordless cycles, which drive their search tree, do not form a kernel of size bounded by the parameter. Their example is KnK_n with one edge of weight n+1n+1 and all others of weight 1: the optimum has size 1, while 2n−32n-3 edges survive. A kernel must therefore come from somewhere else.

Our results hold for a natural interval generalization of the problem that we call INTERVAL METRIC VIOLATION. For every edge e, the input consists of an observed value MeM_e and an allowed interval [Ae,Be][A_e, B_e]. If e is not modified, its final length must remain MeM_e; if e is modified, its final length may be chosen anywhere in [Ae,Be][A_e, B_e]. This captures the common situation where the observed distances come with uncertainty or confidence intervals. The standard METRIC VIOLATION DISTANCE problem is recovered by choosing sufficiently permissive intervals for modified edges.