alphaFeedback

WorksComputer Science

Ulam Metric kk-Center in Parameterized Linear Time

AI contributions
Not recorded for this paper
View details

Abstract

Continuous Ulam Metric kk-Center asks for at most kk permutations whose radius-dd balls cover the input rankings. For mm rankings of nn symbols, a deterministic algorithm takes 2O(kdlog⁡(k+d+2))mn2^{O(kd\log(k+d+2))}mn word operations. Permanent reference rankings, short insertion lists, and small obstructions obtained by patience sorting control the search. For one center, this answers a question of Bai, Fomin, Golovach, More, and Wietheger with linear input dependence. An arbitrary-alphabet Hamming embedding with a nonexpansive retraction also gives the matching 2o(dlog⁡d)2^{o(d\log d)} exclusion under the Exponential Time Hypothesis.

Introduction

Background and the source problem

A consensus ranking should remain close to the rankings it summarizes. Data with several distinct groups may require several centers. Ulam distance measures how many symbols must be moved while the other symbols retain their relative order. The radius is a useful parameter when each ranking disagrees with its group’s consensus on only a few items. For example, moving the symbol 33 in 12345 gives 13245, so these rankings have Ulam distance one.

Let m,n≥1m,n \ge1 and let Σ\Sigma be an nn-symbol alphabet. For permutations π,σ\pi,\sigma of Σ\Sigma, define

dist⁡U(π,σ)=n−LCS⁡(π,σ),\operatorname{dist}_{U}(\pi,\sigma)=n-\operatorname{LCS}(\pi,\sigma),

where LCS⁡\operatorname{LCS} denotes longest common subsequence length. Given mm input permutations π1,…,πm\pi_1,\ldots,\pi_m and integers k≥1k \ge1, d≥0d \ge0, continuous Ulam Metric kk-Center asks for at most kk permutations σ1,…,σk\sigma_1,\ldots,\sigma_k such that

max⁡1≤i≤mmin⁡1≤j≤kdist⁡U(πi,σj)≤d.\max_{1\le i\le m}\min_{1\le j\le k}\operatorname{dist}_{U}(\pi_i,\sigma_j)\le d.

The centers may be arbitrary permutations; they need not be inputs. This is the convention of Bai, Fomin, Golovach, More, and Wietheger [1 Section 1.1].

Bai et al. prove NP-hardness even for d=1d=1 when kk is part of the input, and give an exact algorithm in time

2O(d2k(d+k))mn1+o(1).2^{O(d^{2}k(d+k))}mn^{1+o(1)}.

[1 Theorems 1 and 2] For one center, the parameter dependence is 2O(d3)2^{O(d^3)}. By comparison, the Hamming-distance consensus problem Closest String has dO(d)d^{O(d)} dependence over arbitrary alphabets, by the bounded-search-tree algorithm of Gramm, Niedermeier, and Rossmanith [7 Theorem 1]. Bai et al. ask whether the Ulam problem has the same dependence [1 Section 5, p. 19:21].

Question 1 (Bai–Fomin–Golovach–More–Wietheger). Can continuous Ulam Metric 1-Center be solved in time dO(d)(mn)O(1)d^{O(d)}(mn)^{O(1)}?

Contribution

Theorem 2. For k,d≥1k,d \ge1, continuous Ulam Metric kk-Center can be decided deterministically in

2O(kdlog⁡(k+d+2))mn(1)2^{O(kd\log(k+d+2))}mn \tag*{(1)}

word operations, and a set of centers can be returned on every yes-instance. The permutations are given explicitly as arrays of symbols in [n][n]; a word holds an input address or a symbol.

For k=1k=1, this is 2O(dlog⁡(d+2))mn2^{O(d\log(d+2))}mn, answering Question 1 while retaining linear dependence on the explicit input size. The boundary case d=0d=0 amounts to counting distinct input permutations and can be solved by direct comparisons to at most k+1k+1 representatives in O(kmn)O(kmn) time.

The radius dependence for one center is also optimal in the following standard conditional sense.

Theorem 3. Unless the Exponential Time Hypothesis fails, continuous Ulam Metric 1-Center has no algorithm with running time 2o(dlog⁡d)(mn)O(1)2^{o(d\log d)}(mn)^{O(1)}.

Theorem 3 does not assert optimal dependence on kk. The lower-bound statement was already made in the conclusion of Bai et al.; § 5 supplies an arbitrary-alphabet reduction that justifies its use of the Closest String lower bound.

