Abstract 1 Introduction 2 Preliminaries 3 Upper Bound: Proof Overview 4 Lower Bound References

The Communication Complexity of Pattern Matching with Edits Revisited

Tomasz Kociumaka ORCID Max Planck Institute for Informatics, Saarland Informatics Campus, Saarbrücken, Germany    Jakob Nogler ORCID Massachusetts Institute of Technology, Cambridge, MA, USA    Philip Wellnitz ORCID National Institute of Informatics, Tokyo, Japan
The Graduate University for Advanced Studies, SOKENDAI, Tokyo, Japan
Abstract

The decades-old Pattern Matching with Edits problem, given a length-n string T (the text), a length-m string P (the pattern), and a positive integer k (the threshold), asks to list the k-error occurrences of P in T, that is, all fragments of T whose edit distance to P is at most k. The one-way communication complexity of this problem is the minimum number of bits that Alice, given an instance (P,T,k) of the problem, must send to Bob so that Bob can reconstruct the answer solely from that message.

In recent work [STOC’24], we showed that, in the natural parameter regime 0<k<m<n/2, Ω(n/mklog(m/k)) bits are necessary and 𝒪(n/mklog2m) bits are sufficient for this problem. More generally, for strings over an alphabet Σ, we gave an 𝒪(n/mklogmlog(m|Σ|))-bit encoding that allows one to recover a shortest sequence of edits for every k-error occurrence of P in T.

In this paper, we revisit the original proof and improve the encoding size to 𝒪(n/mklog(m|Σ|/k)), which matches the lower bound for constant-sized alphabets. We further establish a new tight lower bound of Ω(n/mklog(m|Σ|/k)) for the edit sequence reporting variant we solve. Our encoding size also matches the communication complexity established for the simpler Pattern Matching with Mismatches problem in the context of streaming algorithms [Clifford, Kociumaka, Porat; SODA’19].

Keywords and phrases:
Edit distance, Pattern matching, Communication complexity
Copyright and License:
[Uncaptioned image] © Tomasz Kociumaka, Jakob Nogler, and Philip Wellnitz; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Pattern matching
; Theory of computation Communication complexity ; Mathematics of computing Combinatorics on words
Related Version:
Full Version: https://arxiv.org/abs/2604.15601 [16]
Editors:
Philip Bille and Nicola Prezza

1 Introduction

In the more-than-classic Pattern Matching with Edits problem (PMWE) [22], we are given a text T of length n, a pattern P of length m, and a threshold k, and the task is to compute the starting positions of all substrings of T whose edit distance to P is at most k. Formally, we aim to compute the set

OcckE(P,T){i[ 0..n]:j[i..n]δE(P,T[i..j))k},

where δE(,) denotes the edit (Levenshtein) distance [21]. This metric quantifies the (dis)similarity between strings by counting the minimum number of single-character edits (insertions, deletions, and substitutions) required to transform one string into the other.

Research into this problem has expanded far beyond the classical setting [22, 19, 20, 9, 5, 6], with modern variants exploring compressed [11, 24, 3, 5], dynamic [5], streaming [23, 17, 2], weighted [7], and quantum [13, 15] settings. We recently investigated the problem’s one-way communication complexity [13], which involves determining the minimum space required to encode an instance so that the set of k-error occurrences can be reconstructed without further access to the original input.

The communication complexity framework models this as a two-party game: Alice, who holds the problem instance, transmits a single message to Bob. Bob’s task is to derive the full output solely from this message. Because Bob lacks any initial input of his own, the problem reduces to a one-way single-round protocol, and the primary objective is to minimize the number of bits Alice must transmit.

In [13], we established that, in the natural parameter regime of 0<k<m<n/2, Ω(n/mklog(m/k)) bits are necessary for this problem, while 𝒪(n/mklog2m) bits are sufficient. More generally, we showed that if the shortest sequence of edits must be recovered for each k-error occurrence, the upper bound increases to 𝒪(n/mklogmlog(m|Σ|)), where Σ is the input alphabet. The former result is implied by the latter by performing a simple alphabet reduction: all characters of T not present in P are mapped to a single character. The result of [13] is significant for three reasons.

  1. 1.

    A central open question [9, 6] for PMWE is whether a static algorithm can match the 𝒪(n+n/mk2Ω(1)) conditional lower bound [1]. The current state-of-the-art algorithm by Charalampopoulos, Kociumaka, and Wellnitz [6] runs in 𝒪~(n+n/mk3.5) time, and relies on structural results [5] that allow it to return the required output OcckE(P,T) using 𝒪~(n/mk3) bits. This encoding is fundamentally incompatible with reaching the lower bound; however, the results of [13] demonstrate that this barrier can indeed be overcome.

  2. 2.

    A similar question was previously settled for the simpler Pattern Matching with Mismatches problem (PMWM) [8]; here Ω(n/mklog(m/k)) bits are necessary and 𝒪(n/mklog(m|Σ|/k)) bits suffice to also report the mismatches for all k-mismatch occurrences. Thus, by [13] and up to essentially an 𝒪(logm) factor, the edit distance setting behaves the same as the mismatch setting in terms of information density.

  3. 3.

    Said result of [13] also paves the way for better algorithms in other computational models (e.g., the quantum algorithms for PMWE of [13, 15], which crucially rely on this result). The prior work on PMWM [8] suggests that one-way communication complexity is a stepping stone toward 𝒪~(k)-space algorithms in the streaming and semi-streaming models. This is particularly relevant given the concurrent development of 𝒪(kno(1))-size edit distance sketches [18]. Although the state-of-the-art sketches do not yet offer the space-efficient sketch construction needed for a full streaming implementation, the advances in [13] represent significant steps toward it.

Our Results.

We re-examine the encoding provided in [13] and, through a series of refinements, eliminate the Θ(logm) term separating the upper and lower bounds. Thereby, we place PMWE on par with PMWM. Formally, we show the following result.

Theorem 1.1.

Fix integers n,m,k with nmk>0 and an input alphabet Σ. The Pattern Matching with Edits problem admits a one-way deterministic communication protocol that sends 𝒪(n/mklog(m|Σ|/k)) bits. Within the same communication complexity, one can also reconstruct the set of all fragments T[i..j) satisfying δE(P,T[i..j))k and, for each such fragment, the edit information (the positions and values of edited characters) of all optimal edit sequences transforming P into the fragment T[i..j).

 Remark 1.2.

Our result extends routinely beyond nmk>0. If n<m, it suffices to apply Theorem 1.1 with the text T replaced by 𝟶mnT, where 𝟶Σ is an arbitrary character. Applying Theorem 1.1 with threshold k=m allows one to reconstruct the entire pattern from the edit sequence for an empty fragment of the text and the entire text from the edit sequences for single-character fragments; this covers k>m. Finally, the case k=0 is no harder than k=1. Thus, in full generality, the communication complexity becomes

𝒪(max(1,nm)min(m,k+1)logm|Σ|min(m,k+1)).

