Fixed-Density Necklaces and Lyndon Words in Cool-lex Order
نویسندگان
چکیده
This paper creates a simple Gray code for fixed-density binary necklaces and Lyndon words. The Gray code is simultaneously a left-shift Gray code and a 2-transposition Gray code and is cyclic with these properties. It also has the advantage of using canonical representations (lexicographically minimum rotations) yielding the first known Gray code for Lyndon words ordered by density. This work solidifies the framework that produces loopless Gray code algorithms for generating combinations [15, 16], balanced parentheses and binary trees [17], and multiset permutations [23] in cool-lex order. A primary application of our new fixeddensity Gray code is in the first explicit construction of fixed-weight de Bruijn cycles [24]. In particular, this paper presents a simple O(n)-time implementation that allows each bit of the de Bruijn cycles to be generated in amortized O(1)-time using O(n) memory.
منابع مشابه
A Gray code for fixed-density necklaces and Lyndon words in constant amortized time
This paper develops a constant amortized time algorithm to produce a cyclic cool-lex Gray code for fixed-density binary necklaces, Lyndon words, and pseudo-necklaces. It is the first Gray code for these objects that achieves this time bound. The algorithm is applied: (i) to develop a constant amortized time cyclic Gray code for necklaces, Lyndon words, and pseudo-necklaces ordered by density an...
متن کاملA CAT Gray code for fixed-density necklaces and Lyndon words
This paper develops a constant amortized time algorithm to produce the cyclic cool-lex Gray code for fixed-density binary necklaces, Lyndon words, and pseudo-necklaces. It is the first Gray code for these objects that achieves this time bound. In addition to Gray code order, the algorithms can be easily modified to output the strings in co-lex order.
متن کاملBinary bubble languages and cool-lex order
A bubble language is a set of binary strings with a simple closure property: The first 01 of any string can be replaced by 10 to obtain another string in the set. Natural representations of many combinatorial objects are bubble languages. Examples include binary string representations of k-ary trees, unit interval graphs, linear-extensions of B-posets, binary necklaces and Lyndon words, and fea...
متن کامل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.
متن کاملFinding the largest fixed-density necklace and Lyndon word
We present anO(n) time algorithm for finding the lexicographically largest fixed-density necklace of length n. Then we determine whether or not a given string can be extended to a fixed-density necklace of length n in O(n) time. Finally, we give an O(n) algorithm that finds the largest fixed-density necklace of length n that is less than or equal to a given string. The efficiency of the latter ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009