Manuscript Offprint
arXiv:2608.29180Hardness of Approximation of Rank Aggregation on Ulam Metric
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 permutation minimizing the sum of its Ulam distances to the input permutations, while in the Ulam center problem the objective is to minimize the maximum such distance. Both problems are known to be NP-hard, but no explicit approximation hardness was previously known. We prove that, for every , it is NP-hard to approximate either Ulam median or Ulam center within a factor of , even when the input consists of only four permutations. We further show that unless P = NP, neither problem admits a polynomial-time additive approximation scheme. The hardness result for Ulam median is established via a reduction from MAX-E3-LIN-2. The corresponding hardness for Ulam center is then obtained through a reduction from 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 dynamic naturally arises in diverse applications, including voting, web search, database systems, similarity search, and classification [4, 11, 17, 12, 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 that minimizes the sum of distances to the input rankings, while the center variant minimizes the maximum distance to any 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 the rank aggregation problem under the Ulam distance. The Ulam distance between two rankings is the minimum number of items/candidates that need to be moved to transform one ranking into the other, where a move removes an item and reinserts it elsewhere. Equivalently, for permutations of n items, it equals n minus the length of their longest common subsequence (LCS). This distance metric is compelling primarily for two reasons. First, the Ulam
*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
Pennsylvania State University. Email: tfn5179@psu.edu distance is exactly one-half of the insertion-deletion distance, a natural variant of the standard edit distance, when both strings are permutations of the same alphabet. Thus, it captures much of the alignment structure that makes edit-distance problems challenging, while avoiding the complications caused by repeated symbols. This connection suggests that insights for Ulam aggregation may also be useful for more general multiple sequence alignment problems, which have numerous applications in computational biology [15, 26], DNA storage systems [14, 27], speech recognition [21], and classification [23]. Second, a move operation naturally models a displaced item while preserving the relative order of a large unaffected subsequence, a common form of error in rankings. Accordingly, the Ulam distance arises naturally in applications involving rankings, including social choice theory [4] and information retrieval [17], and has been extensively studied in the algorithmic literature in various contexts [10, 9, 2, 24, 3].
Both the median and center variants of the rank aggregation problem under the Ulam distance are already known to be NP-hard [13]. Recently, through a reduction from 3SAT, the Ulam median problem was shown to be NP-hard even for four input permutations [16]. On the algorithmic side, returning the best input gives a folklore 2-approximation to the median by the triangle inequality. For the center, returning any input gives the same guarantee. Beating this generic bound for the Ulam median long remained a computational challenge, and was first achieved in [6], which proposed a -approximation for a tiny constant . Since then, several new algorithmic frameworks [7, 5], along with refinements [19], have been proposed. Despite these attempts, the best-known approximation factor is 1.968 [5]. On the center variant, the scenario is much more elusive, with no better-than-2-factor algorithm known, and a slightly better than 3/2-approximation known only when the number of inputs is constant [8]. This behavior contrasts sharply with rank aggregation under the Kendall-tau distance – another fundamental distance metric defined over permutations. Although the corresponding median problem is NP-hard [11], even for three input rankings [25, 22], it admits a polynomial-time approximation scheme (PTAS) [20].
It is therefore natural to ask whether Ulam median also admits a PTAS, or even just a polynomial-time additive approximation scheme. We show that neither is possible unless P=NP.
Theorem 1.1. Unless , for any , there is no polynomial-time algorithm that approximates the Ulam median within a factor of , even when the input consists of four permutations.
Furthermore, the reduction used to prove the preceding result produces a gap linear in the total input length mn. Consequently, we can rule out a polynomial-time additive approximation scheme even for instances consisting of only four input permutations.
Theorem 1.2. Unless , for any , there is no polynomial-time algorithm that computes an -additive approximation of Ulam median with m input permutations over an alphabet of size n, even when m = 4.
It is worth emphasizing that four inputs are necessary for such an NP-hardness result: Ulam median can be solved exactly in polynomial time for three input permutations [6]. Thus, our result establishes a sharp transition from exact tractability with three inputs to constant-factor inapproximability with four. This result is particularly striking compared to the general median-string problem under edit distance, which can be solved in polynomial time for any fixed number of input strings [28]. Together with the NP-hardness for four-input Ulam-median established in [16], our result highlights the computational significance of the permutation constraint: requiring the median itself to be a permutation can make the problem substantially harder, even when the number of inputs is a fixed constant.
We further show that analogous hardness holds for the Ulam center objective. In particular, we rule out a PTAS even for four input permutations.
Theorem 1.3. Unless , for any , there is no polynomial-time algorithm that approximates the Ulam center within a factor of , even when the input consists of four permutations.
We further rule out a polynomial-time additive approximation scheme for the Ulam center under the same four-input restriction.
Theorem 1.4. Unless , for any , there is no polynomial-time algorithm that computes an -additive approximation of the Ulam center with input permutations over an alphabet of size , even when .
1.2 Technical overview
Approximation hardness of Ulam Median. Our reduction builds on the reduction introduced to show NP-hardness of the Ulam median problem for four permutations by Habib [16]: two permutations test local constraints, two enforce consistency among different occurrences of each variable, and a long common anchor block separates these two roles. The anchor block allows every candidate median of the constructed Ulam median instance to be represented by a partition of the non-anchor symbols. We analyze a candidate through its total LCS score, namely, the sum of its LCS lengths with the four input permutations.
In Habib’s reduction from 3SAT [16], soundness is established through an equality-case argument. The clause-witness and variable-consistency gadgets satisfy separate upper bounds, and a median attaining the target score must make both bounds tight. Tightness yields a witness for every clause and a consistent truth value for every variable, which together define a satisfying assignment. This argument, however, does not by itself yield approximation hardness. A near-optimal median need not nearly saturate the two bounds separately: it may make inconsistent choices across different occurrences of a variable and trade a loss in the consistency gadget for a gain in the constraint gadget. An approximation-hardness proof must therefore control the score of every induced partition, including slightly inconsistent partitions, and relate that score quantitatively to the value of a single global assignment.
Our reduction is from MAX-E3-LIN-2, where we are given a set of parity equations, each over three Boolean variables, and the goal is to maximize the number of satisfied equations. Håstad [18] showed that this problem is NP-hard to approximate within any factor strictly better than 2. Observe that we can view an assignment as a partition of all variable occurrences into true and false, subject to the requirement that all occurrences of the same variable receive the same value. Within an equation, the true occurrences form a subset of its three variable occurrences, and satisfaction depends only on the parity of this subset. Specifically, an equation is satisfied if an odd or even number of its variables are set to true, depending on the target parity. We encode this behavior in the total LCS score of the four input permutations.
The key ingredient is a parity-sensitive gadget based on two orders of three generic symbols, namely, and . For any subset , its LCS score is the maximum sum of LCS lengths of and to their median, all restricted to . While the score of an individual subset is not determined solely by its parity, we show that the total score of all subsets with the same parity depends only on this parity, and that there is a fixed unit gap in the scores of the two parity classes. The equation gadget then associates a satisfying assignment with the entire odd-parity class and a violating assignment with the entire even-parity class. Hence, each equation contributes a fixed baseline together with one additional unit exactly when it is satisfied.
For an arbitrary symbol partition, we decode a global assignment by taking the majority value for each variable on the consistency side. We then compare the LCS score of the given partition with the score of the induced assignment, and show an exact affine relation between the optimum median cost and the maximum number of satisfiable equations. This is precisely the quantitative control over arbitrary partitions required beyond Habib's equality-case argument. Further, it lets us leverage the gap obtained by Håstad [18] to derive hardness-of-approximation results for Ulam median. We present a detailed proof in Section 3.
Median hardness to center hardness. To transfer the hardness results to Ulam center, we use a cyclic block construction to reduce Ulam median to Ulam center. Given an Ulam median instance with m input permutations, we create m disjoint copies of its alphabet and construct m center inputs. All inputs use the same order of the alphabet copies, while the original permutations are arranged cyclically across them. Thus, every center input contains one copy of each original permutation, and every original permutation appears once in each block across the center instance.
Placing the same median candidate in every block makes its distance to each center input equal to its total distance in the original median instance. Conversely, the common block order lets us rearrange any center candidate blockwise without increasing its radius. Each block then defines a candidate median for the original instance, and at least one of them has median cost no larger than the center radius. The reduction therefore preserves the optimum value exactly and allows a median solution to be extracted from any center solution without incurring any additional loss (see Lemma 4.1). Consequently, both hardness results for Ulam median transfer to Ulam center. We provide a complete proof in Section 4.
2 Preliminaries
Notations. For , we use to denote the set . We use the notation to denote the union of two disjoint sets. For any set partitioned into disjoint subsets , we thus write .
Permutations and Ulam distance. For an alphabet , let denote the set of all permutations of . For a permutation and a subset , let denote the restriction of to the symbols in , with their relative order preserved. For two sequences and , let denote the length of a longest common subsequence. For any two , their Ulam distance is
We will repeatedly use the following elementary identity, which follows from the triangle inequality for the Ulam distance.
Lemma 2.1. Let be an alphabet and let . Then
Proof. Let . For every , the triangle inequality for Ulam distance gives
Using the definition of the Ulam distance between any two permutations , and rearranging, we obtain
This upper bound is attained by taking , since . The claimed equality follows. ☐
Ulam median. An instance of Ulam median is a set of permutations of a common alphabet . The problem asks to find a permutation that minimizes the total distance to input permutations, namely, . We denote the optimum value of the instance by
Ulam center. An instance of Ulam center is a set of permutations of a common alphabet . The problem asks to find a permutation that minimizes the radius . We denote the optimum value of the instance by
Approximation scheme. For the Ulam median problem, an algorithm is a polynomial-time approximation scheme (PTAS) if, given any constant and an instance of permutations over an alphabet of size , it computes in polynomial time a solution satisfying . An algorithm is an -additive approximation scheme for the Ulam median problem if it outputs a solution in polynomial time such that . The definition of PTAS for Ulam center is analogous to that of the median problem. An algorithm is an -additive approximation scheme for the Ulam center problem if it outputs a solution in polynomial time such that .
MAX-E3-LIN-2. An instance of MAX-E3-LIN-2 consists of a variable set over and a system of linear equations, each with exactly three variables. We write the -th equation as
where and denote the three variable occurrences in . For an assignment , let denote the number of equations satisfied by . The problem is to find an assignment that maximizes this value. We denote the optimum value of the instance by
For , let us define . We will use the following hardness result of Håstad [18].
Theorem 2.2 ([18]). Unless , for any , there is no polynomial-time algorithm that can distinguish whether for an instance of MAX-E3-LIN-2, with equations,
• , or
•
3 Hardness of Approximation for Ulam Median
In this section we show that the Ulam median problem is unlikely to have a PTAS; more specifically, we show the following.
Theorem 1.1. Unless , for any , there is no polynomial-time algorithm that approximates the Ulam median within a factor of , even when the input consists of four permutations.
We prove Theorem 1.1 by a gap-preserving reduction from MAX-E3-LIN-2. The reduction has three components. The equation gadget assigns a one-unit advantage to subsets encoding an assignment that satisfies an equation. The variable-consistency gadget rewards choosing the same truth value across all occurrences of a variable. Finally, a long common anchor block separates these two gadgets within an optimal median.
3.1 A key component: a parity-sensitive local gadget
Before presenting the full reduction, we isolate the elementary three-symbol gadget underlying the equation gadget, and explain how it can be used to distinguish whether a parity constraint is satisfied. Consider the set of three generic symbols and two permutations
of this set. For a subset , define
The individual values of depend on more than the cardinality or parity of . Nevertheless, when summed over an entire parity class, they exhibit the one-unit gap that we will need in the reduction.
Lemma 3.1. The sum of over the four odd-cardinality subsets of is 11, whereas its sum over the four even-cardinality subsets is 10.
Proof. By Lemma 2.1, we have for any set that . Evaluating all eight subsets of gives
| T | ||||||||
|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 2 | 2 | 3 | 3 | 4 | 5 |
Hence the odd-cardinality values sum to , while the even-cardinality values sum to .
Lemma 3.1 suggests the following way to encode a three-variable parity equation. Consider a bit vector and a target parity . We would like to associate with four subsets of such that these subsets are precisely the four odd-cardinality subsets when (correspondingly, the parity equation is satisfied), and precisely the four even-cardinality subsets otherwise (the equation is not satisfied). The total contribution of the four copies of the local gadget would then be 11 in the former case and 10 in the latter. To obtain this behavior, define the affine parity class
It is easy to check that for either value of . For each , associate with the subset of whose indicator vector is . Since
all four resulting subsets have odd cardinality if , and even cardinality otherwise. As ranges over , the indicator vectors range over the entire odd-parity class when , and over the entire even-parity class when .
By a slight abuse of notation, let denote for the subset having indicator vector . Lemma 3.1 gives
This symmetrization is one of the reasons for using the entire parity class . A single subset does not have a score determined solely by its parity; for example, whereas , although both sets have odd cardinality. By translating the entire parity class , the construction averages away this dependence on the particular local assignment and retains only whether the parity equation is satisfied. Thus, each equation will contribute a fixed baseline of 10, together with one additional unit exactly when it is satisfied.
The same choice of has a second property that will be crucial for enforcing consistency across different occurrences of a variable. For every coordinate , exactly two vectors in have and exactly two have . Hence, when the four copies corresponding to are introduced for an equation, each variable occurrence appears equally often with polarity 0 and polarity 1. This balance is crucial for the variable-consistency gadget.
3.2 The reduction
Recall that an instance of MAX-E3-LIN-2 consists of a variable set over and a system of linear equations, each with exactly three variables, where
for and . From now on, we refer to the instance by .
Equation gadget. For each equation , define
For every , introduce the three-symbol alphabet , whose symbols correspond, respectively, to the three variable occurrences in . Let and . Since for every , we have and .
Let var : be the function mapping each symbol to its corresponding variable occurrence. Specifically, , , and . Define the polarity function by , , and .
For each , consider the two local permutations
Fix an arbitrary order of vectors of and define
The two equation-gadget permutations are
Variable-consistency gadget. For a variable and a polarity , let
Fix an arbitrary total order of the symbols in , and from now on, consider this fixed ordering. Let denote the permutation of induced by this order. With , define variable blocks and for each variable and define
For each coordinate , exactly two vectors in satisfy , and exactly two satisfy . Hence every variable occurrence contributes exactly two symbols of each polarity. Consequently, for every ,
Anchor block and input permutations. Let . Consider a permutation over an alphabet that is disjoint from and of size . We refer to as an anchor block and the symbols in the alphabet as anchor symbols.
Construct four input permutations as follows:
Each permutation has length . We denote the resulting instance by
3.3 Gadget scores
We first establish a block-decomposition principle that we will use repeatedly.
Lemma 3.2 (Common block order). Let , and for let , where . Then, for every ,
Proof. For each , let . Since the sets are pairwise disjoint and each lists them in the same block order, restriction to gives
Let us first observe a blockwise property of LCS that we use later in the proof. Suppose that and , where and use only symbols from . For each , choose a longest common subsequence of and . Concatenating these subsequences in block order produces a common subsequence of and . Hence
Conversely, let be any common subsequence of and . Because both and visit the blocks in the order , the symbols of also visit these blocks in nondecreasing order. Thus can be written as , where consists of the symbols of lying in . The sequence is a common subsequence of and , so
Maximizing over C proves the exact identity
We now argue the lower-bound direction of the claimed equality. For each , choose a permutation that maximizes
and concatenate these local optimizers in block order: . Applying (2) separately for and gives
Since , we derive that
For the reverse direction, fix an arbitrary . Obtain by stably sorting the symbols of according to the block order : symbols from precede symbols from , while the relative order of symbols belonging to the same block is unchanged. We claim that, for each ,
Indeed, take a longest common subsequence of and . Since visits the blocks in the order , the block indices of the symbols along are nondecreasing. Stable sorting places symbols from different blocks in exactly this order and preserves their relative order within every block. Consequently, is a subsequence of , establishing (3).
For , let , where the restriction retains the order inherited from . By the definition of the stable sort, . So we get
(by (3))
(by (2))
This bound holds for every , and therefore also after maximizing over . Together with the lower-bound direction, it proves the lemma. Note that if some is empty, the same argument applies with the unique empty permutation and a zero LCS contribution for that block.
For , define
and
Lemma 3.3. For every ,
Moreover, if is an assignment and then
Proof. To establish the identity (4), apply Lemma 3.2 with and for . Indeed, the two permutations , for , list the disjoint equation blocks in the same order. The lemma therefore gives
and the right-hand side is exactly .
We next refine the decomposition of into the four copies belonging to each equation; afterward we specialize to . Consider the set of generic symbols introduced in Subsection 3.1. For each and , let us consider the following bijection
that maps to , respectively. By abusing notation, extend symbolwise to sequences over . Fix , and abbreviate
Since is a sequence of alphabet , is the same as . Recall that the four vectors of were placed in a fixed order . Restricting to preserves this common block order and gives, for ,
Lemma 3.2, applied to these four disjoint subblocks with ambient alphabet and subset , therefore gives
It remains to identify each summand on the right. Recall that and . Observe that for every locally optimal permutation and ,
Moreover, a sequence is a common subsequence of and if and only if is a common subsequence of and . This correspondence preserves sequence lengths and is reversible using ; hence
Finally, is a bijection from the set of permutations to . Consequently, the local maximum in (5) is
Substituting this identity into (5) gives, for each fixed j,
Finally, summing this equality over and using the definition of yields
Next, fix an equation , and let
In , the block indexed by , the symbol corresponding to belongs to precisely when . Thus the indicator vector of is . Moreover, every satisfies , so
The translation is injective, and both and each parity class in have four elements. Consequently, its four images are the entire parity class specified by (7); as illustrated in Figure 1.

Figure 1: The two-level decomposition used in Lemma 3.3. The aligned input rows decompose by equation. For a fixed equation , its four subblocks are indexed by , and translation by maps them bijectively onto an entire parity class, whose local scores sum to 11 or 10.
If satisfies , then , and thus . The four sets appearing in the inner sum of (6) are therefore exactly the four odd-cardinality subsets of , whose -values sum to 11 by Lemma 3.1. If violates , then , and thus . Then the four sets are exactly the four even-cardinality subsets, whose -values sum to 10 by Lemma 3.1.
Finally, since exactly of the equations are satisfied, (6) gives

Lemma 3.4. For every ,
Proof. Apply Lemma 3.2 to the common variable-block order . Fix a variable , and abbreviate . Within the -block, the two restricted permutations are
Since a common subsequence of these permutations cannot contain symbols from both polarity classes, their longest common subsequence has length . Lemma 2.1 therefore gives the local optimum
Summing over all variables proves the claim.

3.4 The anchor block
Recall that is the anchor block and the symbols in are anchor symbols. Also, is of size , where (the number of non-anchor symbols). Next, we argue that in our reduction, the anchor block ensures that the equation gadget and the variable-consistency gadget interact only through a partition of .
Lemma 3.5.
Proof. We first prove the lower-bound direction. Fix a partition such that , and choose and attaining the optima in Lemmas 3.3 and 3.4, respectively. Consider a candidate permutation .
Fix . Any common subsequence of and that contains an anchor symbol cannot contain a symbol of , because every symbol of occurs after all anchors in the first permutation, whereas every non-anchor symbol occurs before all anchors in . Hence such a common subsequence has length at most , which is attained by taking an LCS of and followed by all of Z. A common subsequence containing no anchor symbol has length at most . Therefore,
By a symmetric argument,
Summing over the four permutations of our reduced instance and applying Lemmas 3.3 and 3.4 gives
Since the argument holds for any partition , maximizing over the partition proves the lower bound
For the other direction, fix an arbitrary . We first argue that it suffices to assume that the anchor symbols occur in in the order . Write , and let be obtained from by leaving all non-anchor symbols in their original positions (as in ) while replacing the anchor symbols, from left to right, by .
To see that this reordering of anchor symbols cannot decrease any of the four LCS values, consider an arbitrary permutation of . For any position , let and denote the prefix and suffix of separated at the cut position , respectively. Observe that if ranges over all cuts of , including the two end cuts, then
and
For any cut position such that the prefix contains anchor symbols, we have and . Thus, the corresponding contributions of the anchor symbols in the LCS with are exactly and , respectively, which are also the largest possible values for a suffix and prefix containing those numbers of anchor symbols. Since the contribution of the non-anchor symbols in the LCS is unchanged, we have for every .
It remains to bound the score of . Let be the set of symbols of occurring before the central anchor in , and let . For a cut position , let denote the number of anchor symbols in the prefix . For , we have
Any cut with gives a value at most , whereas the cut immediately before the first anchor gives a value at least . Hence an optimizing cut satisfies . Its -prefix is therefore a subsequence of , so
Recall, for , . Summing over and applying Lemma 3.3 gives
Similarly,
Any cut with gives a value at most , whereas the cut immediately after the last anchor gives a value at least . Hence an optimizing cut satisfies . Its -suffix is therefore a subsequence of , and consequently
Recall, for , . Summing over and applying Lemma 3.4 gives
Combining (8) and (9) yields
Maximizing over all shows the upper bound
and that completes the proof of the lemma.
3.5 From partitions to assignments
We will later use the following Lipschitz-type property of the function defined in Subsection 3.1.
Lemma 3.6. For all ,
Proof. By Lemma 2.1, for any subset ,
Adding one symbol to increases the cardinality term by one, while the LCS term cannot decrease and can increase by at most one. Hence, for each ,
where the last inequality is derived by repeatedly adding symbols in one by one to obtain and applying the upper bound inequality of (10), and by repeatedly adding symbols in one by one to obtain and applying the lower bound inequality of (10).
Lemma 3.7.
Proof. We first prove the lower-bound direction. Let be an assignment satisfying exactly equations, and consider the following partition
Recall that for a variable and polarity , . Then observe that for , the symbols in lie in , while those in lie in . By (1), each of these sets has size . Consequently, and . Lemma 3.3 gives . Therefore,
Thus clearly,
For the other direction, fix an arbitrary partition such that . For each , choose a polarity such that
breaking ties arbitrarily, and then consider an assignment that sets for every . Call a symbol true if , and false otherwise. Let denote the set of all true symbols. Let be the number of false symbols in , and let be the number of true symbols in . For each variable , its false symbols are precisely , and by the definition of , the number of false symbols in is exactly the contribution of variable to . Since there are false symbols in total, we have and .
As in the proof of Lemma 3.3, consider the set of generic symbols introduced in Subsection 3.1. For each and , let us consider the following bijection
that maps to , respectively. By abusing notation, extend symbolwise to sequences over . For every and , define
Applying Lemma 3.6 with and gives
Summing over all and , the first set-difference term counts exactly the false symbols placed in ; more specifically,
while the second set-difference term counts exactly the U true symbols placed in , i.e.,
Together with the definition of and Lemma 3.3, this yields
Rearranging, we obtain
Since the partition we consider is arbitrary, it follows that
and that concludes the proof.
3.6 Optimum value and hardness proofs
We now relate the optimum value of the constructed Ulam median instance to that of the original MAX-E3-LIN-2 instance.
Lemma 3.8. For every MAX-E3-LIN-2 instance , the instance constructed in Subsection 3.2 satisfies
Proof. Note every input permutation in has length . Then,
We are now ready to complete the proof of Theorem 1.1.
Proof of Theorem 1.1. For the sake of contradiction, assume that there exists a polynomial time -approximation algorithm for the Ulam median problem for some . Given a MAX-E3-LIN-2 instance with equations, we first construct an Ulam median instance (as described in Subsection 3.2) and then run the approximation algorithm to obtain a solution . Using the affine relation in Lemma 3.8 and the approximation guarantee, we have, for every ,
• If , then , and
• If , then .
That is, a -approximation algorithm for the Ulam median problem for any would distinguish MAX-E3-LIN-2 instances in which at least a fraction of the equations can be satisfied from those in which at most a fraction of equations can be satisfied for some , contradicting Theorem 2.2.
Next, we use the same reduction to refute the plausibility of attaining an additive approximation; more specifically, we show the following.
Theorem 1.2. Unless , for any , there is no polynomial-time algorithm that computes an -additive approximation of Ulam median with input permutations over an alphabet of size , even when .
Proof. Assume for contradiction that there exists a polynomial-time -additive approximation for Ulam median with some . Given a MAX-E3-LIN-2 instance with equations, we first construct an Ulam median instance consisting of input permutations and then run the additive approximation algorithm to obtain a solution with length . Using the affine relation in Lemma 3.8 and the approximation guarantee, we have, for every ,
• If , then ,
• If , then .
This means that an -additive approximation for the Ulam median problem for any would distinguish MAX-E3-LIN-2 instances in which at least a fraction of the equations can be satisfied from those in which at most a fraction of equations can be satisfied for some , contradicting Theorem 2.2.
4 Hardness of Approximation for Ulam Center
We now reduce Ulam median to Ulam center while preserving both the number of input permutations and the optimum value. Together with Theorem 1.1, this yields the claimed hardness of Ulam center.
Theorem 1.3. Unless , for any , there is no polynomial-time algorithm that approximates the Ulam center within a factor of , even when the input consists of four permutations.
We first describe an approximation factor-preserving reduction from the Ulam median problem to the Ulam center problem.

Figure 2: The median-to-center reduction for m = 4. Cyclic shifts place every original input once in every row and column, preserving the optimum.
Lemma 4.1 (Median-to-center reduction). There is a polynomial-time algorithm that, given an instance of Ulam median over an alphabet of size , constructs an instance of Ulam center consisting of permutations over an alphabet of size such that . Moreover, from any center solution for of radius at most , one can compute in polynomial time a permutation with .
Proof. For each , let be a disjoint copy of . For a permutation , let denote its copy on . The center instance is defined over the alphabet as follows. For each , define
where the notation denotes the sum modulo . Thus, every contains one copy of every input permutation, and these copies are cyclically shifted across the blocks. The construction is illustrated in Figure 2.
We first show that a center candidate can be assumed to respect the common block order. Let be an arbitrary permutation of , and let be obtained by stably sorting the symbols of according to the block order , while preserving the relative order within each block. Every has this same block order. Hence every common subsequence of and already visits the blocks in this order, and stable sorting preserves such a subsequence. Therefore, for every ,
For each , let denote the restriction of to the -th alphabet copy , where the symbols are replaced by their counterparts in the original alphabet . Since and have the same block order, their LCS decomposes across the blocks, and therefore
Averaging over gives
The second equality holds because, for every fixed , the (cyclic) index () ranges over exactly once as ranges over . Since
every center candidate has radius at least . Hence .
For the reverse inequality, let be an optimal median for , and consider
For every , the block decomposition gives
Thus, has radius , and therefore . Together with the previous lower bound, this proves equality of the optimum values.
Finally, suppose that a center solution has radius at most . Construct and as above. Since stable sorting does not increase any distance, for every . Therefore,
Hence at least one satisfies . Computing all and returning one of minimum cost proves the extraction claim.
Proof of Theorem 1.3. Suppose that, for some , there is a polynomial-time -approximation algorithm for Ulam center with four input permutations. Given any four-input Ulam median instance , apply Lemma 4.1 to construct the four-input center instance . Since the construction preserves the optimum value, we can compute a solution for the Ulam median with
contradicting Theorem 1.1.
Next, we use the same reduction to refute the plausibility of attaining an additive approximation; more specifically, we show the following.
Theorem 1.4. Unless , for any , there is no polynomial-time algorithm that computes an -additive approximation of the Ulam center with input permutations over an alphabet of size , even when .
Proof. Assume for contradiction that there exists a polynomial-time -additive approximation algorithm for the Ulam center problem with some . Given an Ulam median instance consisting of four input permutations, each of length , we first construct an Ulam center instance consisting of permutations, each of length . We then run the additive approximation algorithm to obtain a solution . By Lemma 4.1, from , we can compute in polynomial time a solution for the Ulam median problem of the instance , satisfying
contradicting Theorem 1.2.
5 Conclusion
We established explicit constant-factor inapproximability for rank aggregation under the Ulam metric. In particular, unless P = NP, neither Ulam median nor Ulam center admits a PTAS, even when the instance consists of only four input permutations. For the median objective, the reduction combines an affine parity gadget with reversed polarity blocks and a long anchor, yielding an exact affine relation between the median cost and the optimum of MAX-E3-LIN-2. For the center objective, the cyclic block construction preserves the optimum value and permits the lossless extraction of a median solution from any center solution. The same linear gap also rules out polynomial-time additive approximation schemes.
A natural next step is to narrow the substantial gap between these lower bounds and the best known approximation algorithms. It would be especially interesting to obtain stronger hardness of approximation even for an arbitrary number of inputs, or to identify additional structure that can be exploited algorithmically. For Ulam center, determining whether one can beat factor 2 when the number of inputs is part of the input remains another compelling open direction.
AI Disclosure. The core technical idea underlying this paper was initially developed with the assistance of ChatGPT 5.6 Sol. The authors carefully examined, refined, and independently verified the resulting ideas and arguments, and rewrote to provide their own motivation, exposition, and proof structure. The final paper reflects the authors' own understanding of the results, and the authors take full responsibility for all mathematical claims, proofs, and references.
References
[1] Nir Ailon, Moses Charikar, and Alantha Newman. Aggregating inconsistent information: Ranking and clustering. J. ACM, 55(5):23:1–23:27, 2008.
[2] Alexandr Andoni and Huy L. Nguyen. Near-optimal sublinear time algorithms for Ulam distance. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, pages 76–86, 2010.
[3] Mahdi Boroujeni and Saeed Seddighin. Improved MPC algorithms for edit distance and Ulam distance. In The 31st ACM on Symposium on Parallelism in Algorithms and Architectures, SPAA 2019, pages 31–40, 2019.
[4] Felix Brandt, Vincent Conitzer, Ulle Endriss, Jérôme Lang, and Ariel D Procaccia. Handbook of computational social choice. Cambridge University Press, 2016.
[5] Amir Carmel, Debarati Das, and Tien-Long Nguyen. A Scalable and Unified Framework to Weighted Rank Aggregation. In Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis, editors, 53rd International Colloquium on Automata, Languages, and Programming (ICALP 2026), volume 374 of Leibniz International Proceedings in Informatics (LIPIcs), pages 49:1–49:23, Dagstuhl, Germany, 2026. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
[6] Diptarka Chakraborty, Debarati Das, and Robert Krauthgamer. Approximating the median under the Ulam metric. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 761–775. SIAM, 2021.
[7] Diptarka Chakraborty, Debarati Das, and Robert Krauthgamer. Clustering permutations: New techniques with streaming applications. In 14th Innovations in Theoretical Computer Science Conference (ITCS 2023), volume 251 of Leibniz International Proceedings in Informatics (LIPIcs), pages 31:1–31:24. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2023.
[8] Diptarka Chakraborty, Kshitij Gajjar, and Agastya Vibhuti Jha. Approximating the center ranking under Ulam. In 41st IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2021), volume 213 of Leibniz International Proceedings in Informatics (LIPIcs), pages 12:1–12:21. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2021.
[9] Moses Charikar and Robert Krauthgamer. Embedding the Ulam metric into . Theory of Computing, 2(11):207–224, 2006.
[10] Graham Cormode, Shan Muthukrishnan, and Süleyman Cenk Sahinalp. Permutation editing and matching via embeddings. In International Colloquium on Automata, Languages, and Programming, pages 481–492. Springer, 2001.
[11] Cynthia Dwork, Ravi Kumar, Moni Naor, and D. Sivakumar. Rank aggregation methods for the web. In Proceedings of the Tenth International World Wide Web Conference, WWW 10, pages 613–622, 2001.
[12] Ronald Fagin, Ravi Kumar, and D. Sivakumar. Efficient similarity search and classification via rank aggregation. In Proceedings of the 2003 ACM SIGMOD International Conference on Management of Data, San Diego, California, USA, June 9-12, 2003, pages 301–312, 2003.
[13] Nick Fischer, Elazar Goldenberg, Mursalin Habib, and Karthik C. S. Hardness of Median and Center in the Ulam Metric. In Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman, editors, 33rd Annual European Symposium on Algorithms (ESA 2025), volume 351 of Leibniz International Proceedings in Informatics (LIPIcs), pages 111:1–111:17, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
[14] Nick Goldman, Paul Bertone, Siyuan Chen, Christophe Dessimoz, Emily M. LeProust, Botond Sipos, and Ewan Birney. Towards practical, high-capacity, low-maintenance information storage in synthesized DNA. Nature, 494(7435):77–80, 2013.
[15] Dan Gusfield. Algorithms on Strings, Trees, and Sequences - Computer Science and Computational Biology. Cambridge University Press, 1997.
[16] Mursalin Habib. Ulam median is NP-hard for four permutations, 2026.
[17] Donna Harman. Ranking algorithms. In William B. Frakes and Ricardo A. Baeza-Yates, editors, Information Retrieval: Data Structures & Algorithms, pages 363–392. Prentice-Hall, 1992.
[18] Johan Håstad. Some optimal inapproximability results. Journal of the ACM, 48(4):798–859, 2001.
[19] Ragesh Jaiswal, Amit Kumar, and Jatin Yadav. Robust-sorting and applications to Ulam-Median. In 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), pages 100–1. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2025.
[20] Claire Kenyon-Mathieu and Warren Schudy. How to rank with few errors. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 95–103, 2007.
[21] Teuvo Kohonen. Median strings. Pattern Recognition Letters, 3(5):309–313, 1985.
[22] Péter Madarasi. The complexity of Kemeny aggregation with three rankings. arXiv preprint arXiv:2607.28588, 2026.
[23] Carlos D. Martínez-Hinarejos, Alfons Juan, and Francisco Casacuberta. Use of median string for classification. In Proceedings 15th International Conference on Pattern Recognition, ICPR 2000, volume 2, pages 903–906. IEEE, 2000.
[24] Timothy Naumovitz, Michael E. Saks, and C. Seshadhri. Accurate and nearly optimal sublinear approximations to Ulam distance. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2012–2031, 2017.
[25] Dominik Peters. Kemeny rank aggregation is NP-hard for three voters. arXiv preprint arXiv:2607.25540, 2026.
[26] Pavel Pevzner. Computational molecular biology: an algorithmic approach. MIT press, 2000.
[27] Cyrus Rashtchian, Konstantin Makarychev, Miklós Z. Rácz, Siena Ang, Djordje Jevdjic, Sergey Yekhanin, Luis Ceze, and Karin Strauss. Clustering billions of reads for DNA data storage. In Advances in Neural Information Processing Systems 30, pages 3360–3371. Curran Associates, Inc., 2017.
[28] David Sankoff. Minimal mutation trees of sequences. SIAM Journal on Applied Mathematics, 28(1):35–42, 1975.