Through the aforementioned alphabet reduction, we also achieve 𝒪(n/mklogm) bits for the variant where only the positions (but not the values) of edited characters are reported. This suffices for the baseline problem asking for the starting positions of k-error occurrences, which means that we match the lower bound of [13] unless both km1o(1) and |Σ|ω(1).

It is not difficult to show that a single optimal edit sequence for a single k-error occurrence can be encoded using 𝒪(klog(m|Σ|/k)) bits. While the previous approach in [13] required storing information proportional to 𝒪(logm) edit sequences for each length-Θ(m) block of the text, our improvement achieves the information content equivalent to 𝒪(1) edit sequences. Hence, in a Θ(m)-length block of T, the cost of encoding all k-error occurrences and their respective edit sequences is asymptotically no greater than the cost of encoding one!

We also establish a new lower bound proving that our protocol is optimal for edit retrieval.

Theorem 1.3.

Fix integers n,m,k with nmk>0 and an input alphabet Σ with 𝟶Σ and |Σ|2. Consider an encoding that, for each fragment T[i..j) with δE(P,T[i..j))k, allows to reconstruct an edit sequence P[Uncaptioned image]T[i..j) and the corresponding edit information. Such an encoding must use Ω(n/mklog(|Σ|m/k)) bits for P=𝟶m and some TΣn.

Our Techniques.

On a very high level, in [13], the text T is first partitioned into 𝒪(n/m) partially overlapping blocks, each of length 𝒪(m) and such that each k-error occurrence of P in T is fully contained in some block. For each such block, the encoding contains:

  1. 1.

    a set S of 𝒪(logm) k-error occurrences of P in T, each stored together with an optimal edit sequence using 𝒪(klog(m|Σ|/k)) bits;

  2. 2.

    the Lempel–Ziv LZ77 [25] compressed representation of a collection of fragments of T selected based on S. The total number of LZ77 phrases is proportional to the total cost of k-error occurrences in S, so they can be encoded using 𝒪(klogmlog(m|Σ|/k)) bits.

Overall, this yields an encoding cost of 𝒪(klogmlog(m|Σ|/k)) bits per block and 𝒪(n/mklogmlog(m|Σ|/k)) bits for the entire text. The underlying construction is relatively complex, relying on recent insights relating edit distance to compressibility [4, 12] via the so-called self-edit distance. Nevertheless, our key improvement is simple to describe at a high level: In (1), we partition the i-th k-error occurrence into Θ(2i) pieces and store the edit information only for the “cheapest” piece, incurring only ki=𝒪(k/2i) edits, for a total of 𝒪(k) instead of 𝒪(klogm). The fragments in (2) are defined essentially the same way and, thanks to the decreased total cost in (1), they can be encoded in 𝒪(klog(m|Σ|/k)) bits.

Generalizing the relevant concepts to capture pieces of P requires several delicate steps, which we discuss in Section 3. Moreover, our approach breaks for k=o(logm) since 0-error pieces still need a Θ(logm)-bit representation, which becomes a bottleneck when |S|ω(k). In that case, through the structural characterization of Charalampopoulos, Kociumaka, and Wellnitz [5], the existence of ω(k) occurrences implies that P and the relevant part of T are at edit distance 𝒪(k) from highly periodic strings. We then use this rigid structure to show that just three 𝒪(k)-error occurrences of P in T can play the role of S in (1).

2 Preliminaries

Sets.

For integers i,j, we write [i..j] to denote the set {i,,j} and [i..j) to denote the set {i,,j1}; we define the sets (i..j] and (i..j) similarly.

For a set S of integers and a parameter k>0, we also define S/k{s/k:sS}.

Strings.

An alphabet Σ is a set of characters. We write X=X[ 0]X[ 1]X[n1]Σn to denote a string of length |X|=n over Σ. For a position i[ 0..n), we say that X[i] is the i-th character of X. A string Y is a substring of another string X if Y=X[i]X[j1] holds for some integers 0ij|X|. In this case, we say that there is an (exact) occurrence of Y starting at position i in X. The occurrence is a fragment of X denoted X[i..j); formally, the fragment can be interpreted as a tuple (X,i,j) consisting of a (reference to) X and the two positions i and j. We may also write X[i..j1], X(i1..j1], or X(i1..j) for the fragment X[i..j). A prefix of a string X is a fragment of the form X[ 0..j), and a suffix of a string X is a fragment of the form X[i..|X|).

For two strings A and B, we write AB for their concatenation. We write Ak for the concatenation of k0 copies of the string A. Moreover, A is an infinite string (indexed with non-negative integers) formed as the concatenation of an infinite number of copies of A.

An integer p[ 1..n] is a period of a string XΣn if we have X[i]=X[i+p] for all i[ 0..np). In this case, we also say that the string X[ 0..p) is a string period of X. In other words, a string P is a string period of a string X if X is a prefix of P and |P||X|. The period of a non-empty string X, denoted per(X), is the smallest period of X. A non-empty string X is periodic if per(X)|X|/2.

Periodicity Lemma.

For completeness, we restate Fine and Wilf’s Periodicity Lemma [10].

Lemma 2.1 (Periodicity Lemma [10]).

If p,q are periods of a string X of length |X|p+qgcd(p,q), then gcd(p,q) is a period of X.

Edit Distance and Alignments.

The edit distance (Levenshtein distance [21]) between two strings X and Y, denoted by δE(X,Y), is the minimum number of character insertions, deletions, and substitutions required to transform X into Y. Formally, we first define an alignment between string fragments.

Definition 2.2 ([6, Definition 2.1]).

A sequence 𝒜=(xi,yi)i=0 is an alignment of X[x..x) onto Y[y..y), denoted by 𝒜:X[x..x)[Uncaptioned image]Y[y..y), if it satisfies (x0,y0)=(x,y), (xi+1,yi+1){(xi+1,yi+1),(xi+1,yi),(xi,yi+1)} for i[ 0..), and (x,y)=(x,y). Moreover, for i[ 0..):

  • If (xi+1,yi+1)=(xi+1,yi), we say that 𝒜 deletes X[xi].

  • If (xi+1,yi+1)=(xi,yi+1), we say that 𝒜 inserts Y[yi].

  • If (xi+1,yi+1)=(xi+1,yi+1), we say that 𝒜 aligns X[xi] to Y[yi]. If also X[xi]=Y[yi], then 𝒜 matches X[xi] and Y[yi]; otherwise, 𝒜 substitutes X[xi] with Y[yi].

The cost of an alignment 𝒜 of X[x..x) onto Y[y..y), denoted by cost(𝒜) or δE𝒜(X[x..x),Y[y..y)), is the total number of characters that 𝒜 inserts, deletes, or substitutes. The edit distance δE(X,Y) is the minimum cost of an alignment of X[ 0..|X|) onto Y[ 0..|Y|). An alignment of X onto Y is optimal if its cost is equal to δE(X,Y).

