Abstract 1 Introduction 2 Preliminaries 3 The Complexity of Ulam Metric k-Center 4 The Complexity of Ulam Metric 𝒌-Median 5 Conclusion References

Clustering Permutations Under the Ulam Metric:
A Parameterized Complexity Study

Tian Bai ORCID University of Bergen, Norway    Fedor V. Fomin ORCID University of Bergen, Norway    Petr A. Golovach ORCID University of Bergen, Norway    Yash Hiren More ORCID University of Bergen, Norway    Simon Wietheger ORCID TU Wien, Austria
Abstract

Rank aggregation seeks a representative permutation for a collection of rankings and plays a central role in areas such as social choice, information retrieval, and computational biology. Two fundamental aggregation tasks are the center and median problems, which minimize the maximum and the total distance to the input permutations, respectively. While these problems are well understood under Kendall’s tau and related distances, their parameterized complexity under the Ulam metric, an edit-distance-based metric on permutations, has remained largely unexplored.

In this work, we initiate a systematic study of the parameterized complexity of rank aggregation under the Ulam metric. We consider both the center and median problems, as well as their generalizations to the k-center and k-median clustering settings, parameterized by the number of centers k and the distance budget d (corresponding to the maximum distance for center variants and the total distance for median variants). Both problems are known to be NP-hard already for k=1.

We show that the Ulam k-center problem remains NP-hard when d=1, but is fixed-parameter tractable when parameterized by k+d. Our algorithm is based on a novel local-search framework tailored to the non-local nature of Ulam distances. We complement this by proving that no polynomial kernel exists for the k+d parameterization unless 𝖭𝖯𝖼𝗈𝖭𝖯/𝗉𝗈𝗅𝗒. For the Ulam k-median problem parameterized by the total distance d, we establish 𝖶[1]-hardness and provide an 𝖷𝖯 algorithm. We also provide a polynomial kernel for the parameter k+d, which in turn yields a fixed-parameter tractable algorithm.

Keywords and phrases:
parameterized complexity, Ulam distance, rank aggregation, clustering
Category:
Track A: Algorithms, Complexity and Games
Funding:
Tian Bai: Funded by the European Union, GA#101126560; Bergen research and training program for future AI leaders across the disciplines, LEAD AI and by the Trond Mohn forskningsstiftelse (grant no. TMS2023TMT01).
Fedor V. Fomin: margin: [Uncaptioned image] Supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (NewPC grant agreement No. 101199930).
Petr A. Golovach: Supported by the Research Council of Norway under the BWCA (grant no. 314528) and Extreme-Algorithms (grant no 355137) projects.
Yash Hiren More: Supported by the Trond Mohn forskningsstiftelse (grant no. TMS2023TMT01).
Simon Wietheger: Supported by the Austrian Science Foundation (FWF, project 10.55776/Y1329).
Copyright and License:
[Uncaptioned image] © Tian Bai, Fedor V. Fomin, Petr A. Golovach, Yash Hiren More, and Simon Wietheger; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithms
; Mathematics of computing Permutations and combinations
Related Version:
Full Version: http://arxiv.org/abs/2604.25734
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

Rank aggregation is the problem of computing a representative ranking from a collection of permutations representing the preferences of individual voters. The roots for a mathematical investigation of this problem can be traced back to early studies of social choice theory and voting systems like Borda (1781) and Condorcet (1785), as well as later seminal works such as those by Arrow [4] or Diaconis and Graham [20]. Rank aggregation constitutes a fundamental task with broad applications in social choice theory, information retrieval, computational biology, and database systems [1, 4, 21, 30, 19]. Algorithmically, two canonical rank aggregation tasks are to compute the center and the median of permutations. Given a distance function dist(,) on the space 𝒮n of permutations over n symbols, the center of a permutation set Π𝒮n is a permutation σ𝒮n minimizing

maxπΠdist(π,σ),

whereas the median of Π is a permutation σ𝒮n minimizing

πΠdist(π,σ).

Among distance measures for rank aggregation, Kendall’s tau and the Ulam metric are the two most natural and fundamental metrics, extensively studied in both theory and applications [14]. Kendall’s tau distance counts the number of pairwise disagreements between two permutations, thereby capturing local inconsistencies in ranking order. In contrast, the Ulam metric is an edit distance that measures the minimum number of element move operations (deletion and insertion) required to transform one permutation into another. This metric captures global structural differences by isolating the longest common subsequence (the elements that are not moved) and quantifying how many elements must be relocated to achieve alignment.

The tasks of computing centers and medians under Kendall’s tau metric are well understood from different computational perspectives [2, 10, 21, 22, 27, 30, 33]. Finding the optimal center or median under Kendall’s tau is 𝖭𝖯-hard already if there are just four input permutations [10, 21]. Additionally, the median under Kendall’s tau, also known as Kemeny rankings, admits a polynomial-time approximation scheme (PTAS) [27]. Both versions of rank aggregation under Kendall’s tau admit fixed-parameter tractable (FPT) algorithms parameterized by the solution cost [5, 7], and other natural parameters [8, 9, 16, 17, 23].

In contrast, the study of rank aggregation under the Ulam metric is relatively unexplored, especially from the perspective of parameterized complexity. A key reason is that Ulam distance is a global measure whose combinatorial structure is inherently harder to exploit algorithmically than the local nature of Kendall’s tau. Consequently, some algorithmic work has focused on estimating the distance itself. Andoni and Nguyen [3] and Naumovitz et al. [29] developed sublinear-time approximation schemes to estimate the Ulam distance between two permutations, using connections to calculate the longest common subsequence.

Finding an optimal center under the Ulam metric was shown to be 𝖭𝖯-hard over a decade ago [5], while the median problem was only recently proven 𝖭𝖯-hard [24]. A folklore 2-approximation exists for both the median and center variants under the Ulam metric. Recently, Chakraborty et al. [15] obtained a (1.5ε)-approximation (with any ε>0) for the center problem with running time exponential in the number of input permutations m. At a similar time, the first approximation algorithm to break the barrier of 2 for the median problem appeared [12]. The subsequent work [13] extends the approximation framework to the setting of finding k medians, achieving a similar approximation guarantee in time (klog(mn))𝒪(k)mn3, where n is the size of the alphabet and m is the number of input permutations. Very recently, Jaiswal et al. [26] improved on this work and provided a randomized algorithm running in O~((2k)knd) time. All three works on the median problem provide guarantees close to but below an approximation factor of 2.

To the best of our knowledge, no prior work has considered Ulam-based aggregation through parameterized exact algorithms, despite the metric’s intimate connection to edit distance and longest common subsequence – domains where parameterized techniques have proven highly effective. The clustering problems under the Ulam metric seem more challenging, as the Ulam metric is a more complex and less local measure than Kendall’s tau, which may suggest that the computational landscape of Ulam-based aggregation could be significantly different. One may notice that the Ulam distance is a smaller parameter than Kendall’s tau, as every permutation can be transformed into the other by only moving the elements that are in a different order in the two permutations. It may happen that two permutations with Ulam distance 1 could differ in the relative order of an unbounded number of pairs of elements. This highlights a fundamental structural disparity between the two distance measures, which leads to the following natural question:

What is the parameterized complexity of rank aggregation under the Ulam metric?

1.1 Clustering Under the Ulam Metric: Definitions and Main Results

In this work, we initiate a systematic study of the parameterized complexity of rank aggregation under the Ulam metric. Beyond the classical parameter d, which captures the solution cost (the maximum distance or the sum of distances, respectively), we consider substantially more general variants of the problem: k-center and k-median clustering under the Ulam metric [13]. These extensions, denoted by Ulam Metric k-Center and Ulam Metric k-Median, are both natural and well established in the rank aggregation literature. In these problems, one seeks k representative permutations that minimize, respectively, the maximum distance to any assigned permutation (k-center) or the total sum of distances (k-median).

Formally, let 𝒮n(Σ) be the set of all permutations over an alphabet Σ of size n, and let distU(π,σ) be the Ulam distance between π and σ in 𝒮n(Σ) (see Section 2 for the formal definitions). We define our problems of interest as follows.

Ulam Metric k-Center

 Input: An alphabet Σ of size n, a set of permutations Π={π1,π2,,πm}𝒮n(Σ), and integers k and d.

Task: Decide whether there exists a set S={σ1,σ2,,σk}𝒮n(Σ) of k centers such that

maxπΠminσSdistU(π,σ)d.

