arXiv:2609.05874cs.CCSep 2026

Manuscript Offprint

arXiv:2609.05874

Ulam Rank Aggregation Is Hard to Approximate for Four Rankings

Sk Ruhul Azgor, Diptarka Chakraborty, Le Van Cuong, Debarati Das, Mursalin Habib, Tien Long Nguyen

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

Abstract

We study the approximability of rank aggregation under the Ulam metric. In the Ulam median problem, the goal is to find a ranking (permutation) minimizing the sum of its Ulam distances to the input rankings, while in the Ulam center problem, the objective is to minimize the maximum such distance. We prove that, for every 0<ε<1/340 < \varepsilon < 1/34, it is NP-hard to approximate either Ulam median or Ulam center within a factor of 35/34−ε35/34 - \varepsilon, even when the input consists of only four rankings. We further show that unless P=NPP = NP, neither problem admits a polynomial-time additive approximation scheme. Prior to our work, only the exact versions of both problems were known to be NP-hard, and that too only when the number of input rankings is unbounded [Fischer et al., ESA'25 and Bachmaier et al., J. of Discrete Algorithms'15]. Furthermore, our inapproximability results are optimal in terms of the number of input rankings since for three inputs it is already known to be polynomial-time solvable [Chakraborty, Das, Krauthgamer, SODA'21].

En route, we introduce a new general framework for reducing Boolean constraint satisfaction problems (CSP) to the Ulam median with only four inputs. As a specific instantiation of the reduction framework, we obtain our hardness-of-approximation results. The corresponding hardness for the Ulam center follows from a reduction from the Ulam median.

1 Introduction

Aggregating potentially inconsistent information from multiple sources is a fundamental challenge across social choice, information retrieval, and data analysis. When sources such as voters, search engines, or learned agents provide complete orderings over a set of alternatives, the problem is known as rank aggregation. The goal is to compute a consensus ranking that optimizes a specific objective function. Because different individuals or retrieval systems rarely agree on every pair of alternatives, input rankings inherently conflict. This setting naturally arises in diverse applications, including voting, web search, database systems, similarity search, and classification [8, 15, 19, 16, 1].

Two of the most well-studied optimization objectives in this domain are the median and center variants. The median variant seeks a consensus ranking (permutation) that minimizes the sum of distances to the input rankings, while the center variant minimizes the maximum distance to any

*This paper merges two recent works [18, 3], subsuming and strengthening the results of both. †Pennsylvania State University. Email: sfa6135@psu.edu ‡National University of Singapore. Work partially supported by an MoE AcRF Tier 1 grant (T1 251RES2303) and a Google South & South-East Asia Research Award. Email: diptarka@nus.edu.sg §National University of Singapore. Email: e1583414@u.nus.edu ¶Pennsylvania State University. Work supported in part by NSF grant 2337832. Email: debaratix710@gmail.com ¶Rutgers University. Supported by the National Science Foundation under Grants CCF-2313372 and CCF-2443697. Email: mursalin.habib@rutgers.edu **Pennsylvania State University. Email: tfn5179@psu.edu input. In both cases, the optimal consensus may be any valid permutation, not strictly one of the original inputs. Ultimately, the computational complexity of solving either variant depends heavily on the underlying distance metric used to compare permutations.

In this paper, we study rank aggregation under the Ulam distance. For two rankings of dd items, their Ulam distance is the minimum number of move operations required to transform one into the other. Equivalently, it is dd minus the length of their longest common subsequence (LCS), or one-half of their insertion-deletion (edit) distance, thereby retaining the alignment structure of edit distance without repeated symbols. The metric is also natural for rankings: a move models a displaced item while preserving the relative order of a large unaffected subsequence. Accordingly, Ulam distance has been studied extensively in several algorithmic settings [14, 13, 2, 25, 7]. Rank aggregation under the Ulam metric, in particular, has attracted considerable recent attention [10, 12, 11, 21, 9, 5].

For an arbitrary number of input rankings, the Ulam median problem is NP-hard [17] and the best-known polynomial-time approximation factor for Ulam median is 1.968 [9], building on a sequence of earlier advances [10, 11, 21]. The NP-hardness result in [17], however, applies only when the number of input permutations is unbounded, that is, when the number of inputs is part of the instance. It therefore yields no hardness for any fixed number of inputs. At the other end of the spectrum, Ulam median can be solved exactly in polynomial time for three input permutations [10]. Thus, prior to this work, the complexity of the problem remained open for every fixed number k≥4k \geq 4 of inputs.

This gap is particularly intriguing given the close connection between the Ulam and edit metrics. For the more general median-string problem under insertion-deletion edit distance, where both the input strings and the median may be arbitrary strings, an exact median can be computed in polynomial time for every fixed number of inputs using a standard multidimensional dynamic program [28, 23, 26]. Since the Ulam distance is precisely one-half of the insertion-deletion distance on permutations over a common alphabet, one might expect the additional permutation structure to simplify the median problem. This leads to the following question:

Can the Ulam median be computed exactly in polynomial time for every fixed number of input permutations?

As mentioned earlier, when the number of input rankings is unrestricted, the best-known polynomial-time approximation factor for Ulam median is 1.968. The situation appears more favorable when the number of inputs is fixed. Using the fixed-dimensional dynamic program for edit-distance median as a relaxation and subsequently transforming its output into a permutation yields a polynomial-time approximation factor strictly better than 3/2 for every fixed number of input permutations. In particular, a sharper analysis of the approach of [10] gives a 5/4-approximation for four inputs. For completeness, we present the algorithm and its analysis in Section B.

Further evidence that arbitrarily accurate approximation might be possible comes from the Kendall-tau metric, another standard distance measure on rankings. The median problem under Kendall-tau, also known as Kemeny rank aggregation, is NP-hard already for three input rankings [27, 24], yet admits a polynomial-time approximation scheme (PTAS) even when the number of inputs is unrestricted [22]. Thus, although Ulam median is easier from the viewpoint of exact computation for three inputs, it is natural to ask whether it enjoys a comparable approximation guarantee. This leads to our second question:

Does Ulam median admit a PTAS, at least when the number of input permutations is fixed?

We answer both questions negatively. We prove an explicit constant-factor hardness of approximation for Ulam median with exactly four input permutations, thereby ruling out a PTAS unless P = NP. Together with the exact algorithm for three inputs, this establishes a sharp transition from exact polynomial-time solvability with three inputs to constant-factor inapproximability with four. It also reverses the comparison with Kendall-tau median from the viewpoint of approximation: whereas Kendall-tau median admits a PTAS even for an unrestricted number of inputs, Ulam median admits no PTAS already for four. Thus, despite being easier for exact computation on three inputs, Ulam median is strictly harder to approximate in this precise sense. Finally, our reduction from Ulam median to Ulam center transfers the same inapproximability to the center objective.