Given an alignment 𝒜:X[x..x)[Uncaptioned image]Y[y..y) and a fragment X[x¯..x¯) contained in X[x..x), we write 𝒜(X[x¯..x¯)) for the fragment Y[y¯..y¯) of Y[y..y) that 𝒜 aligns against X[x¯..x¯). As insertions and deletions may render this definition ambiguous, we set

y¯min{y^:(x¯,y^)𝒜}andy¯{yif x¯=x,min{y^:(x¯,y^)𝒜}otherwise.

This particular choice satisfies the following decomposition property.

Observation 2.3 ([6, Fact 2.2]).

For an alignment 𝒜:X[Uncaptioned image]Y and a decomposition X=X1Xt into t fragments, Y=𝒜(X1)𝒜(Xt) is a decomposition into t fragments with δE𝒜(X,Y)=i=1tδE𝒜(Xi,𝒜(Xi)). If 𝒜 is optimal, then δE(X,Y)=i=1tδE(Xi,𝒜(Xi)).

We use the following edit information notion to encode alignments.

Definition 2.4 (Edit information of an alignment).

For an alignment (xi,yi)i=0=𝒜:X[x..x)[Uncaptioned image]Y[y..y), the edit information is the set of 4-tuples 𝖤X,Y(𝒜)={(xi,𝖼𝗑i:yi,𝖼𝗒i):i[ 0..) and 𝖼𝗑i𝖼𝗒i}, where

𝖼𝗑i={X[xi]if xi+1=xi+1,εotherwise;and𝖼𝗒i={Y[yi]if yi+1=yi+1,εotherwise.

By monotonicity of the alignment, the order of the tuples (xi,𝖼𝗑i:yi,𝖼𝗒i) with respect to i coincides with their lexicographic order by (xi,yi) and by (yi,xi).

Observe that, given two strings X and Y, the endpoints x,x,y,y, and the edit information 𝖤X,Y(𝒜) of an alignment 𝒜:X[x..x)[Uncaptioned image]Y[y..y), we are able to fully reconstruct 𝒜. Indeed, each tuple of 𝖤X,Y(𝒜) specifies a non-matching operation, whereas all pairs of 𝒜 before the first tuple, between consecutive tuples, and after the last tuple must be matches. Moreover, given the characters of X[x..x) and the edit information 𝖤X,Y(𝒜), one can recover the characters of Y[y..y). Indeed, the tuples of 𝖤X,Y(𝒜) reveal all characters of Y[y..y) created by insertions and substitutions, while the remaining characters of Y[y..y) correspond to matches and can therefore be copied from X[x..x).

Pattern Matching with Edits.

In the context of two strings P (referred to as the pattern) and T (referred to as the text), along with a positive integer k (referred to as the threshold), we say that T[t..t) is a k-error occurrence of P in T if δE(P,T[t..t))k holds.

3 Upper Bound: Proof Overview

In this section, we provide an overview of the proof of Theorem 1.1111This paper provides an overview of the full version [16].. To this end, we fix two strings PΣm and TΣn, and a positive threshold k. Throughout this section, we assume that k=o(m), n2m2k, and P has k-error occurrences as a prefix and as a suffix of T. In [13, Claim 4.31222All references to numbers of theorems, lemmas, and definitions of [13] refer to their full version [14].], a standard block-splitting argument is employed to demonstrate that a protocol using 𝒪(klogmlog(m|Σ|)) bits for this specific case is sufficient to achieve 𝒪(n/mklogmlog(m|Σ|)) bits in general. We improve the former communication bound to 𝒪(klog(m|Σ|/k)) bits and a similar proof to [13, Claim 4.31] to drop the assumptions.

The remainder of this section is structured as follows. In Section 3.1, we provide a concise overview of the proof from [13], focusing specifically on the components we adapt to achieve our improvements. Subsequently, in Section 3.2, we outline our improved construction.

3.1 Previous Encoding

3.1.1 The Graph 𝐆𝑺 and the Induced Periodic Structure

The main ingredient of the encoding of [13] is a set S of 𝒪(logm) alignments of P onto fragments of T with cost at most k each. The starting point of [13] is to analyze how much information such a set of alignments carries, in order to better understand how one should choose which alignments to include and what additional information is needed to fully encode OcckE(P,T). To enable this analysis, the set S is associated with a graph 𝐆S, which we call the inference graph.

Definition 3.1 ([13, Definition 4.1]).

Let S be a set of alignments 𝒳:P[p..p)[Uncaptioned image]T[t..t). We define the undirected graph 𝐆S=(V,E) as follows. The vertex set V contains

  1. 1.

    |P| vertices representing characters of P;

  2. 2.

    |T| vertices representing characters of T; and

  3. 3.

    one special vertex .

The edge set E contains the following edges for each alignment 𝒳S.

  1. 1.

    {P[x],} for every character P[x] that 𝒳 deletes;

  2. 2.

    {,T[y]} for every character T[y] that 𝒳 inserts;

  3. 3.

    {P[x],T[y]} for every pair of characters P[x] and T[y] that 𝒳 aligns.

We say that an edge {P[x],T[y]} is black if 𝒳 matches P[x] and T[y]. All other edges are red.

A connected component of 𝐆S is red if it contains at least one red edge; otherwise, the connected component is black. We denote the number of black components with bc(𝐆S).

Note that all vertices contained in black components correspond to characters of P and T. Moreover, all characters of a single black component are the same, because the presence of a black edge indicates that some alignment in S matches the two corresponding characters.

The inference graph 𝐆S is represented implicitly via the edit information 𝖤P,T(𝒳) for each alignment 𝒳:P[p..p)[Uncaptioned image]T[t..t) in S. In [13] we naively use the fact that 𝒪(klog(m|Σ|)) bits suffice to encode this information; here, we provide a (slightly) more efficient encoding argument that is required to obtain our tight results for small alphabets.

Lemma 3.2.

Let S be a set of alignments 𝒳:P[p..p)[Uncaptioned image]T[t..t). The set {𝖤P,T(𝒳):𝒳S} together with the starting/ending points for each 𝒳S can be encoded using

𝒪(|S|logm+𝒳S:cost(𝒳)>0cost(𝒳)log(m|Σ|cost(𝒳))) bits.

This information, together with the bit encoding of n=|T| and m=|P|, suffices to fully reconstruct the complete edge set of 𝐆S and the color of each edge. Moreover, this information suffices to identify the character σΣ for every node in a red component.

Proof.

For each 𝒳S with cost(𝒳)>0, the elements in 𝖤P,T(𝒳) are monotone in their first and third components. Using a “stars and bars” encoding, these components take 𝒪(log(m+cost(𝒳)cost(𝒳))) bits. If cost(𝒳)k=o(m), this simplifies to 𝒪(cost(𝒳)log(m/cost(𝒳))). The second and fourth components are encoded separately using 𝒪(cost(𝒳)log|Σ|) bits. For each 𝒳S with cost(𝒳)=0 we only need to store the endpoints using 𝒪(logm) bits each.

Finally, for every character in P and T within a red component, there exists a path of black edges (possibly of length zero) connecting that character to one incident to a red edge. Since black edges connect identical characters, the character value is invariant along this path. Because we explicitly store all characters incident to red edges, we can deduce the character at the origin of any such path.

Lemma 3.2 provides an encoding that reveals all characters contained in red components of in the inference graph 𝐆S. Thus, the case bc(𝐆S)=0 is easy as we can then fully retrieve P and T.

Consequently, we assume bc(𝐆S)>0 for the rest of the section, as this is the remaining case. Even though one cannot learn the characters in black components via the edit information 𝖤P,T(𝒳) for each alignment 𝒳:P[p..p)[Uncaptioned image]T[t..t) in S (and storing all of them would be prohibitive), one can still infer which character belongs to which component.

The key observation of [13] is that black components are extremely structured and appear in a periodic fashion. To make this structure more formal, we define two strings, T|S and P|S, obtained by retaining only the characters that belong to black connected components.

Definition 3.3 ([13, Definition 4.3]).

Let T|S and P|S denote the subsequences of T and P, respectively, consisting of the characters contained in black components of 𝐆S. We denote the lengths of T|S and P|S by nS and mS, respectively.

The first structural observation is that the black edges of the inference graph 𝐆S induced by a single alignment 𝒳S correspond to an exact occurrence of P|S in T|S.

Lemma 3.4 ([13, Claim 4.5]).

Let 𝒳:P[Uncaptioned image]T[y..y)S, and define y𝒳,y𝒳[ 0..nS] as the number of characters of T|S contained in T[ 0..y) and T[ 0..y), respectively. Then, we have P|S=T|S[y𝒳..y𝒳), and 𝒳 induces edges between P|S[p] and T|S[y𝒳+p] for every p[ 0..|P|S|), and no other edges incident to characters of P|S or T|S.

Many overlapping exact occurrences induce periods of the pattern; thus, in [13] we enforce the following condition on S to ensure the induced exact matchings overlap.

Definition 3.5 ([13, Definition 4.2]).

We say S encloses T if |T|2|P|2k and there exist two alignments 𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿S such that 𝒳𝗉𝗋𝖾𝖿 aligns P with a prefix of T and 𝒳𝗌𝗎𝖿 aligns P with a suffix of T, or equivalently (0,0)𝒳𝗉𝗋𝖾𝖿 and (|P|,|T|)𝒳𝗌𝗎𝖿.

Given this condition on S, we show that not only are P|S and T|S periodic, but even the membership of their characters in black components follows a periodic structure.

Lemma 3.6 ([13, Lemma 4.4]).

If S encloses T, then, for every c[ 0..bc(𝐆S)), there is a black connected component with node set {P|S[i]:ibc(𝐆S)c}{T|S[i]:ibc(𝐆S)c}, that is, a black connected component containing all characters of P|S and T|S appearing at positions congruent to c modulo bc(𝐆S). Moreover, the last characters of P|S and T|S are contained in the same black connected component, that is, |T|S|bc(𝐆S)|P|S|.

Lemma 3.6 allows us to define the following quantities related to the periodic structure:

  • For c[ 0..bc(𝐆S)), we define the c-th black connected component as the black connected component containing P|S[c] and set mc:=(mSc)/bc(𝐆S) and nc:=(nSc)/bc(𝐆S) as the number of characters in P and T, respectively, that belong to the c-th black connected component.

  • For c[ 0..bc(𝐆S)) and j[ 0..mc), we define πjc[ 0..m) as the position of P|S[c+jbc(𝐆S)] in P. Similarly, for c[ 0..bc(𝐆S)) and i[ 0..nc), we define τic[ 0..n) as the position of T|S[c+ibc(𝐆S)] in T. Note that, for any c[ 0..bc(𝐆S)), the characters {T[τic]}i=0nc1{P[πjc]}j=0mc1 are exactly those in the c-th black component. Consequently, they are all identical.

3.1.2 Constructing 𝑺 and the Encoding

In [13], based on S and a weight w=𝒪(k|S|), we identify a subset of black components CS[ 0..bc(𝐆S)) so that the characters P[π0c] with cCS belong to fragments of T whose LZ77 parses consist of w=𝒪(k|S|) phrases in total. The construction ensures several desirable properties specified below. This is the most technical component of [13], and it is not significantly affected by our modifications, so we omit deeper insights here.

These desirable properties concern all fragments T[t..t) such that if we were to align P onto T[t..t), then π00 would be close enough to τi0 for some i[ 0..n0). More formally:

Definition 3.7 ([13, Definition 4.28]).

We say that S captures T[t..t) if S encloses T and either bc(𝐆S)=0 or |τi0tπ00|w+3k holds for some i[ 0..n0).

For all such T[t..t), the information carried by S and CS is sufficient to infer whether δE(P,T[t..t))k and, if so, provide the exact distance and infer the edit sequence.

Theorem 3.8 ([13, Corollary 4.30]).

Let S be a set of k-edit alignments of P onto fragments of T such that S encloses T and bc(𝐆S)>0. Construct P# and T# by replacing, for every cCS, every character in the c-th black component with a unique character #c.

If S captures all k-error occurrences, then

  1. 1.

    δE(P,T[t..t))=δE(P#,T#[t..t)) and 𝖤P,T(𝒳)=𝖤P#,T#(𝒳) for all optimal alignments 𝒳:P[Uncaptioned image]T[t..t) of cost at most k.

  2. 2.

    δE(P,T[t..t))δE(P#,T#[t..t)) for all integers 0ttn.

Theorem 3.8 makes sure that one can encode the desired information for all captured k-error occurrences. For those that are not captured, the following result is shown in [13].

Lemma 3.9 ([13, Lemma 4.27]).

Let 𝒴:P[Uncaptioned image]T[t..t) be an alignment of cost at most k. If |τi0tπ00|>w+2k holds for every i[ 0..n0m0], then there is no c[ 0..bc(𝐆S)) such that 𝒴 aligns P[π0c] with T[τic] for some i[ 0..nc).

An alignment 𝒴 as in Lemma 3.9 satisfies bc(𝐆S{𝒴})bc(𝐆S)/2, since each black component becomes red or is merged with another black component. Thus, adding 𝒴 to S allows for significant progress towards bc(𝐆S)=0. Altogether, the construction proceeds as follows.

  • In the beginning, we set S={𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿}.

  • While S does not capture all k-error occurrences, select an uncaptured k-error occurrence T[t..t) and add to S an optimal alignment 𝒴:P[Uncaptioned image]T[t..t).

  • Return the edit information 𝖤P,T(𝒳) for alignments 𝒳S, encoded using Lemma 3.2, and the set {(c,P[π0c]):cCS}, encoded using the LZ77-compressed fragments of P.

Since the second step can be executed at most 𝒪(logm) times before S captures all k-error occurrences, the entire encoding requires 𝒪(klogmlog(m|Σ|/k)) bits. To decode, it suffices to retrieve the inference graph 𝐆S from the edit information and, using the encoding of CS as described in Theorem 3.8, construct P# and T#, which preserve the solution to the original problem.

3.2 Improved Encoding

To tighten our upper bound on the communication complexity, we revisit the step where an uncaptured alignment 𝒴 is added to S. For this, we strengthen the conclusion of Lemma 3.9, which applies only to the initial character P[π0c] of each black component c[ 0..bc(𝐆S)). In the full version version, we prove that 𝒴 cannot match any characters within the same black component.

Lemma 3.10.

Let 𝒴:P[Uncaptioned image]T[t..t) be an optimal alignment with cost(𝒴)k. If CS[ 0..bc(𝐆S)) and |τi0tπ00|>w+2k holds for every i[ 0..n0), then there is no c[ 0..bc(𝐆S)) such that 𝒴 aligns P[πjc] with T[τic] for some i[ 0..nc) and j[ 0..mc).

Lemma 3.10 brings us to the main idea of our improvement: rather than adding an entire uncaptured alignment 𝒴 to S, it suffices to add only the subset of edges required to merge every black component with another component. More specifically, if we decompose P into

P[ 0..π00)(j=0m02P[πj0..πj+10))P[πm010..|P|),

then at least one of the middle m01 fragments of P in this decomposition carries at most 𝒪(k/m0) edits in 𝒴. So ideally, we would like to add to S and the corresponding edges 𝒴 restricted to this fragment. If we managed to show that the periodic structure is preserved already by adding such a subset, then not only bc(𝐆S) would halve, but also the parameter m0 would at least double in each iteration. Hence, with this new strategy, we could hope that the total cost of alignment or partial alignment in S is bounded by i=1k/2i=𝒪(k).

On a technical level, the proof is delicate: The selection of the fragment P[πj0..πj+10), as described so far, depends on 𝒴 and the black components defined relative to S. However, the structure of the black components changes when going from S to S𝒴, and the fragment is not guaranteed to contain the same black components as in S𝒴. Thus, for our proof of correctness, we need to be careful to get rid of any such undesired dependence on the future.

Finally, we note that Lemma 3.10 is not a strict strengthening of Lemma 3.9, as it introduces three additional conditions: now i[ 0..n0) instead of i[ 0..n0m0], 𝒴 is optimal, and that CS[ 0..bc(𝐆S)). We observe that all conditions are relatively harmless. Since we are only concerned with capturing all optimal alignments, the first two conditions are perfectly acceptable. Moreover, whenever CS=[ 0..bc(𝐆S)), we have P=P# and T=T#, where P# and T# are defined as in Theorem 3.8. At this point, we know that P and T already have a sufficiently cheap encoding to be sent directly.

3.2.1 Redefining 𝑺

Let us start making our improvement formal. To this end, we relax the definition of S: we let S be a set of alignments of fragments of P onto fragments of T with cost at most k, and we denote by cost(S)𝒳Scost(𝒳) the sum of all costs of the alignments contained in S.

Based on such S, we can define the inference graph 𝐆S as before and argue that all characters in red components follow from the edit information for all 𝒳S. We conclude again that bc(𝐆S)=0 is easy, and we assume that bc(𝐆S)>0 in this (sub)section. We also define P|S and T|S as before. Lemma 3.4 can be extended quite easily to fragments of P; see the full version.

Lemma 3.11.

Let 𝒳:P[x..x)[Uncaptioned image]T[y..y)S and define y𝒳,y𝒳[ 0..nS] as the number of characters of T|S contained in T[ 0..y) and T[ 0..y). Similarly, define x𝒳,x𝒳[ 0..mS] as the number of characters of P|S contained in P[ 0..x) and P[ 0..x).

Then, P|S[x𝒳..x𝒳)=T|S[y𝒳..y𝒳), and 𝒳 induces edges between P|S[x𝒳+p] and T|S[y𝒳+p] for p[ 0..x𝒳x𝒳), and no other edges incident to characters of P|S or T|S.

We next give the new condition on S needed to observe the periodic structure.

Definition 3.12.

We say S encloses T if |T|2|P|2k and S can be written as

S={𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿,𝒜1,,𝒜a,1,,b}

such that the following conditions hold:

  1. (a)

    𝒳𝗉𝗋𝖾𝖿 aligns the whole P with a prefix of T;

  2. (b)

    𝒳𝗌𝗎𝖿 aligns the whole P with a suffix of T;

  3. (c)

    𝒜1,,𝒜a align the whole P with fragments of T.

We say S is degenerate if y𝒳𝗉𝗋𝖾𝖿=y𝒳𝗌𝗎𝖿=y𝒜1==y𝒜a=0. Moreover, we define

g0{mSif S is degenerate,gcd{y𝒳𝗉𝗋𝖾𝖿,y𝒳𝗌𝗎𝖿,y𝒜1,,y𝒜a}otherwise.

For each i[ 1..b], we define gigcd(gi1,yixi). We further say that S succinctly encloses T if the following condition holds for every i[ 1..b].

  1. (d)

    The alignment i:P[xi..xi)[Uncaptioned image]T[yi..yi) satisfies xixigi1+1.

If S encloses T, then each of the alignments 𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿,𝒜1,,𝒜a aligns the entire string P with a fragment of T, and the edges they induce connect to all vertices of P|S. Consequently, we have x𝒳𝗉𝗋𝖾𝖿=x𝒳𝗌𝗎𝖿=x𝒜1==x𝒜a=0 and x𝒳𝗉𝗋𝖾𝖿=x𝒳𝗌𝗎𝖿=x𝒜1==x𝒜a=mS. Moreover, note that whenever S succinctly encloses T and S is degenerate, then b=0, since the condition (d) cannot hold for i=1 if b>0.

We can also prove something more about the exact matching induced by 𝒳𝗉𝗋𝖾𝖿 and 𝒳𝗌𝗎𝖿.

Lemma 3.13.

If S encloses T, then y𝒳𝗉𝗋𝖾𝖿=0, y𝒳𝗌𝗎𝖿=nSmS, and nS2mS.

The proof, provided for completeness in the full version, is the same as [13, Claim 4.6]. This is because the argument relies exclusively on the alignments 𝒳𝗉𝗋𝖾𝖿 and 𝒳𝗌𝗎𝖿 (and not any i).

Lemma 3.13 also implies that, when S is degenerate, then mS=nS and every alignment 𝒳{𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿,𝒜1,,𝒜a} induces in 𝐆S an edge {P|S[p],T|S[t]} iff p=t. In this case, for each p[ 0..mS), there is a black component consisting solely of P|S[p] and T|S[p].

The following generalization of the inference graph 𝐆S lets us work with graphs of more predictable structure.

Definition 3.14.

Suppose S encloses T. We define the sets S0{𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿,𝒜1,,𝒜a} and Si{𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿,𝒜1,,𝒜a,1,,i} for i[ 1..b].

Moreover, for i[ 0..b], we define the graph 𝐆Si obtained from 𝐆S as follows. We remove vertices (along with their incident edges) that are not in black components in 𝐆S (so only vertices in P|S and T|S remain), and we additionally remove any edge that is not induced by alignments in the set Si.

We now proceed to argue this definition successfully preserves the periodic structure.

Lemma 3.15.

Suppose S encloses T. Then, the following hold for each i[ 0..b).

  1. 1.

    If condition (d) in Definition 3.12 holds for all indices in [ 1..i], then, for each c[ 0..gi), the graph 𝐆Si has a connected component with node set Cci{P|S[j]:jgic}{T|S[j]:jgic}, where j ranges over [ 0..mS) and [ 0..nS), respectively.

    In particular, in 𝐆S=𝐆Sb, for every c[ 0..bc(𝐆S)), there exists a black connected component with node set {P|S[i]:ibc(𝐆S)c}{T|S[i]:ibc(𝐆S)c}.

  2. 2.

    The last characters of P|S and T|S are in the same component of 𝐆Si.

Proof.

We first prove (1). If S is degenerate (and hence b=0), we have already argued that 𝐆S=𝐆S0=𝐆S0 has the claimed structure. Therefore, we assume that S is not degenerate.

Let us assign a unique label $C to each component C of 𝐆Si and define strings Pcc and Tcc of length mS and nS, respectively, as follows. For i[ 0..mS), set Pcc[i]=$C, where C is the component of 𝐆Si containing P|S[i]. Similarly, for i[ 0..nS), set Tcc[i]=$C, where C is the black connected component of 𝐆Si containing T|S[i].

By Lemmas 3.11 and 3.13, {0,|Tcc||Pcc|}{y𝒳𝗉𝗋𝖾𝖿,y𝒳𝗌𝗎𝖿,y𝒜1,,y𝒜a}Occ(Pcc,Tcc). Since |Tcc|2|Pcc|, we can use the following claim already proved in [13].

Claim 3.16 ([13, Lemma 3.2]).

Consider a non-empty pattern P and a text T with |T|2|P|+1. If {0,|T||P|}Occ(P,T), that is, P occurs both as a prefix and as a suffix of T, then gcd(Occ(P,T)) is a period of T.

It follows that gcd(Occ(Pcc,Tcc)) is a period of Tcc. Hence, gcd{y𝒳𝗉𝗋𝖾𝖿,y𝒳𝗌𝗎𝖿,y𝒜1,,y𝒜a} is a period of both Tcc and its prefix Pcc, and thus g0 is a period of both Tcc and Pcc.

We now prove by induction that Tcc and Pcc have period gi for all i[ 0..b]. The base case i=0 follows from the argument above. For i>0, assuming Tcc and Pcc have period gi1, we observe that the condition on i ensures xixigi1+1gi1. The following new claim allows us to conclude that Tcc and Pcc have period gi=gcd(gi1,yixi).

Claim 3.17.

Consider strings P and T with a common string period Q. If there are matching fragments P[x..x)=T[y..y) of length xx|Q|, then P and T also have a common period gcd(|Q|,yx).

Proof.

The claim is trivial if y=x, so we henceforth assume otherwise. By symmetry between the fragments, we can also assume without loss of generality that y>x. Since P and T are prefixes of Q, we have Q[x..x+|Q|)=Q[y..y+|Q|). Observe that yx is a period of Q: for each i0, we indeed have Q[i]=Q[x+(ix)mod|Q|]=Q[y+(ix)mod|Q|]=Q[i+yx]. From the Periodicity Lemma (Lemma 2.1) applied for Q[ 0..|Q|+yx), we conclude that gcd(|Q|,yx) is a period of Q[ 0..|Q|+yx) and hence of Q. As a divisor of |Q|, it is also a common period of Q, P, and T.

Consequently, for each c[ 0..gi), the set Cci belongs to a single connected component of 𝐆Si. It remains to prove gi=bc(𝐆Si). We do this by demonstrating that no edge of 𝐆Si leaves Cci. Note that Lemma 3.11 further implies that every edge incident to P|S or T|S connects P|S[p] with T|S[t] such that t=p+(y𝒳x𝒳) for some 𝒳S and p[x𝒳..x𝒳). In particular, tgip, so P|S[p]Cci holds if and only if T|S[t]Cci.

As for (2), since Pcc is a suffix of Tcc, the last characters of P|S and T|S are connected.

3.2.2 New Iterative Construction of 𝑺

For the new construction of S, we use the following key lemma.

Lemma 3.18.

Suppose S encloses T and condition (d) of Definition 3.12 holds up to i (inclusive) for some i[ 0..b1) (if i=0, then this statement is void). Further, suppose that there exists an integer z such that all characters of P|Si[zbc(𝐆Si)..(z+2)bc(𝐆Si)) are in the pre-image of i+1. Then, either bc(𝐆S)=0 or condition (d) also holds for i+1.

Proof.

By Lemma 3.15(1), in the inference graph 𝐆Si, for each c[ 0..bc(𝐆Si)), there is a black component with node set {P|Si[j]:jbc(𝐆Si)c}{T|Si[j]:jbc(𝐆Si)c}. Consider the graph 𝐆Si. This graph is identical to 𝐆Si except that the components that become red in 𝐆S are removed. Let R[ 0..bc(𝐆Si)) index these removed components.

If R=[ 0..bc(𝐆Si)), then bc(𝐆S)=0, and the proof is complete. Otherwise, we proceed as follows. Choose an arbitrary r[ 0..bc(𝐆Si))R, and consider the fragment

P|Si[zbc(𝐆Si)+r..(z+1)bc(𝐆Si)+r]P|Si[zbc(𝐆Si)..(z+2)bc(𝐆Si)),

whose characters, by our assumption, are also contained in the pre-image of i+1. The characters P|Si[zbc(𝐆Si)+r] and P|Si[(z+1)bc(𝐆Si)+r] belong to the same black component of 𝐆Si. Since rR, these characters survive in 𝐆Si and correspond to some characters P|S[p] and P|S[p]. Note that we must have |pp|gi as, by Lemma 3.15(1), characters in the same component of 𝐆Si lie at least gi positions apart. Thus, |P|S[p..p]|gi+1. Since P|S[p..p] is contained in P|S[xi+1..xi+1), we get xi+1xi+1gi+1.

Algorithm 1 Construction of S that succinctly encloses T.

Finally, we can provide the new construction of S. As in [13], we construct, from S, a set CS of black components and a parameter w based on a weight function covering S. We use the following facts (proved in the full version):

  1. 1.

    Lemma 3.10 still holds, and after replacing “enclosure” with “succinct enclosure” in Definition 3.7, Theorem 3.8 still holds.

  2. 2.

    We can improve the bound for encoding {(c,T[τ0c]):cCS} from 𝒪(wlogm) additional bits (on top of the edit information of S) to 𝒪((w+k)log(1+m|Σ|/(w+k))) bits.

  3. 3.

    All of this is possible with w=𝒪(cost(S)) instead of w=𝒪(k|S|).

Lemma 3.19.

Suppose that n2m2k and that there are k-error occurrences of P appearing as both a prefix and a suffix of T. Then, Algorithm 1 computes a set S of size |S|=𝒪(min(logm,|OcckE(P,T)/k|)) and cost(S)=𝒪(k) such that the following hold:

  1. 1.

    S succinctly encloses T,

  2. 2.

    CS=[ 0..bc(𝐆S)) or S captures all k-error occurrences of P in T,

  3. 3.

    the set {𝖤P,T(𝒳):S𝒳:P[p..p)[Uncaptioned image]T[t..t)} together with all starting/ending points of the alignments in S can be encoded in 𝒪(klog(m|Σ|/k)+|S|logm) bits.

Proof sketch (full proof in the full version).

In Algorithm 1, we maintain the invariant that S succinctly encloses T at the start of every iteration of the loops in Lines 2 and 7.

This invariant holds at the beginning as we set S{𝒳𝗉𝗋𝖾𝖿,𝒳𝗌𝗎𝖿}. We proceed by adding at most two alignments 𝒜 to S corresponding to uncaptured k-error occurrences in the loop of Line 2. After the -th iteration, one of bc(𝐆S)=0, CS=[ 0..bc(𝐆S)), or sP2 holds, where sP is the minimum number of characters of P in a black component of 𝐆S. Indeed, by Lemma 3.10, after adding 𝒴 to S, each black component of 𝐆S either becomes red or is merged with another component. Hence, unless bc(𝐆S{𝒴})=0, every black component of 𝐆S{𝒴} contains at least two black components of 𝐆S, so sP at least doubles.

Adding the two alignments of the form 𝒜 ensures that m0sP22=4 when we enter the loop at Line 7 (so that m03 in Line 11, and the quantifier j[ 0..m02) is well-defined). There, we start adding alignments of the form to S. Each time we add such an alignment, we use Lemmas 3.18 and 3.10 to prove that S still succinctly encloses T. Using a similar argument as before, bc(𝐆S)=0, CS=[ 0..bc(𝐆S)), or m0sP22+ at the end of the -th iteration. Since sPm, this ensures that the loop finishes after 𝒪(logm) iterations and |S|=𝒪(logm). When it does, all k-error occurrences are captured.

Next, we argue why the bound on cost(S) holds. Since each of the alignments 𝒴j can overlap only with at most two others, we obtain that the sum of the costs of the alignments 𝒴j for all j[ 0..m02) is at most 2k. Consequently, in the -th iteration the cost of the alignment 𝒴j selected at Line 11 is at most cost(𝒴j)2k/(m02)2k/(2+12)k/21. Thus, cost(S)4k+k=1𝒪(logm)1216k=𝒪(k).

Lastly, we give the bound on the encoding size. The endpoints of the alignments 𝒳S can be encoded in 𝒪(|S|logm) bits. On top of that, by Lemma 3.2, the edit information {𝖤P,T(𝒳):𝒳S} can be encoded in space asymptotically bounded as follows, using S+{𝒳S:cost(𝒳)>0} and the monotonicity of xlog(k/x) for 0<xk/e:

𝒳S+cost(𝒳)log(m|Σ|cost(𝒳))=cost(S)log(m|Σ|k)+𝒳S+cost(𝒳)log(kcost(𝒳))klog(m|Σ|k)+𝒪(k)+k=1𝒪(logm)121𝒪(klog(m|Σ|k)) bits.

To show |S|=𝒪(|OcckE(P,T)/k|), we argue in the full proof that the alignments 𝒴 in Line 10 start at least k positions away from each other.

Now, following the approach in [13], we can encode the set {𝖤P,T(𝒳):𝒳S} and the pairs {(c,T[τ0c]):cCS} using 𝒪(klog(m|Σ|/k)+|S|logm) bits. Decoding would then proceed via an appropriately modified version of Theorem 3.8. Unfortunately, this falls short of proving Theorem 1.1 because the |S|logm term might dominate the encoding size; consequently, we must develop an alternative for cases where this term is prohibitively large.

Workaround.

Note that |S|logm=𝒪(|S|logmlogm)𝒪(logmlogmlogm), so |S|logm=𝒪(klogmk) holds as long as klogm or |S|=𝒪(k). Thus, the critical scenario arises when k<logm and |S|=ω(k). Not coincidentally, we also proved |S|=𝒪(|OcckE(P,T)/k|) in Lemma 3.19, which lets us derive |OcckE(P,T)/k|=ω(k) in this case. This condition characterizes one of the two fundamental structural results for PMwE from [5]: in a setting (almost) identical to ours, there is a primitive string Q with |Q|m/128k such that the edit distance between P and a prefix of Q does not exceed 2k. Moreover, [5, Theorem 5.2] upper-bounds the distance between T and a prefix of Q by 6k. The subsequent characterization in [5, Section 5] implies that, for every k-error occurrence T[t..t) of P, there exists an exact occurrence of Q in P that is matched perfectly both in the alignment from P to the prefix of Q and in the alignment from P via T[t..t) to a fragment of Q.

Our workaround is to initialize S so that the periodic structure of 𝐆S essentially coincides with the structure induced by Q. Namely, every black component corresponds to a position r[ 0..|Q|) and consists of all characters of P and T that the alignments with prefixes of Q match with characters of the form Q[r+j|Q|] for j0. By Lemma 3.10 and the above characterization of k-error occurrences, this guarantees that all k-error occurrences are captured by S. To achieve such 𝐆S, we include in S alignments for the two approximate occurrences of P as a prefix and a suffix of T, and a third 14k-edit alignment that, for every j, aligns the jth copy of Q in P with the (j+1)th copy of Q in T. This yields the following lemma proved in the full version.

Lemma 3.20.

Suppose that n3/2m28k, that there are k-error occurrences of P appearing as both a prefix and a suffix of T, and that there is a primitive string Q with |Q|m/128k and δE(P,Q)2k. Then, we can construct a set S of at most three 14k-edit alignments of P onto fragments of T such that, when the notions of succinctly enclosing and capturing are interpreted with threshold 14k, all of the following hold:

  1. 1.

    S succinctly encloses T,

  2. 2.

    S captures all k-error occurrences of P in T,

  3. 3.

    the set {𝖤P,T(𝒳):S𝒳:P[p..p)[Uncaptioned image]T[t..t)} together with all starting/ending points of the alignments in S can be encoded in 𝒪(klog(m|Σ|/k)) bits.

4 Lower Bound

Theorem 1.3. [Restated, see original statement.]

Fix integers n,m,k with nmk>0 and an input alphabet Σ with 𝟶Σ and |Σ|2. Consider an encoding that, for each fragment T[i..j) with δE(P,T[i..j))k, allows to reconstruct an edit sequence P[Uncaptioned image]T[i..j) and the corresponding edit information. Such an encoding must use Ω(n/mklog(|Σ|m/k)) bits for P=𝟶m and some TΣn.

Proof.

Set pn/m and TS0S1Sp1𝟶npm, where S0,,Sp1Σm are strings that contain at most k characters from Σ{𝟶} and all remaining characters are equal to 𝟶. Clearly, δE(P,T[qm..(q+1)m))k for every q[ 0..p). Moreover, for every q[ 0..p), there is a unique optimal alignment 𝒜q:P[Uncaptioned image]T[qm..(q+1)m) that performs substitutions exactly in the positions where the non-zero characters appear (it is not difficult to verify that any deletions or insertions would increase the cost). Thus, 𝒜q allows us to fully recover Sq from the edit information 𝖤P,T(𝒜q), and consequently T can be fully recovered.

Finally, the number of possibilities for each block Sq is i=0k(mi)(|Σ|1)i. If km/2, then this quantity is at least (mk)(|Σ|1)k, and the standard estimate (mk)=2Ω(klog(m/k)) yields (mk)=2Ω(klog(|Σ|m/k)) for |Σ|=2 and (mk)(|Σ|1)k(mk)(|Σ|/2)k=2Ω(klog(|Σ|m/k)) for |Σ|>2. Otherwise, the sum contains the term (mm/2)(|Σ|1)m/2. If |Σ|=2, then this term is simply (mm/2)2m/m2Ω(m)2Ω(mlog|Σ|). If |Σ|>2, then the term is at least (Σ1)m/2(|Σ|/2)m/2=2Ω(mlog|Σ|). In either case, we have 2Ω(mlog|Σ|)2Ω(klog(|Σ|m/k)) when m/2<km. Therefore, the number of possibilities for T is 2Ω(n/mklog(|Σ|m/k)).

References

  • [1] Arturs Backurs and Piotr Indyk. Edit distance cannot be computed in strongly subquadratic time (unless SETH is false). SIAM Journal on Computing, 2018. doi:10.1137/15M1053128.
  • [2] Sudatta Bhattacharya and Michal Koucký. Streaming k-edit approximate pattern matching via string decomposition. In 50th International Colloquium on Automata, Languages, and Programming, ICALP 2023, 2023. doi:10.4230/LIPIcs.ICALP.2023.22.
  • [3] Philip Bille, Gad M. Landau, Rajeev Raman, Kunihiko Sadakane, Srinivasa Rao Satti, and Oren Weimann. Random access to grammar-compressed strings and trees. SIAM Journal on Computing, 2015. doi:10.1137/130936889.
  • [4] Alejandro Cassis, Tomasz Kociumaka, and Philip Wellnitz. Optimal algorithms for bounded weighted edit distance. In 64th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2023, 2023. doi:10.1109/FOCS57990.2023.00135.
  • [5] Panagiotis Charalampopoulos, Tomasz Kociumaka, and Philip Wellnitz. Faster approximate pattern matching: A unified approach. In 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, 2020. doi:10.1109/FOCS46700.2020.00095.
  • [6] Panagiotis Charalampopoulos, Tomasz Kociumaka, and Philip Wellnitz. Faster pattern matching under edit distance: A reduction to dynamic puzzle matching and the seaweed monoid of permutation matrices. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2022, 2022. doi:10.1109/FOCS54457.2022.00072.
  • [7] Panagiotis Charalampopoulos, Tomasz Kociumaka, and Philip Wellnitz. Pattern matching under weighted edit distance, 2025. Accepted at FOCS 2025. doi:10.48550/arXiv.2510.17752.
  • [8] Raphaël Clifford, Tomasz Kociumaka, and Ely Porat. The streaming k-mismatch problem. In 30th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, 2019. doi:10.1137/1.9781611975482.68.
  • [9] Richard Cole and Ramesh Hariharan. Approximate string matching: A simpler faster algorithm. SIAM Journal on Computing, 2002. doi:10.1137/S0097539700370527.
  • [10] Nathan J. Fine and Herbert S. Wilf. Uniqueness theorems for periodic functions. Proceedings of the American Mathematical Society, 1965. doi:10.1090/S0002-9939-1965-0174934-9.
  • [11] Paweł Gawrychowski and Damian Straszak. Beating 𝒪(nm) in approximate LZW-compressed pattern matching. In 24th International Symposium on Algorithms and Computation, ISAAC 2013, LNCS, 2013. doi:10.1007/978-3-642-45030-3_8.
  • [12] Daniel Gibney, Ce Jin, Tomasz Kociumaka, and Sharma V. Thankachan. Near-optimal quantum algorithms for bounded edit distance and Lempel-Ziv factorization. In 35th ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, 2024. doi:10.1137/1.9781611977912.11.
  • [13] Tomasz Kociumaka, Jakob Nogler, and Philip Wellnitz. On the communication complexity of approximate pattern matching. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, 2024. doi:10.1145/3618260.3649604.
  • [14] Tomasz Kociumaka, Jakob Nogler, and Philip Wellnitz. On the communication complexity of approximate pattern matching, 2024. doi:10.48550/arXiv.2403.18812.
  • [15] Tomasz Kociumaka, Jakob Nogler, and Philip Wellnitz. Near-optimal-time quantum algorithms for approximate pattern matching. In Yossi Azar and Debmalya Panigrahi, editors, Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2025, New Orleans, LA, USA, January 12-15, 2025, pages 517–534. SIAM, 2025. doi:10.1137/1.9781611978322.15.
  • [16] Tomasz Kociumaka, Jakob Nogler, and Philip Wellnitz. The communication complexity of pattern matching with edits revisited, 2026. arXiv:2604.15601.
  • [17] Tomasz Kociumaka, Ely Porat, and Tatiana Starikovskaya. Small-space and streaming pattern matching with k edits. In 62nd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2021, 2021. doi:10.1109/FOCS52979.2021.00090.
  • [18] Michal Koucký and Michael Saks. Almost linear size edit distance sketch. In 56th Annual ACM Symposium on the Theory of Computing; STOC 2024, 2024.
  • [19] Gad M. Landau and Uzi Vishkin. Fast string matching with k differences. Journal of Computer and System Sciences, 1988. doi:10.1016/0022-0000(88)90045-1.
  • [20] Gad M. Landau and Uzi Vishkin. Fast parallel and serial approximate string matching. Journal of Algorithms, 1989. doi:10.1016/0196-6774(89)90010-2.
  • [21] Vladimir Iosifovich Levenshtein. Binary codes capable of correcting deletions, insertions and reversals. Doklady Akademii Nauk SSSR, 1965.
  • [22] Peter H. Sellers. The theory and computation of evolutionary distances: Pattern recognition. Journal of Algorithms, 1980. doi:10.1016/0196-6774(80)90016-4.
  • [23] Tatiana Starikovskaya. Communication and streaming complexity of approximate pattern matching. In 28th Annual Symposium on Combinatorial Pattern Matching, CPM 2017, 2017. doi:10.4230/LIPIcs.CPM.2017.13.
  • [24] Alexander Tiskin. Threshold approximate matching in grammar-compressed strings. In Prague Stringology Conference, PSC 2014, 2014. URL: http://www.stringology.org/event/2014/p12.html.
  • [25] Jacob Ziv and Abraham Lempel. A universal algorithm for sequential data compression. IEEE Transactions on Information Theory, 1977. doi:10.1109/TIT.1977.1055714.