Ulam Metric k-Median

 Input: An alphabet Σ of size n, a multiset of permutations Π={π1,π2,,πm}𝒮n(Σ), and integers k and d.

Task: Decide whether there exists a set S={σ1,σ2,,σk}𝒮n(Σ) of k medians such that

πΠminσSdistU(π,σ)d.

We remark that, in both clustering problems, the centers or medians are not required to belong to the input set of permutations Π. Hence, we consider variants of the problems that are referred to as continuous in some literature. Both problems are known to be 𝖭𝖯-hard already for k=1: hardness for the center variant was shown by Bachmaier et al. [5] and for the median by Fischer et al. [24].

We summarize our main results in Table 1. Most notably, we establish fixed-parameter tractability for both problems when parameterized simultaneously by k and d. Prior to our work, the parameterized complexity of these two clustering problems with respect to d was not even settled for the much simpler case k=1.

We contrast this tractability result by establishing hardness for parameterization by d alone: Ulam Metric k-Center is already 𝖭𝖯-hard on instances with d=1. In contrast, Ulam Metric k-Median is in 𝖷𝖯 parameterized by d (that is, solvable in polynomial time for each fixed d), but is 𝖶[1]-hard for parameter d, ruling out fixed-parameter tractability under well-established complexity assumptions. Finally, we discover yet another difference in the tractability landscapes of Ulam Metric k-Center and Ulam Metric k-Median. While the latter admits a polynomial-sized kernel, we rule out the existence of such a kernel for Ulam Metric k-Center under established complexity assumptions. Our results for the Ulam metric complement the mature theory developed for Kendall’s tau. We also hope that they provide rigorous foundations for consensus ranking in applications where global structural coherence under the Ulam metric is essential.

In the following, we provide a detailed overview of our results and the techniques employed. Formal proofs are deferred to Sections 3 and 4. Some details and proofs marked by () are omitted due to space constraints.

Table 1: Summary of our results.
Parameters k-center k-median
k 𝖭𝖯-hard even if k=1 [5] 𝖭𝖯-hard even if k=1 [24]
d 𝖭𝖯-hard even if d=1 (Theorem 1) 𝖶[1]-hard, 𝖷𝖯 (Theorems 5 and 4)
k+d 𝖥𝖯𝖳 (Theorem 2) 𝖥𝖯𝖳 (Corollary 7)
no polynomial kernel (Theorem 3) polynomial kernel (Theorem 6)

1.2 Contributions and Techniques for Ulam Metric k-Center

The first group of results in our work concerns Ulam Metric k-Center. As previous work already established that it is unlikely to obtain polynomial time algorithms even for instances aiming for k=1 center, it is natural to ask for the tractability on instances where we instead restrict the radius of the centers to d=1. We answer this question negatively by establishing the 𝖭𝖯-hardness of Ulam Metric k-Center for d is any positive constant at least 1. This hardness result is established via a reduction from the Vertex Cover problem on triangle-free graphs.

Theorem 1 ().

Ulam Metric k-Center is 𝖭𝖯-hard even if d is fixed to any positive constant at least 1.

The construction for d=1 is relatively straightforward but closes an important gap: it establishes that parameterization by d alone cannot yield fixed-parameter tractability under standard complexity assumptions. The main idea of the reduction is to construct an alphabet consisting of two symbols v,v¯ per vertex v in the vertex cover instance. The input set Π contains one permutation per edge, all sharing a common base ordering except that the symbol pairs of the two endpoints of the edge are swapped in the respective permutation. A vertex cover then corresponds to a set of center permutations, each encoding a vertex by swapping the respective symbol pair in the base ordering. Then each permutation encoding an edge has Ulam distance 1 to only those permutations encoding vertices to which the edge is incident, which ensures an equivalence between the vertex cover instance and the Ulam Metric k-Center instance. We defer a formal proof to Section 3, but provide an exemplary reduction in Figure 1.

Σ ={v,v¯,w,w¯,x,x¯,y,y¯,z,z¯}
Π ={πvw,πwx,πwy,πxz}
S ={σw,σx}
πvw =v¯vw¯wxx¯yy¯zz¯
πwx =vv¯w¯wx¯xyy¯zz¯
πwy =vv¯w¯wxx¯y¯yzz¯
πxz =vv¯ww¯x¯xyy¯z¯z
σw =vv¯w¯wxx¯yy¯zz¯
σx =vv¯ww¯x¯xyy¯zz¯
Figure 1: Exemplary vertex cover instance with solution {w,x} (black vertices) and the constructed instance of Ulam Metric k-Center with solution S={σw,σx}.

A nontrivial challenge is that a single permutation – swapping symbol pairs of multiple vertices – might cover several edges without corresponding to any single vertex in a cover. We circumvent this problem by basing our reduction on triangle-free instances of Vertex Cover, so this case will never occur. Furthermore, a direct reduction from the d=1 case to general d is non-trivial; we overcome this by augmenting the d=1 construction with additional corresponding symbols for each vertex.

The 𝖭𝖯-hardness of Ulam Metric k-Center even if d=1 or if k=1 naturally raises the question of the parameterized complexity of the problem with the combined parameter k+d. The following theorem establishes fixed-parameter tractability with respect to this combined parameter.

Theorem 2.

Ulam Metric k-Center can be solved in 2𝒪(d2k(d+k))mn1+o(1) time, where m|Π| and n|Σ|.

On first glance, it may seem that the finite number of permutations in our space would allow for an approach based on some simple branching and local search around some permutation πΠ. This approach is infeasible, however, as for a permutation π of length nd, there are nΩ(d) permutations within Ulam distance d from π, each of which is a potential candidate for the center. This lower bound follows from a simple counting argument. One can choose d symbols from the first half of π in (n/2d) ways and insert them into the second half in at least (n/2)d distinct ways, yielding a unique permutation at Ulam distance at most d from π.

A natural alternative is to adapt techniques from string-based clustering, which typically perform bounded local search around a candidate solution and iteratively improve it by resolving “dissimilarities” with inputs that exceed the target distance d. Such a paradigm is well-known and has been highly successful for problems such as Closest String [25] where the “dissimilarities” correspond to bits contributing to the Hamming distance. However, two permutations can admit Ω((n/d)d) distinct LCSs of the same maximum length, making it impossible to pinpoint a canonical set of elements to guide local improvements. Thus, such techniques from string-based clustering cannot directly apply to the Ulam metric, and more involved methods are required. Our algorithm embarks on a similar approach as the one by Gramm et al. [25]. Rather sooner than later, however, the issue of not having a unique witness LCS requires much more involved techniques and branching procedures tailored to the Ulam metric to establish fixed-parameter tractability.

In our algorithm, we construct a family of candidate permutations that are at bounded Ulam distances from hypothetical centers. These permutations will eventually converge towards the center permutations. If k=1, then such a candidate can be initially chosen as an arbitrary permutation from Π; note that it should be at the Ulam distance at most d from a center in any YES-instance of the problem. For k2, we initiate the set of candidates using the idea behind the standard 2-approximation for the k-Center problem. On each step, we either conclude that the current set of candidates can serve as centers, that is, each permutation in Π is at distance at most d from one of the candidates, or find a guide permutation πg at distance at least d+1 from all the candidates. Then we can guess a candidate permutation πc that should be transformed to a center for the cluster containing the guide. Our crucial result (Lemma 16) shows that, given πc and πg, we can efficiently (in FPT time) enumerate a set of permutations with distance one to πc such that for any hypothetical center, there is a permutation in the set that is closer to the center than πc was, see Figure 2 for a visualization of this idea. The proof of Lemma 16 is rather sophisticated and combines the random separation [11] and branching techniques. The random separation is used to highlight elements of πc and πg that should be moved to make these permutations closer to the center and the neighbors of these elements that are not moved. Then we identify an element of πc that should be moved and, after that, find an appropriate place for this element using branching. Repeatedly invoking Lemma 16, we ensure that the candidate permutations converge to the centers.

Figure 2: Illustration of the key idea behind our FPT algorithm for the k-center problem under Ulam distance. πc denotes a candidate center, πg a guide permutation with distance between d and 2d from πc, and σ represents the true (optimal) center that covers both πc and πg. We enumerate in FPT time a set of permutations (shown as {p1,p2,p3,p4}) at distance 1 from πc. Among these candidates, at least one candidate (shown as p3) reduces the Ulam distance to σ and thus corresponds to a correct branch.

The fixed-parameter tractability of Ulam Metric k-Center with parameter k+d established in Theorem 2 immediately leads to the question about the existence of a polynomial kernel for this problem. The following theorem provides a negative answer to this question.

