
Porat and Porat [FOCS 2009] described the first efficient randomised algorithm for the pattern matching problem in the streaming model, using 𝒪(logmlogn) bits for a text of length n and a pattern of length m, against the lower bound of (log n) bits. Since then, multiple papers considered many variants of this problem, but with virtually no progress on the lower bounds side, leaving a logarithmic gap in the space complexity for the very basic variant. We discuss a modification of the lower bound of Ergun, Jowhari, and Saglam [RANDOM 2010] against a restricted class of algorithms for the streaming pattern matching problem. Then, we show that the standard approach via communication complexity does not suffice to obtain a better lower bound, by presenting an efficient communication protocol.
The Damerau–Levenshtein distance between two strings is the minimum number of insertions, deletions, substitutions, and adjacent transpositions required to transform one string into the other. Unlike the standard Levenshtein distance, it accounts for the common typing error of adjacent character swaps. When edits are restricted so that no substring is edited more than once, existing algorithms for Levenshtein distance can be extended with relatively minor changes to support transpositions. However, in the unrestricted setting (i.e., edits may overlap or interact arbitrarily), the problem becomes significantly more complex, and existing techniques no longer apply directly. In this work, we show that even in the unrestricted setting, the Damerau–Levenshtein distance can be computed efficiently. We present two algorithms that extend the classic O(n + k^2) edit-distance frameworks of Myers (Algorithmica ’86) and Landau and Vishkin (JCSS ’88), adapting them to accommodate unrestricted transpositions. The first algorithm runs in O(σ n + k^2) time, where σ is the alphabet size. The second achieves O(n + k^2 log n) time for integer alphabets. Here, n is the length of the input strings and k is the distance threshold. Experimental results show that our algorithms achieve substantial speedups over k-independent methods when k is small.
A cover (or quasiperiod) of a string S is a shorter string C such that every position of S is contained in some occurrence of C as a substring. The notion of cover was introduced by Apostolico and Ehrenfeucht over 30 years ago [Theor. Comput. Sci. 1993] and it has received significant attention from the combinatorial pattern matching community. In this note, we show how to efficiently test whether S admits a cover. We design an algorithm that, given n=|S| , q ∈ [n] , ϵ∈ℝ^+ , and oracle access to S, uses 𝒪(q^3 ϵ ^-1log q ) letter queries to test whether S has a cover C of length at most q or is ϵ -far from having such a cover. Our insights also lead to a simple streaming algorithm for short covers.
The Longest Common Subsequence (LCS) problem is a classical problem in computer science. Numerous variants of the LCS problem have been proposed due to its significance. In this paper, we study a new variant of the LCS problem that combines two settings: the input strings are compressed using run-length encoding (RLE) and the solution must consist of matching substrings of length k, as in the LCSk problem. We propose two algorithms to address the challenges of the klength substring constraint. The first requires O(nM + mN) timewhere n and m are the lengths of the uncompressed input strings, N and M are the lengths of the compressed input strings. The second requires O(N + M + min{n + |C| log log m, m + |C| log log n}) time, where |C| denotes the number of required k-length matching substrings between the input strings.
We introduce new entropy measures for tries taking into account the distribution of the edge labels. To do that, we study the combinatorial problem of counting the number of tries with a given symbol distribution. We provide an alternative proof for the closed formula counting the tries belonging to such a class. This formula allows us to directly define the worst-case entropy for the aforementioned set of tries. Moreover, we propose a new notion of k-th order empirical entropy for tries and we show that the relationships between these two entropy measures are similar to those between the corresponding well-known measures for strings. Contrary to the label entropy [FOCS ’05], which was designed to compress the labels of a node-labeled ordered tree, our empirical entropy considers not only the labels, but the entire structure of the trie. Finally, we relate our empirical entropy to the repetitiveness measure r proposed by Prezza [SODA ’21], which counts the number of runs in the XBWT of the trie. We show that these measures exhibit relations analogous to those of their string counterparts.
The matching statistics of a string S relative to another string R is a sequence of |S| integer pairs, (p_i,ℓ _i) , one for each position in S, such that S[i..i+ℓ _i] = R[p_i..p_i+ℓ _i] and ℓ _i is the length of the longest substring starting at position i in S that also occurs in R. Matching statistics have a variety of applications in sequence processing, such as approximate pattern matching, suffix sorting, compressed indexing, data compression, and multiple sequence alignment. Often the strings involved are large, making efficient computation paramount. In this paper we describe algorithms for matching statistics computation on massively parallel architectures, namely, graphics processing units (GPUs). We show that when implemented carefully these methods are much faster than CPU-based algorithms.
We introduce a new compressed representation of sparse Boolean matrices that enjoys reference locality properties. We build on an existing representation based on LOUDS-deployed cardinal trees, and design one based instead on DFUDS. While this brings various complications, we show that the resulting matrix representation is considerably faster to carry out sums and multiplications, with speedups of up to 60%.
A binary word is Sturmian if the occurrences of each letter are balanced, in the sense that in any two factors of the same length, the difference between the number of occurrences of the same letter is at most 1. In digital geometry, Sturmian words correspond to discrete approximations of straight line segments in the Euclidean plane. The Dorst-Smeulders coding, introduced in 1984, is a 4-tuple of integers that uniquely represents a Sturmian word w, enabling its reconstruction using |w| modular operations, making it highly efficient in practice. In this paper, we present a linear-time algorithm that, given a binary input word w, computes the Dorst-Smeulders coding of its longest Sturmian prefix. This forms the basis for computing the Dorst-Smeulders coding of an arbitrary binary word w, which is a minimal decomposition (in terms of the number of factors) of w into Sturmian words, each represented by its Dorst-Smeulders coding. This coding could be leveraged in compression schemes where the input is transformed into a binary word composed of long Sturmian segments. Although the algorithm is conceptually simple and can be implemented in just a few lines of code, it is grounded in a deep analysis of the structural properties of Sturmian words.
A string w is said to be a minimal unique substring (MUS) of a string T if w occurs exactly once in T, and any proper substring of w occurs at least twice in T. It is known that the number of MUSs in a string T of length n is at most n, and that the set (T) of all MUSs in T can be computed in O(n) time [Ilie and Smyth, 2011]. Let (T,i) denote the set of MUSs that contain a position i in a string T. In this short paper, we present matching (√(n)) upper and lower bounds for the number |(T,i)| of MUSs containing a position i in a string T of length n.
The Nyldon factorization is a string factorization that is a non-decreasing product of Nyldon words. Nyldon words and Nyldon factorizations are recently defined combinatorial objects inspired by the well-known Lyndon words and Lyndon factorizations. In this paper, we investigate the Nyldon factorization of several words. First, we fully characterize the Nyldon factorizations of the (finite) Fibonacci and the (finite) Thue-Morse words. Moreover, we show that there exists a non-decreasing product of Nyldon words that is a factorization of the infinite Thue-Morse word.
String consensus problems aim at finding a string that minimizes some given distance with respect to an input set of strings. In particular, in the Closest String problem, we are given a set of strings of equal length and a radius d. The goal is to find a new string that differs from each input string by at most d substitutions. We study a generalization of this problem where, in addition to substitutions, swaps of adjacent characters are also permitted, each operation incurring a unit cost. Amir et al. showed that this generalized problem is NP-hard, even when only swaps are allowed. In this paper, we show that it is FPT with respect to the parameter d. Moreover, we investigate a variant in which the goal is to minimize the sum of distances from the output string to all input strings. For this version, we present a polynomial-time algorithm.
Recent advances in biological sequence indexing have enabled the efficient querying of sequence presence across massive genomic data repositories. While presence queries have become tractable at petabyte scale, retrieving quantitative information such as sequence abundances remains a significant algorithmic challenge. Existing abundance-aware indexes are mostly static, difficult to scale, and often trade off completeness, precision, or updatability. We describe a novel discrete abundance index designed for scalability, dynamic updates, and tunable precision. We combine an inverted index with probabilistic and exact structures to support fast, memory-efficient construction and precise high-throughput queries across thousands of RNA datasets. Our experiments demonstrate that our method REINDEER2 achieves one to two orders of magnitude speedup in construction compared to existing methods, while maintaining comparable or better memory use. Despite using approximate structures for scalability, REINDEER2 achieves sub-1 github.com/Yohan-HernandezCour bevoie/REINDEER2
In pattern matching on strings, a locate query asks for an enumeration of all the occurrences of a given pattern in a given text. The r-index [Gagie et al., 2018] is a recently presented compressed self index that stores the text and auxiliary information in compressed space. With some modifications, locate queries can be answered in optimal time [Nishimoto Tabei, 2021], which has recently been proven relevant in practice in the form of Move-r [Bertram et al., 2024]. However, there remains the practical bottleneck of evaluating function for every occurrence to report. This motivates enhancing the index by a compressed representation of the suffix array featuring efficient random access, trading off space for faster answering of locate queries [Puglisi Zhukova, 2021]. In this work, we build upon this idea considering two suitable compression schemes: Relative Lempel-Ziv [Kuruppu et al., 2010], improving the work by Puglisi and Zhukova, and LZ-End [Kreft Navarro, 2010], introducing a different trade-off where compression is better than for Relative Lempel-Ziv at the cost of slower access times. We enhance both the r-index and Move-r by the compressed suffix arrays and evaluate locate query performance in an experiment. We show that locate queries can be sped up considerably in both the r-index and Move-r, especially if the queried pattern has many occurrences. The choice between two different compression schemes offers new trade-offs regarding index size versus query performance.
A border of a string is a non-empty proper prefix of the string that is also a suffix. A string is unbordered if it has no border. The longest unbordered factor is a fundamental notion in stringology, closely related to string periodicity. This paper addresses the longest unbordered factor problem: given a string of length n, the goal is to compute its longest factor that is unbordered. While recent work has achieved subquadratic and near-linear time algorithms for this problem, the best known worst-case time complexity remains O(n log n) [Kociumaka et al., ISAAC 2018]. In this paper, we investigate the problem in the context of compressed string processing, particularly focusing on run-length encoded (RLE) strings. We first present a simple yet crucial structural observation relating unbordered factors and RLE-compressed strings. Building on this, we propose an algorithm that solves the problem in O(m^1.5log^2 m) time and O(m log^2 m) space, where m is the size of the RLE-compressed input string. To achieve this, our approach simulates a key idea from the O(n^1.5)-time algorithm by [Gawrychowski et al., SPIRE 2015], adapting it to the RLE setting through new combinatorial insights. When the RLE size m is sufficiently small compared to n, our algorithm may show linear-time behavior in n, potentially leading to improved performance over existing methods in such cases.
A closed string u is either of length one or contains a border that occurs only as a prefix and as a suffix in u and nowhere else within u. In this paper, we present a fast 𝒪(nlog n) time algorithm to compute all 𝒪(n^2) closed substrings by introducing a compact representation for all closed substrings of a string w[1..n], using only 𝒪(n log n) space. We also present a simple and space-efficient solution to compute all maximal closed substrings (MCSs) using the suffix array ( ) and the longest common prefix ( ) array of w[1..n]. Finally, we show that the exact number of MCSs ( M(f_n) ) in a Fibonacci word f_n , for n ≥ 5 , is ≈( 1 + 1/ϕ ^2) F_n ≈ 1.382 F_n , where ϕ is the golden ratio.
The worst-case additive sensitivity of a string repetitiveness measure c is defined to be the largest difference between c(w) and c(w') , where w is a string of length n and w' is a string that can be obtained by performing a single-character edit operation on w. We present O(√(n)) upper bounds for the worst-case additive sensitivity of the smallest string attractor size γ and the smallest bidirectional scheme size b , which match the known lower bounds (√(n)) for γ and b [Akagi et al. 2023]. Further, we present matching upper and lower bounds for the worst-case additive sensitivity of the Lempel-Ziv family - (n^2/3) for LZSS and LZ-End, and (n) for LZ78.
Let w be a string of length n. The problem of counting factors crossing a position - Problem 64 from the textbook “125 Problems in Text Algorithms” [Crochemore, Leqroc, and Rytter, 2021], asks to count the number 𝒞(w,k) (resp. 𝒩(w,k) ) of distinct substrings in w that have occurrences containing (resp. not containing) a position k in w. The solutions provided in their textbook compute 𝒞(w,k) and 𝒩(w,k) in O(n) time for a single position k in w, and thus a direct application would require O(n^2) time for all positions k = 1, … , n in w. Their solution is designed for constant-size alphabets. In this paper, we present new algorithms which compute 𝒞(w,k) in O(n) total time for general ordered alphabets, and 𝒩(w,k) in O(n) total time for linearly sortable alphabets, for all positions k = 1, … , n in w.
In this work, we tackle a natural variation of the String Matching Problem on the case of a dynamic pattern, that is, given a static text T and a pattern P, we want to support character insertions and deletions to the pattern, and after each operation compute how many times it occurs in the text. We show a simple and practical algorithm using Suffix Arrays that achieves 𝒪(log |T|) update time, after 𝒪(|T|) preprocessing time. We show how to extend our solution to support substring deletion, transposition (moving a substring to another position of the pattern), and copy (copying a substring and pasting it in a specific position), in the same time complexities. Our solution can also be extended to support an online text (inserting characters to one end of the text), maintaining the same amortized bounds.
A suffixient set is a novel combinatorial object that captures the essential information of repetitive strings in a way that, provided with a random access mechanism, supports various forms of pattern matching. In this paper, we study the size χ of the smallest suffixient set as a repetitiveness measure: we place it between known measures and study its sensitivity to various string operations.
When building Burrows-Wheeler Transforms (BWTs) of truly huge datasets, prefix-free parsing (PFP) can use an unreasonable amount of memory. In this paper we show how if a dataset can be broken down into small datasets that are not very similar to each other -- such as collections of many copies of genomes of each of several species, or collections of many copies of each of the human chromosomes -- then we can drastically reduce PFP's memory footprint by building the BWTs of the small datasets and then merging them into the BWT of the whole dataset.