Computing k-th Lyndon Word and Decoding Lexicographically Minimal de Bruijn Sequence
نویسندگان
چکیده
Let Σ be a finite ordered alphabet. We present polynomialtime algorithms for computing the k-th in the lexicographic order Lyndon word of a given length n over Σ and counting Lyndon words of length n that are smaller than a given word. We also use the connections between Lyndon words and minimal de Bruijn sequences (theorem of Fredricksen and Maiorana) to develop the first polynomial time algorithm for decoding minimal de Bruijn sequence of any rank n (it determines the position of an arbitrary word of length n within the de Bruijn sequence). Our tools mostly rely on combinatorics on words and automata theory.
منابع مشابه
Efficient Ranking of Lyndon Words and Decoding Lexicographically Minimal de Bruijn Sequence
We give efficient algorithms for ranking Lyndon words of length n over an alphabet of size σ. The rank of a Lyndon word is its position in the sequence of lexicographically ordered Lyndon words of the same length. The outputs are integers of exponential size, and complexity of arithmetic operations on such large integers cannot be ignored. Our model of computations is the word-RAM, in which bas...
متن کاملPractical algorithms to rank necklaces, Lyndon words, and de Bruijn sequences
We present practical algorithms for ranking k-ary necklaces and Lyndon words of length n. The algorithms are based on simple counting techniques. By repeatedly applying the ranking algorithms, both necklaces and Lyndon words can be efficiently unranked. Then, explicit details are given to rank and unrank the length n substrings of the lexicographically smallest de Bruijn sequence of order n.
متن کاملA simple shift rule for k-ary de Bruijn sequences
A k-ary de Bruijn sequence of order n is a cyclic sequence of length k in which each k-ary string of length n appears exactly once as a substring. A shift rule for a de Bruijn sequence of order n is a function that maps each length n substring to the next length n substring in the sequence. We present the first known shift rule for k-ary de Bruijn sequences that runs in O(1)-amortized time per ...
متن کاملProperties of the Extremal Infinite Smooth Words
Smooth words are connected to the Kolakoski sequence. We construct the maximal and the minimal infinite smooth words, with respect to the lexicographical order. The naive algorithm generating them is improved by using a reduction of the De Bruijn graph of their factors. We also study their Lyndon factorizations. Finally, we show that the minimal smooth word over the alphabet {1, 3} belongs to t...
متن کاملGeneralizing the Classic Greedy and Necklace Constructions of de Bruijn Sequences and Universal Cycles
We present a class of languages that have an interesting property: For each language L in the class, both the classic greedy algorithm and the classic Lyndon word (or necklace) concatenation algorithm provide the lexicographically smallest universal cycle for L. The languages consist of length n strings over {1, 2, . . . , k} that are closed under rotation with their subset of necklaces also be...
متن کامل