Theorem 3 ().

Ulam Metric k-Center does not admit a polynomial-sized kernel for the parameter k+d unless NPcoNP/poly.

The lower bound of Theorem 3 holds already for k=1. The proof is based on a Polynomial Parameterized Transformation (PPT) reduction from the classical Closest String problem to Ulam Metric k-Center. To build such a transformation, we employ a distance-preserving transformation between binary strings and permutations, where for every pair of binary strings, their Hamming distance is the same as the Ulam distance between the permutations to which they translate. The reduction establishes that from the perspective of parameterized complexity with respect to the radius d, Ulam Metric k-Center is at least as hard as Closest String. Theorem 3 then follows by pipelining the PPT with established lower bounds on the kernelization of Closest String by Basavaraju et al. [6].

1.3 Contributions and Techniques for Ulam Metric k-Median

The second group of results is concerned with Ulam Metric k-Median. Recall that the problem is 𝖭𝖯-hard for k=1 [5]. While Ulam Metric k-Center is also 𝖭𝖯-hard for d=1, this is not the case for Ulam Metric k-Median. It is easy to obtain a polynomial-time algorithm for this problem for each fixed value of d.

Theorem 4 ().

Ulam Metric k-Median can be solved in 𝒪((mn)2d) time, where m|Π| and n|Σ|.

The algorithm builds on a simple branching technique, where we observe that the medians can be obtained by applying a total of d move-operations on the input set, and we branch on these d moves by brute-force. The result in Theorem 4 is tight in the sense that the existence of an 𝖥𝖯𝖳-algorithm for the parameterization by d is unlikely due to the following lower bound.

Theorem 5.

Ulam Metric k-Median is 𝖶[1]-hard parameterized by d.

Our proof of Theorem 5 relies on a careful reduction from Multicolored Clique. The instance is designed in a way that all but one of the medians in any hypothetical solution are already present in the input set Π. The challenge is to find that additional median in a way that it is sufficiently close to a number of input permutations. Crucially, the permutations are designed in such a way that this is only possible if all edges covered by the median form a clique, see Figure 3 for a schematic example. On a high level, we construct the instance such that there is one special symbol per color, and the position of that symbol in the additional median encodes which vertex of that color is selected for the multi-colored clique.

Figure 3: Illustration of the reduction from Multicolored Clique to Ulam Metric k-Median. Left shows an instance of Multicolored Clique with four color classes ({w},{x},{y,y}, and {z,z}) and a colorful clique Q={w,x,y,z}. Right shows the schematic solution to the constructed Ulam Metric k-Median instance. Each edge is encoded as an input permutation; edges whose endpoints form a multicolored clique are covered by a single external median σQ (underlined), while all other edges each serve as their own median in singleton clusters (also underlined).

Interestingly, our proof indicates that the hardness of the problem does not so much depend on identifying which symbols need to be moved but also importantly on deciding where to move these symbols.

In contrast to the lower bound on the polynomial kernel for Ulam Metric k-Center obtained in Theorem 3, Ulam Metric k-Median admits a polynomial kernel.

Theorem 6 ().

Ulam Metric k-Median admits a kernel with 𝒪(d2+dk) permutations over an alphabet of size 𝒪(d4+d2k2), computable in 𝒪(m2nlogn) time, where m|Π| and n|Σ|.

Our kernelization result is based on the observation that for any YES-instance of Ulam Metric k-Median, Π contains at most k+d distinct permutations. This allows us to reduce the size of Π. Then we reduce the size of the alphabet Σ by making replacements of identical subpermutations by shorter ones. Here, we use the fact that two permutations at Ulam distance at least d+1 cannot belong to the same median in any solution. Thus, we can identify some sets of permutations such that every set of permutations that shares a median in a hypothetical solution is a subset to one of the sets. We show that the pairwise Ulam distance within each set are small. Combined with the fact that there are only few distinct permutations, this implies that in each set there are many (or long) identical subpermutations, which we can then shorten to reduce the size of the alphabet Σ.

Combining Theorems 6 and 4, we immediately obtain an 𝖥𝖯𝖳-algorithm with the following running time.

Corollary 7.

Ulam Metric k-Median can be solved in (kd)𝒪(d)+𝒪(m2nlogn) time, where m|Π| and n|Σ|.

2 Preliminaries

Basic notation.

We use [n] to denote the set {1,2,,n}. Let Σ be a finite alphabet with |Σ|=n. A permutation of length n over Σ is a bijection π[n]Σ. We write 𝒮n(Σ) for the set of all permutations of length n over Σ. Thus, each π𝒮n(Σ) is an ordering of the symbols of Σ. We often write a permutation as a sequence π=π(1)π(2)π(n).

A subsequence of a permutation π is obtained by deleting zero or more elements from π while maintaining the relative order of the remaining elements. A common subsequence of two permutations π1 and π2 is a subsequence that appears in both permutations. We denote by LCS(π1,π2) the length of the longest common subsequence of π1 and π2.

Ulam distance.

A move operation on a permutation π removes one element from its current position and inserts it at another position, while maintaining the relative order of all other elements.

For two permutations π,σ𝒮n(Σ), the Ulam distance distU(π,σ) is the minimum number of move operations needed to transform π into σ:

distU(π,σ)=min{d:π can be turned into σ using d moves}.

A classical identity characterizes this metric in terms of the longest common subsequence:

distU(π,σ)=nLCS(π,σ).

Thus, the Ulam distance measures the minimum number of elements that must be relocated to make the permutations consistent in relative order. We remark that a longest common subsequence, and thereby the Ulam distance, between two permutations of length n can be computed in time in O(nlogn) by relabeling the alphabet such that the first permutation has increasing order and then finding a longest increasing sequence in the other (relabeled) permutation. The Ulam distance on permutations is analogous to the Levenshtein edit distance on strings in the following sense: both distances identify a longest common subsequence and keep it untouched while performing edit operations on the remaining symbols.

For a set 𝒮𝒮n(Σ) of permutations and π𝒮n(Σ), we write distU(π,𝒮) to denote the minimum distance from π to any permutation in 𝒮, that is, distU(π,𝒮)=minσ𝒮distU(π,σ).

For two strings s,t of equal length over an alphabet, the Hamming distance distH(s,t) counts the number of positions where the corresponding symbols differ.

Graphs.

We work with simple undirected graphs. For a graph G, we denote by V(G) its vertex set and by E(G) its edge set. A vertex cover of a graph G is a subset XV(G) such that every edge in E(G) has at least one endpoint in X. A clique in a graph G is a subset of vertices such that every pair of vertices in the subset is connected by an edge. A graph is triangle-free if it contains no clique of size 3. A proper vertex coloring of a graph G assigns colors to vertices such that no two adjacent vertices share the same color.

Parameterized Complexity.

A parameterized problem is a language LΣ× where Σ is a set of strings over a finite alphabet Σ. An input of a parameterized problem is a pair (x,k) where x is a string over Σ and k is a parameter. A parameterized problem is fixed-parameter tractable (or 𝖥𝖯𝖳) if it can be solved in f(k)|x|𝒪(1) time for some computable function f. The complexity class 𝖥𝖯𝖳 consists of all fixed-parameter tractable parameterized problems. A parameterized problem is in the class 𝖷𝖯 if it can be solved in |x|f(k) time for a computable function f(). The standard way to rule out the existence of an 𝖥𝖯𝖳-algorithm for a parameterized problem under the standard parameterized complexity assumption that 𝖥𝖯𝖳𝖶[1] is to show that it is 𝖶[1]-hard, that is, at least as hard as any problem in the class of parameterized problems 𝖶[1]. A problem is para-𝖭𝖯-hard if it is 𝖭𝖯-hard even when the parameter k is a constant.

A kernelization algorithm or kernel for a parameterized problem L is a polynomial-time algorithm that takes as its input an instance (x,k) of L and returns an instance (x,k) of the same problem such that (i) (x,k)L if and only if (x,k)L and (ii) |x|+kf(k) for some computable function f:. The function f() is the size of the kernel; a kernel is polynomial if f is a polynomial. A decidable parameterized problem is 𝖥𝖯𝖳 if and only if it admits a kernel. However, up to some standard complexity-theoretic assumptions, there are 𝖥𝖯𝖳problems that have no polynomial kernels. One of the ways to exclude a polynomial kernel for a parameterized problem is to show that there is a polynomial parameter transformation from a parameterized problem for which the existence of a polynomial kernel does not exist unless NPcoNP/poly, where a polynomial parameter transformation is a polynomial-time reduction such that the parameter in the new instance is bounded by a polynomial in the original parameter.

