Flip-swap languages in binary reflected Gray code order

被引:3
作者
Sawada, Joe [1 ]
Williams, Aaron [2 ]
Wong, Dennis [3 ]
机构
[1] Univ Guelph, Comp & Informat Sci, Guelph, ON, Canada
[2] Williams Coll, Comp Sci, Williamstown, MA 01267 USA
[3] Macao Polytech Univ, Fac Appl Sci, Macau, Peoples R China
基金
加拿大自然科学与工程研究理事会;
关键词
Flip-swap language; Binary reflected Gray code; BRGC; Necklaces; Lyndon words; Dyck words; Gray codes; WORDS; PERMUTATIONS; ALGORITHMS; NECKLACES;
D O I
10.1016/j.tcs.2022.08.024
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
A flip-swap language is a set S of binary strings of length n such that S boolean OR {0(n)} is closed under two operations (when applicable): (1) Flip the leftmost 1; and (2) Swap the leftmost 1 with the bit to its right. Flip-swap languages model many combinatorial objects including necklaces, Lyndon words, prefix normal words, left factors of k-ary Dyck words, lattice paths with at most k flaws, and feasible solutions to 0-1 knapsack problems. We prove that any flip-swap language forms a cyclic 2-Gray code when listed in binary reflected Gray code (BRGC) order. Furthermore, a generic successor rule computes the next string when provided with a membership tester. The rule generates each string in the aforementioned flip-swap languages in O(n)-amortized per string, except for prefix normal words of length nwhich require O(n(1.864))-amortized per string. Our work generalizes results on necklaces and Lyndon words by Vajnovszki (2008) [35]. (c) 2022 Elsevier B.V. All rights reserved.
引用
收藏
页码:138 / 148
页数:11
相关论文
共 44 条
  • [1] Arndt J., 2011, MATTERS COMPUTATIONA
  • [2] Exhaustive generation of combinatorial objects by ECO
    Bacchelli, S
    Barcucci, E
    Grazzini, E
    Pergola, E
    [J]. ACTA INFORMATICA, 2004, 40 (08) : 585 - 602
  • [3] Bernini A, 2015, ACTA INFORM, V52, P573, DOI 10.1007/s00236-015-0225-2
  • [4] LEXICOGRAPHICALLY LEAST CIRCULAR SUBSTRINGS
    BOOTH, KS
    [J]. INFORMATION PROCESSING LETTERS, 1980, 10 (4-5) : 240 - 242
  • [5] An Eades-McKay algorithm for well-formed parentheses strings
    Bultena, B
    Ruskey, F
    [J]. INFORMATION PROCESSING LETTERS, 1998, 68 (05) : 255 - 259
  • [6] Clustered Integer 3SUM via Additive Combinatorics
    Chan, Timothy M.
    Lewenstein, Moshe
    [J]. STOC'15: PROCEEDINGS OF THE 2015 ACM SYMPOSIUM ON THEORY OF COMPUTING, 2015, : 31 - 40
  • [7] COS++, COMB OBJ SERV
  • [8] Cool-lex order and k-ary Catalan structures
    Durocher, Stephane
    Li, Pak Ching
    Mondal, Debajyoti
    Ruskey, Frank
    Williams, Aaron
    [J]. JOURNAL OF DISCRETE ALGORITHMS, 2012, 16 : 287 - 307
  • [9] DUVAL JP, 1983, J ALGORITHM, V4, P363, DOI 10.1016/0196-6774(83)90017-2
  • [10] LOOPLESS ALGORITHMS FOR GENERATING PERMUTATIONS, COMBINATIONS, AND OTHER COMBINATORIAL CONFIGURATIONS
    EHRLICH, G
    [J]. JOURNAL OF THE ACM, 1973, 20 (03) : 500 - 513