The main obstacle to the algorithm is that a radius-dd ball can contain nΩ(d)n^{\Omega(d)} permutations. Guessing the moved symbols and their new positions would put the parameter in the exponent of the input size. Three ingredients avoid that enumeration.

  1. A failed candidate has an obstruction on at most 2d+22d+2 symbols. Stopping patience sorting after d+1d+1 replacements produces this obstruction within O(n+(d+1)log⁡(n+1))O(n+(d+1)\log(n+1)) operations (Lemma 4).

  1. Relative to a fixed reference ranking, a symbol has at most 4d+24d+2 relevant insertion cuts. Canonical cuts ensure that partial placements continue to agree with one fixed solution outside the still unguessed moved symbols (Lemmas 5–7).

  1. Each center keeps its own permanent reference. An uncovered input either supplies a reference for a new cluster or exposes a new moved symbol for an existing center. At most kk references and kdkd moved symbols are introduced (§ 4).

The source already uses a search that creates candidate centers from uncovered inputs. Its local steps use permutation graphs, short lists of one-symbol moves, and suitable two-colorings; the full version constructs a coloring family of size 2O(d2)log⁡n2^{O(d^2)}\log n [2 Lemmas 11, 13, 16 and Algorithm 1]. Here the references remain fixed while partial placements accumulate. A small obstruction selects a new symbol directly, avoiding the coloring family. The compatibility argument preserves the association of each reference with a distinct true cluster, so the input partition need not be guessed. Intermediate candidates need not cover the same inputs at every stage; the final coverage test certifies the solution.

The linear input factor uses only a threshold version of the classical patience-sorting algorithm, not a faster unrestricted longest-increasing-subsequence algorithm. Almost all scanned symbols extend the list of pile tops in constant time; only d+1d+1 operations can require binary search before either success or an obstruction is known.

Related work

Bachmaier, Brandenburg, Gleißner, and Hofmeier proved NP-completeness of maximum rank aggregation under Ulam distance, among other metrics [3 Theorem 3]. Their bounded-modification-set framework also gives fixed-parameter algorithms for Kendall tau, Hamming, and Minkowski distances; Ulam distance is not among those algorithmic instantiations [3 Section 6]. Choosing an input permutation gives the familiar factor-2 metric approximation. For mm input rankings, Chakraborty, Gajjar, and Jha obtain a deterministic (3/2−1/(3m))(3/2 - 1/(3m))-approximation in time nO(m2log⁡m)n^{O(m^2 \log m)} [4 Theorem 1]. More recently, Azgor, Chakraborty, Cuong, Das, Habib, and Nguyen prove that, for each 0<ε<1/340 < \varepsilon< 1/34, approximating the continuous center within 35/34−ε35/34 - \varepsilon is NP-hard even for four rankings [11 Theorem 1.3]. This rules out polynomial-time exact optimization for fixed m=4m = 4, unless P equals NP; it is compatible with an exact algorithm parameterized by the radius.

The discrete center problem restricts the center to an input permutation. Abboud, Bateni, Cohen-Addad, Karthik C. S., and Seddighin study its fine-grained complexity and give a (1+ε)(1 + \varepsilon)-approximation [9 Theorems 1 and 3]. Fischer, Goldenberg, Habib, and Karthik C. S. subsequently establish conditional optimality, up to subpolynomial factors, of the pairwise-distance algorithm when the permutation length is polynomially related to the number of inputs [10 Theorem 2]. Those results concern a different solution space and polynomial input-size dependence, rather than the radius dependence of the continuous problem considered here.

The lower-bound comparison requires attention to the alphabet. Lokshtanov, Marx, and Saurabh exclude 2o(dlog⁡d)2^{o(d \log d)} dependence for Closest String over unrestricted alphabets [8 Theorem 3.1]. The proof of Lemma 18 in Bai et al.’s full version uses a binary pair encoding [2 Section 3.3]. Fixed-alphabet Closest String has single-exponential algorithms [8 Section 3]; for the binary case, Fischer and Habib give a randomized O∗(4d)O^*(4^d)-time algorithm [6 Theorem 1]. Thus the binary encoding alone does not transfer the unrestricted-alphabet lower bound. The marker construction in Section 5 handles any alphabet size and projects arbitrary permutation centers back to strings without increasing distances. It therefore completes the lower-bound argument anticipated in the source.

Deletion witnesses and small obstructions

For S⊆ΣS \subseteq\Sigma, write π∣S\pi|_S for the subsequence induced by SS. A deletion witness between α\alpha and β\beta is a set D⊆ΣD \subseteq\Sigma such that

α∣Σ∖D=β∣Σ∖D.\alpha|_{\Sigma\setminus D} = \beta|_{\Sigma\setminus D}.

Equivalently, dist⁡U(α,β)≤d\operatorname{dist}_{U}(\alpha,\beta) \le d if and only if such a witness of size at most dd exists. In particular, a reference ranking ρ\rho within distance dd of a center σ⋆\sigma^\star agrees with that center outside some set XX of at most dd symbols. No uniqueness of XX is assumed.