3 The Complexity of Ulam Metric k-Center

In this section, we study the Ulam Metric k-Center problem. We first show that the problem is already 𝖭𝖯-hard for d=1. Our main result in this section is the fixed-parameter tractability of the problem parameterized by k+d. Nevertheless, under standard complexity assumptions, the problem does not admit a polynomial kernel parameterized by k+d.

3.1 Lower Bound for Constant Radius 𝒅

We prove that Ulam Metric k-Center is 𝖭𝖯-hard when the radius is fixed to the constant d, via a reduction from Vertex Cover. Notice that Vertex Cover remains 𝖭𝖯-hard in triangle-free graphs [32]. This follows from a standard 2-subdivision transformation: replacing each edge by a path of length 3 eliminates all triangles and increases the size of a minimum vertex cover by exactly one per original edge. We may thus assume without loss of generality that the input graph is triangle-free, which suffices to prove Theorem 1. The idea of the reduction is to have two symbols per vertex. All permutations relevant to the reduction look almost entirely the same, except that only the pair of symbols for one or two vertices are swapped to encode that respective vertex or edge. If we let the input set of permutations encode all edges of the graph this way, then a vertex cover corresponds to a set of permutations encoding vertices. This holds as each permutation encoding an edge has Ulam distance 1 to only those permutations encoding vertices to which the edge is incident.

Theorem 1 (). [Restated, see original statement.]

Ulam Metric k-Center is 𝖭𝖯-hard even if d is fixed to any positive constant at least 1.

3.2 Fixed-Parameter Tractability by 𝒌+𝒅

Since the problem is 𝖭𝖯-hard even for constant d or k, neither parameter yields tractability on its own. We therefore consider the combined parameter k+d, and show that the Ulam center problem is fixed-parameter tractable under this parameterization.

Our algorithm relies on iteratively updating candidate permutations to eventually converge towards the center permutations by moving one symbol in a candidate in each step. Specifically, given a candidate permutation πc and a guide permutation πg, we can enumerate (in 𝖥𝖯𝖳 time) a set P of permutations that differ from πc by one move. Among them, at least one gets closer to any true center that covers both πc and πg. The key technical ingredient is captured in Lemma 16.

Our approach is based on the 2-colorings of the symbols in πg and πc. The 2-colorings encode which symbols are allowed to be moved toward a specific permutation σP. We formalize when such a 2-coloring is fitting with respect to σ, an exemplary coloring is visualized in Figure 4.

Figure 4: A permutation π with a d-fitting coloring with respect to a permutation σ, with witness Σπ={1,2,3,4,5}. Substrings highlighted in red form blocks. The rightmost block contains more than d red symbols, meaning that it cannot contain any moved symbol.
Definition 8 (d-fitting coloring and witness).

Let d, π𝒮n(Σ), and col:Σ{red,blue} be a coloring function of π. We say col is a d-fitting coloring (of π) with respect to some permutation σ𝒮n(Σ), if there is a subset of symbols ΣπΣ such that

  • |Σπ|=distU(π,σ) and σ can be obtained from π by moving the symbols in Σπ;

  • for every symbol in xΣπ, we have col(x)=red; and

  • for every symbol xΣΣπ, if x appears in π within 3d symbols (before or after) of some symbol in Σπ, then col(x)=blue.

Moreover, such a subset of symbols Σπ is called a witness of the coloring col to be d-fitting.

Intuitively, red symbols are candidates for being moved (i.e., they may or may not actually be moved), but blue symbols are definitely not moved. Moreover, if a red symbol is indeed one of the moved symbols (i.e., it belongs to Σπ), then all symbols within distance 3d of it must be correctly colored blue (if they are not moved) or red (if they are moved). In other words, whenever the coloring correctly identifies a moved symbol as red, it must also correctly color its entire 3d-neighborhood.

Consequently, the red symbols in a d-fitting coloring col of π w.r.t. σ that are not separated by 3d consecutive blue symbols are tied to each other in the sense that either both or none of them belong to any witness Σπ. This motivates the following definitions of blocks.

Definition 9 (Blocks).

Let d, π𝒮n(Σ) and col:Σ{red,blue}. A block is a maximal substring (i.e., consecutive sequence) β of π such that

  • the first and last symbols of β are colored red; and

  • β contains no 3d consecutive blue symbols.

See also Figure 4 for a visualization of blocks. By definition, any two blocks are disjoint and separated by at least 3d blue vertices in π. We immediately obtain the following observation by recoloring all symbols in a block blue if it contains more than d red symbols.

Observation 10.

Let d, π𝒮n(Σ). Suppose col is a d-fitting coloring of π w.r.t. some permutation σ𝒮n(Σ). If distU(π,σ)d, there is a d-fitting coloring col of π w.r.t. σ such that there are at most d red symbols in each block. Moreover, such a coloring col can be obtained from col in 𝒪(n) time.

We next argue how the notion of d-fitting colorings and that of witnesses provide a means to find a permutation that is one step closer to any true center σ than the candidate πc.

Lemma 11.

Let d, πc,πg𝒮n(Σ). Let colc and colg be d-fitting colorings of πc and πg w.r.t. some permutation σ𝒮n(Σ) with 1distU(πc,σ)d and distU(πg,σ)d. Consider any symbol xΣ such that there are witnesses Σc and Σg of colc and colg, respectively, with xΣcΣg. Then in time 𝒪(dn) we can compute and enumerate a set P with |P|6d+2 and there is π~P with distU(π~,σ)=distU(πc,σ)1. The computation does not require the sets Σc and Σg as input.

Proof.

Consider an arbitrary pair Σc and Σg of witnesses. Intuitively, xΣc means that by moving x to a specific new location in πc, we make πc closer to σ. As xΣg, the position of x in πg gives an indication for that location.

To see where to move x in πc, let bl be the closest symbol to the left of x in πg that is still blue in both permutations, and let br be the closest such symbol to the right of x in πg. If there is no such symbol on the right and/or left, consider bl or br to be a phantom blue symbol before/after the first/last symbol of the permutation, respectively. As Σg does not contain any blue symbols, it does not contain any of x,bl, and br. Thus, as x lies between bl and br in πg, it lies between them in σ as well. As bl and br are blue in colc as well, they do not change their position between πc and σ. We add all permutations to P that are obtained by moving x in πc to some location between bl and br. This ensures that we consider all possible ways of moving x closer to its position in σ, leading to the fact that P always contains a permutation π~ that is one step closer to σ than πc.

We argue that we only need to add at most 6d+2 such permutations to P. Consider the next 2d+1 symbols to the left of x in πg. Note that they belong to at most one block in πg. In each block, there are at most d red symbols, and at least d+1 of these symbols are blue in colg. Thereby, these symbols do not appear in any witness Σg of colg. Let L be the set of these blue symbols (select the closest d+1 to x, if there are more than d+1). As distU(πg,σ)d, the symbols in L appear as a subsequence of σ which is interrupted only by at most d other symbols. Call the set of these interrupting symbols I. As the symbols in LI occur consecutively in σ, the symbols in (LI)Σc appear consecutively in πc, except some potential interruptions by symbols in Σc. Thus, the symbols in LΣc have a pairwise maximal distance of at most |L|+|I|+|Σc|13d in πc. Thus, they belong to at most one block in πc and so at most d of them are red in colc. Hence, there is a symbol blL which is blue in both colg and colr. The same line of argument shows that a suitable symbol br exists among the 2d+1 symbols to the right of x in πg.

As the distance between bl and br is at most 4d+2 in πg and distU(πc,πg)2d, the distance between bl and br in πc is at most 6d+2, giving that many possibilities on where to insert x. If one or both of bl and br are phantom symbols at the beginning/end of a permutation, the same upper bound applies.

We can find b and br in time O(d) by starting a search outwards from x in πc. Listing all obtained permutations takes time in 𝒪(dn).

It remains to show how to find such a symbol x. For technical reasons, we require a weak notion of consistency between two d-fitting colorings, which motivates the following definition.

Definition 12 (Consistent d-fitting colorings).

Let d, πc,πg𝒮n(Σ), and colc,colg be d-fitting colorings of πc and πg with respect to some permutation σ𝒮n(Σ), respectively. We say that colc and colg are consistent d-fitting with respect to σ if there are respective witnesses Σc,ΣgΣ, such that for every symbol xΣcΣg, we have colg(x)=red if and only if xΣg, and colc(x)=red if and only if xΣc.

We first show how to enumerate a set of candidate pairs of colorings to be consistent d-fitting with respect to any σ.

Lemma 13.

Let d and πc,πg𝒮n(Σ). There is a set 𝒞 of 2-coloring pairs such that

  • the size of 𝒞 is bounded by |𝒞|2𝒪(d2)logn; and

  • for every σ𝒮n(Σ) with distU(πc,σ)d and distU(πg,σ)d, 𝒞 contains a consistent d-fitting coloring pair of πc and πg w.r.t. σ.

Moreover, such a set can be computed and listed in 2𝒪(d2)nlogn time, where n|Σ|.

Proof.

We construct the collection 𝒞 using the notion of (a,b)-universality. An (a,b)-universal set 𝒰{0,1}a is a set of bitstrings of length a, such that for each subset 𝒮[a] of size b, the projection of 𝒰 onto the coordinates in 𝒮 yields all 2b possible bitstrings of length b. Equivalently, if we restrict each string in 𝒰 to any fixed set of b coordinates, all possible 2b binary patterns appear. Naor, Schulman, and Srinivasan [28] showed that such a set exists with size at most 2bb𝒪(logb)loga, and can be listed in time 2bb𝒪(logb)aloga.

In our setting, we take a=2n and b=12d2+4d. Applying the above, we obtain an (a,b)-universal set 𝒞{0,1}a of size

2bb𝒪(logb)log(a)=2𝒪(d2+log2d)logn=2𝒪(d2)logn,

which can be listed it in time 2𝒪(d2)nlogn. Each bitstring in {0,1}2n naturally defines a pair of 2-colorings of the symbols in Σ: the first n bits define the coloring colc of πc and the last n bits define a coloring colg of πg.

Now, consider any permutation σ with distU(πc,σ)d and distU(πg,σ)d. Let Σc and Σg be minimum-sized sets of moved symbols in πc and πg, respectively, to obtain σ. By Definitions 8 and 12, the 2-colorings colc and colg are consistent d-fitting w.r.t. σ if

  1. (i)

    every symbol in Σc (resp., Σg) is colored red in colc (resp., colg);

  2. (ii)

    every symbol in ΣΣc (resp., ΣΣg) within distance 3d of a moved symbol in Σc (resp., Σg) is colored blue in colc (resp., colg); and

  3. (iii)

    every symbol in ΣgΣc (resp., ΣcΣg) is colored blue in colg (resp., colc).

Recall that both sets have size at most d. The number of symbols involved in these conditions is at most

(|Σc|+|Σg|)+23d(|Σc|+|Σg|)+(|Σc|+|Σg|)12d2+4d=b.

Because our (a,b)-universal set contains all possible pairs of colorings on any set of b positions, it must contain a pair that assigns suitable colors to all b involved symbols. Hence, this pair is consistent d-fitting w.r.t. σ.

Given a guide πg and the candidate πc, Lemma 13 allows us to guess a consistent d-fitting coloring pair (colc,colg) w.r.t. some center σ within distance d of both. We now use the colorings colc and colg to capture the structural relationship between the two permutations. To this end, we consider a certain vertex cover of their permutation graph. Here, a permutation graph Gπc,πg of two permutations πc,πg𝒮n(Σ) is the graph whose vertex set is the alphabet Σ and its edges are exactly the (unordered) pairs of vertices whose order is reversed between πc and πg. For each edge in Gπc,πg, exactly one of πc and πg has the two incident symbols in the same order as the center σ. A vertex cover of Gπc,πg thus gives an indication of which symbols need to be moved to transform πg and πc into σ.

Lemma 14.

Let d, πc,πg𝒮n(Σ). Let colc and colg be consistent d-fitting colorings of πc and πg w.r.t. some permutation σ𝒮n(Σ). For every pair of witnesses Σc,Σg for colc and colg there is an inclusion-wise minimal vertex cover X of Gπc,πg with XΣcΣg.

Proof.

We begin by showing that ΣcΣg is a vertex cover of Gπc,πg. Consider an edge xy in Gπc,πg. By definition of the permutation graphs, x and y appear in reversed order in πc and πg. Since σ is obtained from πc (resp., πg) by moving symbols in Σc (resp., Σg), at least one of x and y must be moved in one of the two permutations. Hence, at least one of x and y belongs to ΣcΣg, showing that ΣcΣg is a vertex cover of Gπc,πg.

The lemma follows by exhaustively removing elements from ΣcΣg upon whose removal all edges are still covered.

Such a vertex cover indeed suffices to find a suitable vertex x as required for Lemma 11.

Lemma 15.

Let d, πc,πg𝒮n(Σ). Let colc and colg be consistent d-fitting colorings of πc and πg w.r.t. some permutation σ𝒮n(Σ) with distU(πc,σ)d and distU(πg,σ)d. Consider an inclusion-wise minimal vertex cover X of Gπc,πg with XΣcΣg for a pair of witnesses Σc,Σg for colc and colg. Then in time 𝒪(|X|) we can find a symbol xΣ with xΣcΣg. The computation does not require the sets Σc and Σg as input.

Proof.

Observe that πg can be transformed into πc by deleting and reinserting the symbols in X, so distU(πg,πc)>d implies that |X|>d. As distU(πg,σ)=|Σg|d, we have that there is a symbol xX such that xΣcΣg. As colg and colc are consistent d-fitting, we have that colc(x)=red and colg(x)=blue. It suffices to consider any such colored symbol x, as colg(x)=blue implies xΣg and thus, by XΣcΣg we have xΣcΣg. With this, we are ready to forge our central tool:

Lemma 16.

Let d, and πg,πc𝒮n(Σ) be two permutations with d<distU(πg,πc)2d. There exists a set of permutations P𝒮n(Σ) satisfying

  • the size of P is bounded by |P|2𝒪(d2)logn; and

  • for each permutation σ𝒮n(Σ) with distU(πg,σ)d and distU(πc,σ)d, P contains a permutation π~P that is one step closer to σ than πc, i.e., distU(π~,σ)=distU(πc,σ)1.

Furthermore, such a set can be computed in 2𝒪(d2)nlogn time.

Proof.

We compute a collection 𝒞 of pairs of 2-colorings of Σ according to Lemma 13. For each σ𝒮n(Σ) with distU(πg,σ)d and distU(πc,σ)d, there exists a consistent d-fitting pair of colorings (colc,colg)𝒞 w.r.t. σ. Thus, for each pair in 𝒞 we perform the following procedure, adding permutations to P as we go along.

Based on Observation 10, we can assume that both colc and colg have at most d red symbols in each block (if not, we recolor some blocks blue accordingly). We list all inclusion-wise minimal vertex covers of Gπc,πg that have size at most 2d. We can do so by a simple and well-known branching technique: Start with an empty cover, iteratively take any uncovered edge vw and create two branches where you add v or w to the vertex cover, respectively, and repeat this procedure 2d times (or until all edges are covered). This list of at most 22d=4d covers may contain some that are not inclusion-wise minimal, but these can be filtered out in time 𝒪(4d|V(Gπc,πg)|)=𝒪(4dn).

By Lemma 14 and as every witness for colc or colg has size at most d, at least one of the listed vertex covers consists only of vertices in ΣcΣg, where Σc and Σg are witnesses for the respective colorings. This holds true for every permutation σ for which the current colorings are consistent d-fitting. Using Lemma 15 on each of the vertex covers, we obtain a set of at most 4d symbols, and for every suitable σ at least one of these symbols is included in ΣcΣg for respective witnesses. We note that applying Lemma 15 to vertex covers containing vertices which do not stem from union of witnesses might yield incorrect symbols, but for each of the vertex covers we still add at most one symbol. We apply Lemma 11 to each of the 4d symbols, thereby producing a set of 4d(6d+2) permutations, which we all add to P. Note that the lemmas guarantee that for every σ for which the colorings are consistent d-fitting, we added at least one permutation which is one step closer to σ than the current candidate πc.

The final size of P is bounded by

|P||𝒞|4d(6d+2)2𝒪(d2)logn.

