We introduce the Longest Common Circular Factor (LCCF) problem in which, given strings $S$ and $T$ of length $n$, we are to compute the longest factor of $S$ whose cyclic shift occurs as a factor of $T$. It is a new similarity measure, an extension of the classic Longest Common Factor. We show how to solve the LCCF problem in $O(n \log^5 n)$ time.
This very preliminary text is related to “Algorithms on Texts”, also called “Algorithmic Stringology”. It is an extension of the book “125 Problems in Text Algorithms” providing, in the same compact style, more problems with solutions. We refer also to the companions to “Text algorithms” available at http://monge.univ-mlv.fr/ mac/CLR/clr1-20.pdf and at the web page http://125-problems.univ-mlv.fr, where all 150 problems (including the ones presented here) are briefly announced. The selected problems satisfy three criteria: challenging, having short tricky solutions and solvable with only very basic background in stringology. For the basics in stringology we refer to http://monge.univ-mlv.fr/ mac/CLR/clr1-20.pdf.
The article focuses on word (or string) attractors, which are sets of positions related to the text compression efficiency of the underlying word. The article presents two combinatorial algorithms based on Suffix automata or Directed Acyclic Word Graphs. The first algorithm decides in linear time whether a set of positions on the word is an attractor of the word. The second algorithm generates an attractor for a given word in a greedy manner. Although this problem is NP-hard, the algorithm is efficient and produces very small attractors for several well-known families of words.
We design alignment-free techniques for comparing a sequence or word, called a target, against a set of words, called a reference. A target-specific factor of a target T against a reference R is a factor w of a word in T which is not a factor of a word of R and such that any proper factor of w is a factor of a word of R. We first address the computation of the set of target-specific factors of a target T against a reference R, where T and R are finite sets of sequences. The result is the construction of an automaton accepting the set of all considered target-specific factors. The construction algorithm runs in linear time according to the size of T∪ R . The second result consists of the design of an algorithm to compute all the occurrences in a single sequence T of its target-specific factors against a reference R. The algorithm runs in real-time on the target sequence, independently of the number of occurrences of target-specific factors.
We extend the left-to-right Lyndon factorisation of a word to the left Lyndon tree construction of a Lyndon word. It yields an algorithm to sort the prefixes of a Lyndon word according to the infinite ordering defined by Dolce et al. (2019). A straightforward variant computes the left Lyndon forest of a word. All algorithms run in linear time on a general alphabet, that is, in the letter-comparison model.
A Lyndon word is a word that is lexicographically smaller than all of its non-trivial rotations (e.g. ananas is a Lyndon word; banana is not a Lyndon word due to its smaller rotation abanan ). The Lyndon forest (or equivalently Lyndon table) identifies maximal Lyndon factors of a word, and is of great combinatoric interest, e.g. when finding maximal repetitions in words. While optimal linear time algorithms for computing the Lyndon forest are known, none of them work in an online manner. We present algorithms that compute the Lyndon forest of a word in a reverse online manner, processing the input word from back to front. We assume a general ordered alphabet, i.e. the only elementary operations on symbols are comparisons of the form less-equal-greater. We start with a naive algorithm and show that, despite its quadratic worst-case behaviour, it already takes expected linear time on words drawn uniformly at random. We then introduce a much more sophisticated algorithm that takes linear time in the worst case. It borrows some ideas from the offline algorithm by Bille et al. (ICALP 2020), combined with new techniques that are necessary for the reverse online setting. While the back-to-front approach for this computation is rather natural (see Franek and Liut, PSC 2019), the steps required to achieve linear time are surprisingly intricate. We envision that our algorithm will be useful for the online computation of maximal repetitions in words.
A finite word f is Hamming-isometric if for any two words u and v of the same length avoiding f, u can be transformed into v by changing one by one all the letters on which u differs from v, in such a way that all of the new words obtained in this process also avoid f. Words which are not Hamming-isometric have been characterized as words having a border with two mismatches. We derive from this characterization a linear-time algorithm to check whether a word is Hamming-isometric. It is based on pattern matching algorithms with k mismatches. Lee-isometric words over a four-letter alphabet have been characterized as words having a border with two Lee-errors. We derive from this characterization a linear-time algorithm to check whether a word over an alphabet of size four is Lee-isometric.
We show that lengths of shortest covers of all rotations of a length-n string over an integer alphabet can be computed in O ( n ) time in the word-RAM model, thus improving an O ( n log n )-time algorithm from Crochemore et al. ( Theor. Comput. Sci. , 2021). Similarly as Crochemore et al., we use a relation of covers of rotations of a string S to seeds and squares in S 3 . The crucial parameter of a string S is the number ξ ( S ) of primitive covers of all rotations of S . We show first that the time complexity of the algorithm from Crochemore et al. can be slightly improved which results in time complexity Θ( ξ ( S )). However, we also show that in the worst case ξ ( S ) is Ω( | S | log | S | ). This is the main difficulty in obtaining a linear time algorithm. We overcome it and obtain yet another application of runs in strings
The chapter is about data structures for text indexing. They are used as fundamental tools in a large amount of algorithms, represented by special arrays and trees associated with texts. The main data structures related to text algorithmics are Suffix trees and automata, Suffix arrays as well as dictionaries of basic factors. All represent all factors of a text in a compact way. For special words they are of a very specific form. Many problems in this chapter are related to such structures with emphasis on their applications. Also de Bruijn graphs are shown as tools for creating special non-trivial words: dense and perfect words.
String matching is one of the oldest algorithmic techniques, yet still one of the most pervasive in computer science. The past 20 years have seen technological leaps in applications as diverse as information retrieval and compression. This copiously illustrated collection of puzzles and exercises in key areas of text algorithms and combinatorics on words offers graduate students and researchers a pleasant and direct way to learn and practice with advanced concepts. The problems are drawn from a large range of scientific publications, both classic and new. Building up from the basics, the book goes on to showcase problems in combinatorics on words (including Fibonacci or Thue-Morse words), pattern matching (including Knuth-Morris-Pratt and Boyer-Moore like algorithms), efficient text data structures (including suffix trees and suffix arrays), regularities in words (including periods and runs) and text compression (including Huffman, Lempel-Ziv and Burrows-Wheeler based methods).
The article describes the structural and algorithmic relations between Cartesian trees and Lyndon trees. This leads to a uniform presentation of the Lyndon table of a word corresponding to the Next Nearest Smaller table of a sequence of numbers. It shows how to efficiently compute runs, that is, maximal periodicities occurring in a word.
A factor W of a string X is called a cover of X, if X can be constructed by concatenations and superpositions of W. Breslauer (IPL, 1992) proposed a well-known 𝒪(n) -time algorithm that computes the shortest cover of every prefix of a string of length n. We show an 𝒪(n log n) -time algorithm that computes the shortest cover of every cyclic shift of a string and an 𝒪(n) -time algorithm that computes the shortest among these covers. A related problem is the number of different lengths of shortest covers of cyclic shifts of the same string of length n. We show that this number is (log n) .
Internal pattern matching requires one to answer queries about factors of a given string. Many results are known on answering internal period queries, asking for the periods of a given factor. In this paper we investigate (for the first time) internal queries asking for covers (also known as quasiperiods) of a given factor. We propose a data structure that answers such queries in $O(\log n \log \log n)$ time for the shortest cover and in $O(\log n (\log \log n)^2)$ time for a representation of all the covers, after $O(n \log n)$ time and space preprocessing.
We extend the left-to-right Lyndon factorisation of a word to the left Lyndon tree construction of a Lyndon word. It yields an algorithm to sort the prefixes of a Lyndon word according to the infinite ordering defined by Dolce et al. (2019). A straightforward variant computes the left Lyndon forest of a word. All algorithms run in linear time on a general alphabet, that is, in the letter-comparison model.
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. Constant-space string matching in sublinear average time Maxime Crochemore, Leszek Gąsieniec, Wojciech Rytter
Two strings of equal length are called k-Abelian equivalent, if they share the same multi-set of factors of length at most k. Ehlers et al. [JDA, 2015] considered the k-Abelian pattern matching problem, where the task is to find all factors in a text T that are k-Abelian equivalent to a pattern P. They claimed a number of algorithmic results for the off-line and on-line versions of the k-Abelian pattern matching problem. In this paper, we first argue that some of the claimed results by Ehlers et al. [JDA, 2015] contain major errors, and then we present a new algorithm that correctly solves the offline version of the problem within the same bounds claimed by Ehlers et al., in O(n+m) time and O(m) space, where n = |T| and m = |P|. We also show how to correct errors in their online algorithm, and errors in their real-time algorithms for a slightly different problem called the extended k-Abelian pattern matching problem.
In this paper we present a framework for leader election in multi-hop radio networks which yield randomized leader elections taking O(broadcasting time) in expectation, and another which yields algorithms taking fixed time of the order of O(logn)-times broadcasting time. Both succeed with high probability.We show how to implement these frameworks in radio networks without collision detection, and in networks with collision detection (in fact in the strictly weaker beep model). In doing so, we obtain the first optimal expected-time leader election algorithms in both settings, and also improve the worst-case running time in directed networks without collision detection by an O(logn) factor.
Sometimes the difference between two distinct words of the same length cannot be smaller than a certain minimal amount. In particular if two distinct words of the same length are both periodic or quasiperiodic, then their Hamming distance is at least 2. We study here how the minimum Hamming distance dist (x,y) between two words x, y of the same length n depends on their periods. Similar problems were considered in [1] in the context of quasiperiodicities. We say that a period p of a word x is primitive if x does not have any smaller period p' which divides p. For integers p, n ( p≤ n ) we define 𝒫_p(n) as the set of words of length n with primitive period p. We show several results related to the following functions introduced in this paper for p q and n ≥max (p,q) . 𝒟_p,q(n) = min { dist (x,y) : x∈𝒫_p(n), y∈𝒫_q(n) }, N_p,q(h) = max { n : 𝒟_p,q(n)≤ h }.
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. Suffix tree Maxime Crochemore, Thierry Lecroq
Thierry Lecroq合作论文数LITIS EA 4108
Universite de Rouen52
Philippe Bonnet合作论文数IT University of Copenhagen33