The following algorithm gives both the distance test and the obstruction needed for branching. The elementary patience-sorting principle is classical; see Aldous and Diaconis [5].

Lemma 4 (Threshold test and obstruction). Given permutations α,β\alpha,\beta, the inverse-position array of β\beta, and d≥0d \ge0, one can either certify dist⁡U(α,β)≤d\operatorname{dist}_{U}(\alpha,\beta) \le d or find H⊆ΣH \subseteq\Sigma such that

∣H∣≤2d+2,dist⁡U(α∣H,β∣H)>d.(2)|H| \le2d+2,\qquad\operatorname{dist}_{U}(\alpha|_H,\beta|_H) > d. \tag*{(2)}

This takes O(n+(d+1)log⁡(n+1))O(n + (d+1)\log(n+1)) operations and O(n)O(n) memory.

Proof. Read the symbols of α\alpha and replace each by its position in β\beta. A common subsequence of the permutations is exactly an increasing subsequence of this sequence of distinct ranks. Maintain piles whose tops t1<⋯<tℓt_1 < \cdots< t_\ell are increasing. A new rank r>tℓr > t_\ell starts a new pile on the right; otherwise place rr on the leftmost pile whose top exceeds rr. Call the latter operation a replacement. For an empty list, the first rank starts the first pile.

After any prefix, tjt_j is the smallest possible final rank of an increasing subsequence of length jj. To verify the invariant, suppose rr replaces tjt_j. If j>1j > 1, an increasing subsequence ending at tj−1<rt_{j-1} < r extends to one of length jj ending at rr; for j=1j = 1 the singleton suffices. There was no subsequence of length jj ending below rr, by the minimality of the old tjt_j. Nor can rr end a subsequence of length greater than jj, since that would require an old subsequence of length jj ending below rr. The other minima are unchanged. If rr starts a new rightmost pile, the same extension gives a subsequence of length ℓ+1\ell+ 1, and no longer one can be created by one new rank. This proves the invariant by induction. Thus ℓ\ell is the longest increasing subsequence length of the scanned prefix.

After ii ranks, the number of replacements is i−ℓi-\ell, because every other operation starts one pile. This deficit never decreases. Stop at the (d+1)(d+1)-st replacement. If the whole sequence is scanned first, its deficit is the Ulam distance, so the test succeeds.

On stopping, let P1,…,PtP_1,\ldots,P_t be the non-singleton piles and let HH contain their symbols. Each pile is decreasing in scan order, so an increasing subsequence of HH contains at most one symbol from each pile. Moreover,

∑j=1t(∣Pj∣−1)=d+1,t≤d+1.\sum_{j=1}^{t} (|P_j|-1)=d+1,\qquad t\le d+1.

Consequently ∣H∣=d+1+t≤2d+2|H|=d+1+t\le2d+2 and its longest increasing subsequence has length at most tt, proving (2).

Compare each rank first with the rightmost top. Appending costs constant time, and a replacement uses binary search in O(log⁡(n+1))O(\log(n+1)) time. There are at most d+1d+1 replacements. Store the symbols of each pile, and keep a list of the piles that have become non-singleton; their union can then be collected in O(d+1)O(d+1) time. The claimed bounds follow.

Small cut lists

Fix an arbitrary reference permutation ρ\rho. A cut of the reference permutation ρ\rho is an integer c∈{0,1,…,n}c\in\{0,1,\ldots,n\}; it is the gap after the first cc symbols of ρ\rho. For a symbol xx and a cut cc, define

Pcx={a∈Σ∖{x}:pos⁡ρ(a)≤c}.P_c^x=\{a\in\Sigma\setminus\{x\}:\operatorname{pos}_{\rho}(a)\le c\}.

For an input permutation πi\pi_i, define the predecessor set of xx in πi\pi_i by

Li(x)={a∈Σ∖{x}:a is before x in πi}.L_i(x)=\{a\in\Sigma\setminus\{x\}:a\text{ is before }x\text{ in }\pi_i\}.

Define the cut list

Si(x)={c∈{0,…,n}:∣Pcx△Li(x)∣≤2d}.S_i(x)=\{c\in\{0,\ldots,n\}:|P_c^x\mathbin{\triangle}L_i(x)|\le2d\}.

The key point is that, although there are n+1n+1 possible cuts, only O(d)O(d) of them can be relevant for any fixed input and symbol.

Lemma 5 (Small cut lists). For every input πi\pi_i and every symbol xx,

∣Si(x)∣≤4d+2.|S_i(x)|\le4d+2.

Proof. Put ℓ=∣Li(x)∣\ell=|L_i(x)| and h(c)=∣Pcx∣h(c)=|P_c^x|. For every listed cut,