The runtime estimate is based on combining the size of 𝒞 from Lemma 13 with the time to find the unique vertex cover respecting a given pair of colorings. All other steps, like processing the blocks, are asymptotically dominated by that time. There are at most 2𝒪(d2)logn pairs of colorings to enumerate. For each pair, the branching procedure on the vertex covers takes 𝒪(4d(|E(Gπc,πg)|+|V(Gπc,πg)|))=𝒪(4ddn) time as |V(Gπc,πg)|=n and the existence of a vertex cover of size 2d implies that |E(Gπc,πg)|2dn. Thus, the total time to compute P is in

2𝒪(d2)logn𝒪(4ddn)=2𝒪(d2)nlogn.

Now we are ready to prove Theorem 2.

Theorem 2. [Restated, see original statement.]

Ulam Metric k-Center can be solved in 2𝒪(d2k(d+k))mn1+o(1) time, where m|Π| and n|Σ|.

Proof.

We may assume without loss of generality that any YES-instance admits a solution with exactly k centers. Indeed, if a solution exists with fewer than k centers, we can always add arbitrary permutations as centers until we reach exactly k centers. In addition, we exclude the trivial YES-instances where k>m. Now, consider a hypothetical solution S={σ1,σ2,,σk} consisting of k centers. For each i[k], let the ith cluster be the set of permutations in Π with distance at most d to σi. If a permutation would fit into multiple clusters, we assign it to only one of them arbitrarily.

We describe our algorithm as a branching procedure. It maintains a candidate set S𝒮n(Σ) of size at most k along with a budget bi for each candidate σiS. Here, S is intended to evolve into a solution to the Ulam Metric k-Center instance, and each budget bi indicates how many modifications to σi remain (or have been used so far). In each branch, the algorithm checks whether the current candidate set S covers all permutations in Π within distance d. The algorithm halts and accepts the instance if and only if at least one branch finds a valid solution. We now describe the procedure in detail; see Algorithm 1 for a high-level overview.

Algorithm 1 Solving Ulam Metric k-Center for radius d on permutations Π.

In the course of the algorithm, we one by one initialize each candidate σi as a permutation from Π, and evolve it into the ith center. Initially, pick the permutation π1Π and set the first candidate σ1 to equal this permutation: σ1π. Then, the algorithm adds it as the first candidate to S and initializes its budget as b1d.

Next, the algorithm branches on a permutation πΠ that has distance more than d to each of the candidates in S. If there is none, then the current candidates form a solution, and we accept the instance. Otherwise, the permutation π either belongs to one of the existing clusters or to a new cluster.

  • Existing cluster: For each candidate σiS with remaining budget bi>0 and distance at most 2d to π, we consider the case where π belongs to the ith cluster. We invoke Lemma 16 with d, guide πg=π, and πc=σi to obtain the set P of permutations. For each permutation σiP, we create a new branch where we replace σi by σi and decrease its budget by one.

  • New cluster: If |S|<k, we create a branch where π belongs to a new cluster. Specifically, we let σ|S|+1=π as a new candidate, initialize its budget as b|S|+1=d, and add it to S.

If none of the two above cases applies, we reject the branch. We accept the instance if and only if at least one branch accepts it. If none of the branches accepts the instance, we reject the branch.

Observe that if the algorithm accepts an instance, it indeed finds a solution. Conversely, consider a YES-instance of Ulam Metric k-Center witnessed by some solution S={σ1,σ2,,σk}. When branching on a permutation πΠ not covered by the current candidates S, there exists a branch where π is assigned to the cluster to which it belongs in S. Moreover, when π is assigned to the ith cluster from the current candidates S, by Lemma 16, there is a permutation σiP that is one step closer to σi than σi. Thus, in the respective branch, we replace σi by σi, moving it one step closer to σi. Since each candidate starts with the distance at most d to its respective center in S, after receiving at most d updates, it will have converged to that center. From this point on, it will not receive any more updates since there are no permutations assigned to that cluster with a distance of more than d. Therefore, there is a branch in which the algorithm finds the solution S and accepts the instance.

Finally, we analyze the running time of the algorithm. Recall that the input of the branching procedure contains a set of candidates S along with their budgets {bi:σiS}. Define the measure of the current input of a branch as

μ(k|S|)(d+1)+i=1|S|bi.

and denote by T(μ) the worst-case running time of the algorithm on inputs with measure μ.

Observe that each time we add a new candidate to S or modify an existing candidate in S, the measure μ decreases by one. On the one hand, when we add a new candidate to S, the size of S increases by one while the budget of the new candidate is initialized to d. Thus, the measure decreases by (d+1)d=1 and there is at most one such branch. On the other hand, when we modify a candidate to a permutation from P, its budget decreases by one while the size of S remains unchanged. Thus, the measure decreases by 1 as well, and there are at most |S||P|k2𝒪(d2)logn such branches by Lemma 16. Moreover, computing P takes time in 2𝒪(d2)nlogn, and the remaining time spend on this iteration is dominated by the computation of all Ulam distances to the current candidates (achievable in 𝒪(kmnlogn) time). Therefore, we have the recurrence

T(μ)2𝒪(d2)nlogn+𝒪(kmnlogn)+(1+k2𝒪(d2)logn)T(μ1).

Notice that the measure satisfies μk(d+1) and the algorithm halts when μ=0. Solving the recurrence yields

T(k(d+1))= (1+k2𝒪(d2)logn)k(d+1)(2𝒪(d2)nlogn+kmnlogn)
= 2𝒪(d3k)k𝒪(dk)(logn)k(d+1)𝒪(mnlogn).

Observe that

(logn)k(d+1)=2k(d+1)loglogn2k2(d+1)2+(loglogn)2=2k2(d+1)2n(loglogn)2/logn,

which bounds the total running time by

2𝒪(d3k+d2k2)k𝒪(dk)𝒪(mn1+(loglogn)2/lognlogn)=2𝒪(d2k(d+k))mn1+o(1).

This shows that Ulam Metric k-Center is in 𝖥𝖯𝖳 by k+d.

We prove that the fixed-parameter tractability of Ulam distance with respect to k+d does not extend to a polynomial kernel via a reduction from a problem on binary strings.

Theorem 3 (). [Restated, see original statement.]

Ulam Metric k-Center does not admit a polynomial-sized kernel for the parameter k+d unless NPcoNP/poly.

4 The Complexity of Ulam Metric 𝒌-Median

This section studies the parameterized complexity of Ulam Metric k-Median with respect to the parameters d and k+d. We first prove that Ulam Metric k-Median is 𝖶[1]-hard parameterized by d but is in 𝖷𝖯 for this parameterization. Then we show a polynomial kernel parameterized by both k and d, implying fixed-parameter tractability for this parameterization.

We first rule out fixed-parameter tractability by d alone under established complexity assumptions. We then contrast it with a simple 𝖷𝖯-algorithm for Ulam Metric k-Median.

For the hardness result, we give a reduction from Multicolored Clique. An instance of Multicolored Clique consists of a graph G with a proper vertex coloring using k colors, and asks whether G contains a clique of size k. The problem is known to be 𝖶[1]-hard when parameterized by k [31]. For clarity, we here describe the reduction and then separately prove that it preserves YES-instances and NO-instances.

Let 𝒞={c1,c2,,ck} denote the color set, let V(G)={v1,v2,,vn} be the vertex set of G and let E(G)={e1,e2,,em} be the edge set of G, where n=|V(G)| and m=|E(G)|. Without loss of generality, we assume that k4, as instances with smaller values can be solved in polynomial time by brute-force.

We construct an instance (Π,k,d) of Ulam Metric k-Median with k=m(k2)+1. The idea of the reduction is to create one permutation for each edge in G. We build the instance in a way such that the existence of a multicolored clique QV(G) allows the construction of a center permutation σQ such that edges with both endpoints in Q have small total distance to σQ, while every other edge can take itself as its center. Consequently, the number of centers required is m(|Q|2)+1=k, and the median distance is entirely contributed by the edges inside Q. It remains to choose a suitable value for d.

Formally, let q=(k2)(k2)+1. Furthermore, we define the alphabet as the union of the color set, some v-symbols representing the vertices, and some x-, y-, and z-symbols representing the edges:

Σ=𝒞{vji:i[q],vjV(G)}{xji,yji,zji:i[q],ejE(G)}.

We have n=|Σ|=k+nq+3mq. We first construct a base permutation πbaseSn(Σ) that starts with alternating between the x- and y-symbols, followed by the v- and the z-symbols, and finally the color-symbols:

πbase x11y11x1qy1qx21y21x2qy2qxm1ym1xmqymq
v11v12v1qv21v22v2qvn1vn2vnq
z11z12z1qz21z22z2qzm1zm2zmq
c1c2ck.

For each edge ej=vavbE(G) with a<b, we introduce a permutation πej obtained from πbase as follows. Suppose va has color cα and vb has color cβ. Swap xji and yji for each i[q]; move cα to the right of vaq; move cβ to the right of vbq; and move the remaining color-symbols to the right of zjq without changing their relative order. That is,

πej x11y11x1qy1qyj1xj1yjqxjqxm1ym1xmqymq
v11v1qva1vaqcαvb1vbqcβvn1vnq
z11z1qzj1zjqχα,βzj+11zj+1qzm1zmq,

where χα,β=c1cα1cα+1cβ1cβ+1ck. Finally, recall that k=m(k2)+1. We set d=(k2)(q+(k2)), and let the set of permutations consist of all permutations for edges in the graph, i.e., Π={πej:ejE(G)}.

Lemma 17.

The stated reduction from MultiColoredClique to Ulam Metric k-Median preserves YES-instances.

Proof.

Assume that G contains a clique Q of size at least k, which contains exactly one vertex of each color. We prove that there is a set S of size k that is a solution for the Ulam Metric k-Median instance (Π,k,d). For each vertex vjQ, let cφ(j) be the color of vj. Define σQ to be the permutation obtained from πbase by moving each symbol cφ(j)C right after the symbol vjqQ. (There is no color-symbol after vjq if vjQ.) That is, if Q={vj1,vj2,,vjk} with j1<j2<<jk, then

σQ x11y11x1qy1qx21y21x2qy2qxm1ym1xmqymq
v11v1qvj111vj11qvj11vj1qcφ(j1)vj1+11vj1+1q
vji11vji1qvji1vjiqcφ(ji)vji+11vji+1q
vjk11vjk1qvjk1vjkqcφ(jk)vjk+11vjk+1q
vn1vnqz11z1qz21z2qzm1zmq.

We then let S={σQ}ΠΠQ, where ΠQΠ is the set of (k2) permutations associated with an edge that has both endpoints covered by Q. Observe that |S|=m(k2)+1=k and the sum of distances of each permutation to its closest median is at most πΠQdistU(π,σQ). Any permutation in ΠQ can be transformed into σQ by moving the k2 color-symbols that are not yet at the correct position as well as the q symbols of the form xji with i[q]. Thus, the total sum of distances is at most (k2)(q+(k2))=d.

Lemma 18.

The stated reduction from MultiColoredClique to Ulam Metric k-Median preserves NO-instances.

Proof.

We prove by showing that the existence of a solution to the constructed Ulam Metric k-Median instance implies the existence of a solution to the MultiColoredClique instance.

Assume the Ulam Metric k-Median instance is solved by a set S of permutation medians which minimize the sum of distances. Consider the clustering of Π described by S, where we have one cluster per median permutation in S and each permutation in Π is assigned to the cluster of the closest median under Ulam metric (breaking ties arbitrarily). For ease of presentation, we partition the alphabet Σ into two parts: Σ is the set of x- and y-symbols; and Σ′′ is the set of v-, z-, and color-symbols. By construction, any permutation πe in Π is a concatenation of two substrings πe𝒮2mq(Σ) and πe′′𝒮k+nq+mq(Σ′′). It is easy to see that distU(πe1,πe2)=distU(πe1,πe2)+distU(πe1′′,πe2′′) for any pair of permutations πe1,πe2Π. We further define C={πe:πeC} and C′′={πe′′:πeC} for any cluster C in the clustering.

Clearly, there exists a cluster of size at least two as k<m. Consider a cluster C of size |C|2. We first argue that C is the unique cluster of size more than one. Let σ be its median with optimal total distance to the permutations in C. By the optimality of σ, the center σ starts with a substring σ𝒮2mq(Σ) and end with a substring σ′′𝒮k+nq+mq(Σ′′). It is easy to see that distU(πe,σ)=distU(πe,σ)+distU(πe′′,σ′′) for any permutation πeC. This means that we can optimize σ and σ′′ independently to minimize the total distance. First, restrict our attention to the x- and y-symbols. For any pair of permutations πe1,πe2C, we have distU(πe1,πe2)2q as they have swapped the x- and y-symbols for distinct edges. Thus, we can derive that

πeCdistU(πe,σ)= 1|C|1{πe1,πe2}C(distU(πe1,σ)+distU(πe2,σ))
1|C|1{πe1,πe2}CdistU(πe1,πe2)
1|C|1(|C|2)2q=|C|q=|C|q.

Suppose for the contraction that there were r clusters C1,C2,,Cr (r2) of size at least two with respective medians σ1,σ2,σr. Summing over all these clusters yields

(|C1|+|C2|++|Cr|)qi[r]πeCidistU(πe,σi)d=(k2)(q+(k2))<((k2)+1)q,

which implies that |C1|+|C2|++|Cr|(k2). By the definition of k we have

m+r(|C1|+|C2|++|Cr|)k=m(k2)+1,

leading to r1, a contradiction. Hence, we conclude that C is the unique cluster of size more than one, which indicates |C|mk+1=(k2).

Since (Π,k,d) is a YES-instance, we have d is at least

πeCdistU(πe,σ)=πeCdistU(πe,σ)+πe′′C′′distU(πe′′,σ′′)|C|q+πe′′C′′distU(πe′′,σ′′).

Since d=(k2)(q+(k2)) and |C|=|C|(k2), we derive that

πe′′C′′distU(πe′′,σ′′)(k2)(k2)=q1.

This implies that only color-symbols can be moved from σ′′ to each permutation πe′′ in C′′: there are q copies of each v- and z-symbol in Σ′′ and they are ordered the same way in all permutations. Suppose 𝒞¯𝒞 is the set of colors located before z11 in σ′′, and let k¯=|𝒞¯|. Recall that each permutation πe has two of the k4 color-symbols placed before z11; one each after the symbols for its incident vertices. Thus, for at most (k¯2) of the permutations in C′′, both of these color-symbols are in 𝒞¯. All other permutations have to move at least one of the two symbols, which requires a total of at least (k2)(k¯2) units of the budget. Additionally, for each permutation in C′′, all k2 color-symbols after z11 have to be moved, except a total of at most kk¯ symbols across all permutations. As a result, the total number of required move operations is at least

πe′′C′′distU(πe′′,σ′′) (k2)(k¯2)+(k2)(k2)(kk¯)
= (k2)(k2)+12(k(k3)k¯(k¯3))(k2)(k2).

Combine this with the bound on πeCdistU(πe,σ), and we finally have

πeCdistU(πe,σ)= πeCdistU(πe,σ)+πe′′C′′distU(πe′′,σ′′)
(k2)q+(k2)(k2)=d.

Hence, all inequalities above are in fact equalities, which yields |C|=k and k¯=k. In other words, all color-symbols are placed somewhere before z11 in σ. Note further that the budget d is only sufficient if for every permutation πeC both color-symbols “incident” to e are located between the same substrings of v-symbols as in σ. Hence, the union of all endpoints of the (k2) distinct edges described by C has size |C|=k, implying that these edges form a k-clique in G.

The 𝖶[1]-hardness of Ulam Metric k-Median immediately follows from Lemmas 17 and 18 and the facts that the described reduction can be computed in polynomial time and determines d by a computable function of k. See 5

We contrast this lower bound by designing a simple 𝖷𝖯-algorithm for Ulam Metric k-Median.

Theorem 4 (). [Restated, see original statement.]

Ulam Metric k-Median can be solved in 𝒪((mn)2d) time, where m|Π| and n|Σ|.

Last, we find a polynomial-sized kernel with respect to k+d, which also establishes the fixed-parameter tractability Ulam Metric k-Median by k+d. See 6

5 Conclusion

We initiated the study of the parameterized complexity of the Ulam Metric k-Center and Ulam Metric k-Median problems. Prior to our work, even the parameterized complexity for the case k=1 with parameter d was unknown for these problems.

It is known [18] that Closest String cannot be solved in 2o(dlogd)(nm)𝒪(1) time unless the Exponential Time Hypothesis (ETH) fails (we refer to [18] for the formal definition of ETH). Then the Polynomial Parameter Transformation from Theorem 3 implies the same computational lower bound for Ulam Metric 1-Center. Is it possible to solve Ulam Metric 1-Center for k=1 in d𝒪(d)(nm)𝒪(1) time similarly to Closest String?

For Ulam Metric k-Median, it is shown that the problem is 𝖶[1]-hard when parameterized by d but is in 𝖷𝖯 under the same parameterization. Furthermore, the problem admits a polynomial kernel for the parameterization by both k and d. The latter result together with an 𝖷𝖯-algorithm implies that Ulam Metric k-Median can be solved in (kd)𝒪(d)(mn)𝒪(1) time. Is it possible to improve this running time? Similarly to Ulam Metric k-Center, we find that this question is interesting even for k=1. Is there a single-exponential (or even subexponential) in d algorithm?

References

  • [1] Alok Aggarwal and Jeffrey S. Vitter. The input/output complexity of sorting and related problems. Communications of the ACM, 31(9):1116–1127, 1988. doi:10.1145/48529.48535.
  • [2] Nir Ailon, Moses Charikar, and Alantha Newman. Aggregating inconsistent information: Ranking and clustering. Journal of the ACM, 55(5):23:1–23:27, 2008. doi:10.1145/1411509.1411513.
  • [3] Alexandr Andoni and Huy L. Nguyen. Near-optimal sublinear time algorithms for ulam distance. In Proceedings of the ACM–SIAM Symposium on Discrete Algorithms (SODA), pages 76–86. SIAM, 2010. doi:10.1137/1.9781611973075.8.
  • [4] Kenneth J. Arrow. Social Choice and Individual Values. Wiley, 1951. URL: http://www.jstor.org/stable/j.ctt1nqb90.
  • [5] Christian Bachmaier, Franz J. Brandenburg, Andreas Gleißner, and Andreas Hofmeier. On the hardness of maximum rank aggregation problems. Journal of Discrete Algorithms, 31:2–13, 2015. doi:10.1016/j.jda.2014.10.002.
  • [6] Manu Basavaraju, Fahad Panolan, Ashutosh Rai, M. S. Ramanujan, and Saket Saurabh. On the kernelization complexity of string problems. Theoretical Computer Science, 730:21–31, 2018. doi:10.1016/j.tcs.2018.03.024.
  • [7] Nadja Betzler, Michael R. Fellows, Jiong Guo, Rolf Niedermeier, and Frances A. Rosamond. Fixed-parameter algorithms for kemeny rankings. Theoretical Computer Science, 410(45):4554–4570, 2009. Algorithmic Aspects in Information and Management. doi:10.1016/j.tcs.2009.08.033.
  • [8] Nadja Betzler, Jiong Guo, and Rolf Niedermeier. Parameterized computational complexity of Dodgson and Young elections. Information and Computation, 208(2):165–177, 2010. doi:10.1016/j.ic.2009.10.001.
  • [9] Nadja Betzler, Jiong Guo, Rolf Niedermeier, and Johannes Uhlmann. Parameterized complexity of candidate control in elections and related digraph problems. Theoretical Computer Science, 410:5425–5442, 2009. doi:10.1016/j.tcs.2009.05.029.
  • [10] Therese Biedl, Franz-Josef Brandenburg, and Xiaotie Deng. On the complexity of crossings in permutations. Discrete Mathematics, 309(7):1813–1823, 2009. doi:10.1016/j.disc.2007.12.088.
  • [11] Leizhen Cai, Siu Man Chan, and Siu On Chan. Random separation: A new method for solving fixed-cardinality optimization problems. In Second International Workshop on Parameterized and Exact Computation (IWPEC), volume 4169 of Lecture Notes in Computer Science, pages 239–250. Springer, 2006. doi:10.1007/11847250_22.
  • [12] 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. doi:10.1137/1.9781611976465.48.
  • [13] Diptarka Chakraborty, Debarati Das, and Robert Krauthgamer. Clustering permutations: New techniques with streaming applications. In Innovations in Theoretical Computer Science Conference (ITCS), 2023. doi:10.4230/LIPIcs.ITCS.2023.31.
  • [14] Diptarka Chakraborty, Syamantak Das, Arindam Khan, and Aditya Subramanian. Fair rank aggregation. In NeurIPS, 2022. URL: http://papers.nips.cc/paper_files/paper/2022/hash/974309ef51ebd89034adc64a57e304f2-Abstract-Conference.html.
  • [15] Diptarka Chakraborty, Kshitij Gajjar, and Agastya Vibhuti Jha. Approximating the center ranking under ulam. In Foundations of Software Technology and Theoretical Computer Science, 2021. doi:10.4230/LIPIcs.FSTTCS.2021.12.
  • [16] Ronald Christian, Michael R. Fellows, Frances Rosamond, and Arkadii Slinko. On complexity of lobbying in multiple referenda. Review of Economic Design, 11:217–224, 2007. doi:10.1007/s10058-007-0028-1.
  • [17] Luís Cunha, Ignasi Sau, and Uéverton S. Souza. On the parameterized complexity of the median and closest problems under some permutation metrics. Algorithms Mol. Biol., 19(1):24, 2024. doi:10.1186/s13015-024-00269-z.
  • [18] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
  • [19] Debarati Das and Amit Kumar. Breaking the two approximation barrier for various consensus clustering problems. In Proceedings of the ACM–SIAM Symposium on Discrete Algorithms (SODA), pages 323–372. SIAM, 2025. doi:10.1137/1.9781611978322.10.
  • [20] Persi Diaconis and R. L. Graham. Spearman’s footrule as a measure of disarray. Journal of the Royal Statistical Society. Series B (Methodological), 39(2):262–268, 1977. URL: http://www.jstor.org/stable/2984804.
  • [21] Cynthia Dwork, Ravi Kumar, Moni Naor, and D. Sivakumar. Rank aggregation methods for the web. In Proceedings of the 10th International Conference on World Wide Web (WWW), pages 613–622. ACM, 2001. doi:10.1145/371920.372165.
  • [22] Ronald Fagin, Ravi Kumar, and D. Sivakumar. Efficient similarity search and classification via rank aggregation. In Proceedings of the ACM SIGMOD International Conference on Management of Data, pages 301–312. ACM, 2003. doi:10.1145/872757.872795.
  • [23] Henning Fernau, Fedor V. Fomin, Daniel Lokshtanov, Matthias Mnich, Geevarghese Philip, and Saket Saurabh. Social choice meets graph drawing: How to get subexponential time algorithms for ranking and drawing problems. Tsinghua Science and Technology, 19(4):374–386, 2014. doi:10.1109/TST.2014.6867519.
  • [24] 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. doi:10.4230/LIPIcs.ESA.2025.111.
  • [25] Jens Gramm, Rolf Niedermeier, and Peter Rossmanith. Fixed-parameter algorithms for CLOSEST STRING and related problems. Algorithmica, 37(1):25–42, 2003. doi:10.1007/s00453-003-1028-3.
  • [26] Ragesh Jaiswal, Amit Kumar, and Jatin Yadav. Robust-Sorting and Applications to Ulam-Median. In Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele Puppis, editors, 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), volume 334 of Leibniz International Proceedings in Informatics (LIPIcs), pages 100:1–100:19, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2025.100.
  • [27] Claire Kenyon-Mathieu and Warren Schudy. How to rank with few errors. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing (STOC), pages 95–103. ACM, 2007. doi:10.1145/1250790.1250806.
  • [28] Moni Naor, Leonard J. Schulman, and Aravind Srinivasan. Splitters and near-optimal derandomization. In Foundations of Computer Science (FOCS), pages 182–191. IEEE Computer Society, 1995. doi:10.1109/SFCS.1995.492475.
  • [29] Timothy Naumovitz, Michael E. Saks, and C. Seshadhri. Accurate and nearly optimal sublinear approximations to ulam distance. In Proceedings of the ACM–SIAM Symposium on Discrete Algorithms (SODA), pages 2012–2031. SIAM, 2017. doi:10.1137/1.9781611974782.131.
  • [30] Pavel A. Pevzner. Computational molecular biology: An algorithmic approach. MIT Press, 2000.
  • [31] Krzysztof Pietrzak. On the parameterized complexity of the fixed alphabet shortest common supersequence and longest common subsequence problems. J. Comput. Syst. Sci., 67(4):757–771, 2003. doi:10.1016/S0022-0000(03)00078-3.
  • [32] Svatopluk Poljak. A note on stable sets and colorings of graphs. Commentationes Mathematicae Universitatis Carolinae, 015(2):307–309, 1974. URL: http://eudml.org/doc/16622.
  • [33] Anke van Zuylen and David P. Williamson. Deterministic algorithms for rank aggregation and other ranking and clustering problems. In Approximation and Online Algorithms, pages 260–273. Springer, 2007. doi:10.1007/978-3-540-77918-6_21.