∣h(c)−ℓ∣≤∣Pcx△Li(x)∣≤2d.|h(c)-\ell|\le|P_c^x\mathbin{\triangle}L_i(x)|\le2d.

Thus h(c)h(c) lies in an interval containing at most 4d+14d+1 integers. As cc ranges from 00 to nn, the value h(c)h(c) runs through 0,…,n−10,\ldots,n-1. Each value occurs once except pos⁡ρ(x)−1\operatorname{pos}_{\rho}(x)-1, which occurs twice, immediately before and after the reference position of xx. Consequently

∣Si(x)∣≤4d+2.|S_i(x)|\le4d+2.

For computation, begin with ∣P0x△Li(x)∣=∣Li(x)∣|P_0^x\mathbin{\triangle}L_i(x)|=|L_i(x)| and scan ρ\rho. Passing a symbol of Li(x)L_i(x) decreases the value by one, passing a symbol outside Li(x)∪{x}L_i(x)\cup\{x\} increases it by one, and passing xx leaves it unchanged. The inverse-position array of πi\pi_i gives membership in Li(x)L_i(x) in constant time. Thus the list can be computed in O(n)O(n) time, without any assumption on dist⁡U(ρ,πi)\operatorname{dist}_U(\rho,\pi_i).

Now fix a permutation σ⋆\sigma^\star with dist⁡U(ρ,σ⋆)≤d\operatorname{dist}_{U}(\rho,\sigma^\star) \le d, a deletion witness XX of size at most dd between them, and put R=Σ∖XR = \Sigma\setminus X. For x∈Xx \in X, let

Bx={a∈R:a is before x in σ⋆}.B_x = \{a \in R : a\text{ is before }x\text{ in }\sigma^\star\}.

Because σ⋆∣R=ρ∣R\sigma^\star|_R = \rho|_R, the set BxB_x is a prefix of ρ∣R\rho|_R. Define the canonical cut of xx by

cx={0,Bx=∅,max⁡{pos⁡ρ(a):a∈Bx},Bx≠∅.(3)c_x = \begin{cases} 0, & B_x = \varnothing,\\ \max\{\operatorname{pos}_{\rho}(a) : a \in B_x\}, & B_x \ne\varnothing. \end{cases} \tag*{(3)}

Then Pcxx∩R=BxP_{c_x}^x \cap R = B_x. In particular, the exact definition (3) assigns the same cut to all moved symbols occupying the same gap of the stable order RR.

Lemma 6 (Canonical cuts are listed). Let σ⋆\sigma^\star and XX be as above, and let x∈Xx \in X. Let DiD_i be a deletion witness of size at most dd between σ⋆\sigma^\star and πi\pi_i. If x∉Dix \notin D_i, then the canonical cut cxc_x belongs to Si(x)S_i(x).

Proof. Consider a symbol a∈Σ∖(X∪Di)a \in\Sigma\setminus(X \cup D_i). Since a∈Ra \in R, the definition of the canonical cut gives a∈Pcxxa \in P_{c_x}^x if and only if a∈Bxa \in B_x, which means that aa precedes xx in σ⋆\sigma^\star. Also a,x∉Dia,x \notin D_i, so σ⋆\sigma^\star and πi\pi_i order aa and xx in the same way. Therefore

a∈Pcxx⟺a∈Bx⟺a∈Li(x).a \in P_{c_x}^x \Longleftrightarrow a \in B_x \Longleftrightarrow a \in L_i(x).

All possible disagreements between PcxxP_{c_x}^x and Li(x)L_i(x) are therefore contained in X∪DiX \cup D_i. Neither predecessor set contains xx, so the disagreements are in (X∖{x})∪Di(X \setminus\{x\}) \cup D_i, a set of size at most 2d2d. Hence ∣Pcxx△Li(x)∣≤2d|P_{c_x}^x \mathbin{\triangle} L_i(x)| \le2d, so cx∈Si(x)c_x \in S_i(x).

Example. Let ρ=12345\rho= 12345, let πi=13245\pi_i = 13245, and take d=1d = 1. For the symbol x=3x = 3, the predecessor set in πi\pi_i is Li(3)={1}L_i(3) = \{1\}. Direct inspection gives

Si(3)={0,1,2,3,4};S_i(3) = \{0,1,2,3,4\};

cut 5 is excluded because its predecessor set {1,2,4,5}\{1,2,4,5\} differs from Li(3)L_i(3) in three symbols. The permutation σ⋆=13245\sigma^\star= 13245 has reference-deletion set X={3}X = \{3\}, and the canonical cut of 3 is cut 1, immediately after the symbol 1. Thus the cut needed by this permutation is indeed present in the local list, as Lemma 6 guarantees in general.

We next formalize partial placements. A state consists of

(A,γ,λ),(A,\gamma,\lambda),

where A⊆ΣA \subseteq\Sigma, ∣A∣≤d|A| \le d, is a set of symbols guessed to be moved relative to ρ\rho, γ:A→{0,…,n}\gamma: A \to\{0,\ldots,n\} assigns a full-reference cut to every guessed symbol, and λ\lambda is a total order of AA. The candidate permutation σA\sigma_A is obtained by deleting every symbol of AA from ρ\rho and reinserting each x∈Ax \in A at cut γ(x)\gamma(x): smaller numerical cuts come first, and equal cuts are ordered according to λ\lambda. Formally, write λ(x)\lambda(x) for the rank of xx in λ\lambda, note that pos⁡ρ(z)∈{1,…,n}\operatorname{pos}_{\rho}(z) \in\{1,\ldots,n\}, and sort all symbols lexicographically by

κA(z)={(pos⁡ρ(z),0,0),z∉A,(γ(z),1,λ(z)),z∈A.\kappa_A(z) = \begin{cases} (\operatorname{pos}_{\rho}(z),0,0), & z \notin A,\\ (\gamma(z),1,\lambda(z)), & z \in A. \end{cases}

This lexicographic definition remains unambiguous when a cut endpoint is itself a symbol of AA deleted from the reference.

Lemma 7 (Reconstruction of compatible states). Let λ⋆\lambda^\star be the order induced by σ⋆\sigma^\star on XX. Suppose that A⊆XA \subseteq X, that γ(x)=cx\gamma(x) = c_x for every x∈Ax \in A, and that λ=λ⋆∣A\lambda= \lambda^\star|_A. Put U=X∖AU = X \setminus A. Then

σA∖U=σ⋆∣X∖U.(4)\sigma_{A\setminus U} = \sigma^\star|_{X\setminus U}. \tag*{(4)}

Proof. Set R=Σ∖XR = \Sigma\setminus X, so that Σ∖U=R∪A\Sigma\setminus U = R \cup A. Both permutations induce the order ρ∣R\rho|_R on RR.

Let x∈Ax \in A and r∈Rr \in R. In σA\sigma_A, the symbol rr precedes xx if and only if pos⁡ρ(r)≤cx\operatorname{pos}_{\rho}(r) \le c_x, equivalently r∈Bxr \in B_x. By the definition of BxB_x, this is also equivalent to rr preceding xx in σ∗\sigma^*.

It remains to compare two symbols x,y∈Ax,y \in A. The sets BxB_x and ByB_y are prefixes of the same order. If Bx⊂ByB_x \subset B_y, then the definition (3) gives cx<cyc_x < c_y, so xx precedes yy in σA\sigma_A. Choosing r∈By∖Bxr \in B_y \setminus B_x also gives x<r<yx < r < y in σ∗\sigma^*. The case By⊂BxB_y \subset B_x is symmetric. Finally, if Bx=ByB_x = B_y, then cx=cyc_x = c_y, and both permutations order x,yx,y according to λ∣A=λ\lambda|_A = \lambda. Thus every pair in R∪AR \cup A has the same relative order in the two permutations, proving (4).

The reconstruction can be implemented without sorting all nn symbols. Sort the at most dd moved symbols by (γ(x),λ(x))(\gamma(x),\lambda(x)), then scan the cuts 0,…,n0,\ldots,n. At a positive cut cc, first output the reference symbol in position cc if it is not moved; next output the moved symbols assigned to cut cc in their prescribed order. At cut zero only the moved symbols are output. This realizes the lexicographic keys above in O(n+dlog⁡(d+1))O(n+d\log(d+1)) time.

The search over several centers

A search node contains s≤ks \le k records

(ρj,Aj,γj,λj),1≤j≤s.(\rho_j,A_j,\gamma_j,\lambda_j), \qquad1 \le j \le s.

Each reference ρj\rho_j is an input permutation and remains fixed for the lifetime of its record. The other data are a partial placement relative to that reference, with ∣Aj∣≤d|A_j| \le d; denote its reconstructed candidate by σj\sigma_j. Initially there is one record with ρ1=π1\rho_1 = \pi_1 and A1=∅A_1 = \varnothing.

At a node, perform the following steps.

  1. Construct the candidates. If every input is within distance dd of some candidate, return these candidates and accept.

  1. Otherwise choose an uncovered input πi\pi_i. If s<ks < k, create one child that adds the record (πi,∅,∅,∅)(\pi_i,\varnothing,\varnothing,\varnothing).

  1. For each existing record jj with ∣Aj∣<d|A_j| < d, use Lemma 4 to find an obstruction HjH_j between σj\sigma_j and πi\pi_i. For each x∈Hj∖Ajx \in H_j \setminus A_j, each c∈Si(j)(x)c \in S_i^{(j)}(x), and each of the ∣Aj∣+1|A_j|+1 insertion positions in λj\lambda_j, create a child that adds xx with this cut and order position to record jj. Here Si(j)S_i^{(j)} is the cut list computed relative to ρj\rho_j. Keep all other records and all earlier placements unchanged.

  1. Reject if every child rejects.

The algorithm does not reject an instance merely because two inputs are farther than 2d2d apart: they may be covered by different centers.

Proof of Theorem 2. If k≥mk \ge m, the inputs themselves are a solution. If d≥n−1d \ge n-1, any input is a center. Hence assume 1≤k<m1 \le k < m and 1≤d<n−11 \le d < n-1. Soundness follows from the coverage test at every accepting node.

For completeness, fix a feasible set of at most kk true centers and assign each input to one true center that covers it. Empty clusters can be omitted. A compatible node associates its records injectively with true centers, with each reference belonging to its associated cluster. Write σj∗\sigma_j^* for the center associated with record jj. When a record is created, fix a deletion witness XjX_j, ∣Xj∣≤d|X_j| \le d, between ρj\rho_j and σj∗\sigma_j^*. Compatibility further requires

Aj⊆Xj,γj(x)=cx(j)(x∈Aj),λj=σj∗∣Aj,A_j \subseteq X_j,\qquad\gamma_j(x)=c_x^{(j)}\quad(x\in A_j),\qquad\lambda_j=\sigma_j^*|_{A_j},

where cx(j)c_x^{(j)} is the canonical cut defined using ρj\rho_j, XjX_j, and the last equality identifies a total order with its ordered sequence. Lemma 7 gives, with Uj=Xj∖AjU_j = X_j \setminus A_j,

σj∣Σ∖Uj=σj⋆∣Σ∖Uj.(5)\sigma_j|_{\Sigma\setminus U_j} = \sigma_j^{\star}|_{\Sigma\setminus U_j}. \tag*{(5)}

The initial node is compatible by associating its sole record with the true center assigned to π1\pi_1.

Consider an uncovered input πi\pi_i at a compatible node. If its assigned true center is not represented by a record, there are fewer records than true centers and hence s<ks < k. The new-record child is compatible: associate it with that true center and choose its witness Xs+1X_{s+1}. Its moved set is empty, so every placement condition is satisfied.

Otherwise let jj be the record associated with the assigned true center. Choose a deletion witness DD, ∣D∣≤d|D| \le d, between πi\pi_i and σj⋆\sigma_j^{\star}. Since πi\pi_i is uncovered, the obstruction HjH_j satisfies (2). It contains a symbol in Uj∖DU_j \setminus D. Indeed, if it contained no such symbol, then Hj∖DH_j \setminus D would be disjoint from UjU_j. (5) and the witness property of DD would give

σj∣Hj∖D=σj⋆∣Hj∖D=πi∣Hj∖D.\sigma_j|_{H_j\setminus D} = \sigma_j^{\star}|_{H_j\setminus D} = \pi_i|_{H_j\setminus D}.

Deleting Hj∩DH_j \cap D, at most dd symbols, would therefore make the restricted permutations equal, contradicting (2).

Choose x∈Hj∩(Uj∖D)x \in H_j \cap(U_j \setminus D). In particular, ∣Aj∣<∣Xj∣≤d|A_j| < |X_j| \le d, so this record is eligible for extension. The symbol is moved relative to its reference and is kept by the witness DD. Lemma 6 places its canonical cut in Si(j)(x)S_i^{(j)}(x). The algorithm includes the child selecting this cut and the insertion position that extends the current order to σj⋆∣Aj∪{x}\sigma_j^{\star}|_{A_j\cup\{x\}}. This child is compatible.

Thus every compatible nonaccepting node has a compatible child. Each transition either adds a record or increases one moved set. There are at most k−1k - 1 record additions and kdkd moved-symbol additions, so no path has more than k(d+1)−1k(d + 1) - 1 transitions. A compatible path must therefore accept. This proves completeness without any assumption that coverage is monotone along the path.

There is at most one new-record child, and the extension of each record has at most (2d+2)(4d+2)(d+1)(2d + 2)(4d + 2)(d + 1) choices. The branching factor is at most

b=1+k(2d+2)(4d+2)(d+1).b = 1 + k(2d + 2)(4d + 2)(d + 1).

The depth bound gives 1+b+⋯+bk(d+1)1 + b + \cdots+ b^{k(d+1)} nodes. Since d≥1d \ge1, this is 2O(kdlog⁡(k+d+2))2^{O(kd\log(k+d+2))}.

Precompute the inverse-position arrays of all inputs in O(mn)O(mn) time. At a node, reconstructing all candidates costs O(k(n+dlog⁡(d+1)))O(k(n + d\log(d + 1))). Coverage testing uses at most kmkm applications of Lemma 4. For the uncovered input, the same routine provides each required obstruction. There are O(k(d+1))O(k(d + 1)) relevant symbols, and each cut list takes O(n)O(n) time. These costs are bounded by a polynomial in k,dk,d times mnmn, using log⁡(n+1)=O(n)\log(n + 1) = O(n). Creating or copying a child record adds only a polynomial factor in k,dk,d, already absorbed in the search bound. This proves (1) in the stated word model.

Hamming retractions and the radius lower bound

An isometric encoding alone would not suffice for the lower bound: a permutation center outside the encoded strings could conceivably have a smaller radius. The following construction provides a simultaneous projection for all inputs. Write dHd_H for Hamming distance.

Lemma 8 (Arbitrary-alphabet retraction). For every q≥2q \ge2 and L≥1L \ge1, there are maps

E:{0,…,q−1}L⟶SLq,r:SLq⟶{0,…,q−1}LE:\{0,\ldots,q-1\}^{L} \longrightarrow S_{Lq}, \qquad r:S_{Lq} \longrightarrow\{0,\ldots,q-1\}^{L}

computable in polynomial time such that r∘Er \circ E is the identity and

dist⁡U(E(s),E(t))=dH(s,t),(6)\operatorname{dist}_{U}(E(s),E(t)) = d_H(s,t), \tag*{(6)}
dH(r(α),r(β))≤dist⁡U(α,β)(α,β∈SLq).(7)d_H(r(\alpha),r(\beta)) \le\operatorname{dist}_{U}(\alpha,\beta) \qquad(\alpha,\beta\in S_{Lq}). \tag*{(7)}

Consequently, replacing each input string by its encoding preserves the optimal radius with any prescribed number of arbitrary centers.

Proof. For coordinate ii, use a disjoint block of symbols Bi={zi,ai,1,…,ai,q−1}B_i = \{z_i, a_{i,1}, \ldots, a_{i,q-1}\}. Define

Ci(b)=ai,1⋯ai,b zi ai,b+1⋯ai,q−1(0≤b<q),C_i(b) = a_{i,1} \cdots a_{i,b}\,z_i\,a_{i,b+1} \cdots a_{i,q-1} \qquad(0 \le b < q),

with an empty initial or final anchor string at the endpoints. Distinct values of bb give distinct block permutations that share all q−1q-1 anchors in order. Thus their Ulam distance is one. Set

E(s)=C1(s1)C2(s2)⋯CL(sL).E(s) = C_1(s_1)C_2(s_2)\cdots C_L(s_L).

Both encodings place the disjoint blocks in the same order, so their longest common subsequence lengths add over the blocks. This proves (6).

For an arbitrary permutation α\alpha, restrict it to each block BiB_i. If α∣Bi=Ci(b)\alpha|_{B_i} = C_i(b) for some bb, put r(α)i=br(\alpha)_i = b; otherwise put r(α)i=0r(\alpha)_i = 0. The canonical block permutations are distinct, so this is well-defined and r(E(s))=sr(E(s)) = s. If r(α)i≠r(β)ir(\alpha)_i \ne r(\beta)_i, then the two block restrictions differ, since equal restrictions receive equal decoded letters. Their Ulam distance, being a nonnegative integer, is at least one. Therefore

dH(r(α),r(β))≤∑i=1Ldist⁡U(α∣Bi,β∣Bi).(8)d_H(r(\alpha), r(\beta)) \le\sum_{i=1}^{L} \operatorname{dist}_{U}(\alpha|_{B_i}, \beta|_{B_i}). \tag*{(8)}

Any common subsequence of α,β\alpha,\beta, restricted to BiB_i, is a common subsequence of their block restrictions. Summing these upper bounds on the subsequence length and subtracting from LqLq gives

∑i=1Ldist⁡U(α∣Bi,β∣Bi)≤dist⁡U(α,β),(9)\sum_{i=1}^{L} \operatorname{dist}_{U}(\alpha|_{B_i}, \beta|_{B_i}) \le\operatorname{dist}_{U}(\alpha,\beta), \tag*{(9)}

which proves (7).

An encoded family of string centers achieves the same radius by (6). Conversely, decode each arbitrary permutation center. For every input string tt, applying (7) with β=E(t)\beta= E(t) shows that its distance to the decoded center is no greater than its encoded distance to the original center. This works for every input and every center simultaneously, proving equality of optimal radii.

For example, when q=3q = 3 the three letters are represented by ziai,1ai,2z_i a_{i,1}a_{i,2}, ai,1ziai,2a_{i,1}z_i a_{i,2}, and ai,1ai,2zia_{i,1}a_{i,2}z_i. The marker moves while the two anchors retain their order. A noncanonical order such as ai,2ziai,1a_{i,2}z_i a_{i,1} may be decoded as zero: it differs from every canonical order, so the possible unit Hamming cost is always paid for by its Ulam distance.

Proof of Theorem 3. Lokshtanov, Marx, and Saurabh prove that Closest String has no 2o(dlog⁡d)∣I∣O(1)2^{o(d\log d)}|I|^{O(1)}-time algorithm under ETH [8 Theorem 3.1]. In their construction from h×hh \times h Hitting Set, the strings have length L=hL = h, alphabet size q=2h+1q = 2h + 1, and radius d=h−1d = h - 1. Applying Lemma 8 yields permutations of

n=Lq=(d+1)(2d+3)n = Lq = (d+1)(2d+3)

symbols, with the same number of inputs and the same radius. The expansion is polynomial, and the lemma gives equivalence even when the permutation center is unrestricted. A Ulam algorithm in the excluded time would therefore solve these Closest String instances in the time excluded by the cited theorem.

Concluding remarks

For one center, the upper and lower bounds determine the radius dependence up to constant factors in the exponent under ETH, with a linear factor in the explicit input size for the upper bound. For several centers, the remaining question is the best joint dependence on kk and dd. The present argument bounds the number of introduced references and moved symbols separately; the one-center lower bound alone does not settle the cost of coordinating many clusters.

References

  1. [1]Tian Bai, Fedor V. Fomin, Petr A. Golovach, Yash Hiren More, and Simon Wietheger. Clustering permutations under the Ulam metric: A parameterized complexity study. 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), Article 19, pages 19:1–19:23. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2026. https://doi.org/10.4230/LIPIcs.ICALP.2026.19.
  2. [2]Tian Bai, Fedor V. Fomin, Petr A. Golovach, Yash Hiren More, and Simon Wietheger. Clustering permutations under the Ulam metric: A parameterized complexity study. Full version of the ICALP 2026 paper, arXiv:2604.25734v1 [cs.DS], 2026. https://arxiv.org/abs/2604.25734.
  3. [3]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. https://doi.org/10.1016/j.jda.2014.10.002.
  4. [4]Diptarka Chakraborty, Kshitij Gajjar, and Agastya Vibhuti Jha. Approximating the center ranking under Ulam. In 41st LARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2021), volume 213 of LIPIcs, Article 12, pages 12:1–12:21, 2021. https://doi.org/10.4230/LIPIcs.FSTTCS.2021.12.
  5. [5]David Aldous and Persi Diaconis. Longest increasing subsequences: From patience sorting to the Baik–Deift–Johansson theorem. Bulletin of the American Mathematical Society, 36(4):413–432, 1999. https://doi.org/10.1090/S0273-0979-99-00796-X.
  6. [6]Nick Fischer and Mursalin Habib. An optimal algorithm for binary closest string. arXiv:2605.31417v1 [cs.DS], 2026. https://arxiv.org/abs/2605.31417.
  7. [7]Jens Gramm, Rolf Niedermeier, and Peter Rossmanith. Fixed-parameter algorithms for Closest String and related problems. Algorithmica, 37(1):25–42, 2003. https://doi.org/10.1007/s00453-003-1028-3.
  8. [8]Daniel Lokshtanov, Dániel Marx, and Saket Saurabh. Slightly superexponential parameterized problems. SIAM Journal on Computing, 47(3):675–702, 2018. https://doi.org/10.1137/16M1104834.
  9. [9]Amir Abboud, MohammadHossein Bateni, Vincent Cohen-Addad, Karthik C. S., and Saeed Seddiqighin. On complexity of 1-center in various metrics. In APPROX/RANDOM 2023, volume 275 of LIPIcs, Article 1, 2023. https://doi.org/10.4230/LIPIcs.APPROX/RANDOM.2023.1.
  10. [10]Nick Fischer, Elazar Goldenberg, Mursalin Habib, and Karthik C. S. Hardness of median and center in the Ulam metric. In ESA 2025, volume 351 of LIPIcs, pages 111:1–111:17, 2025. https://doi.org/10.4230/LIPIcs.ESA.2025.111.
  11. [11]Sk Ruhul Azgor, Diptarka Chakraborty, Le Van Cuong, Debarati Das, Mursalin Habib, and Tien Long Nguyen. Ulam rank aggregation is hard to approximate for four rankings. arXiv:2609.05874v1 [cs.CC], September 2026. https://arxiv.org/abs/2609.05874v1.

Paper details

vlnc:W_xeya72ft
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents