跳至主導覽 跳至搜尋 跳過主要內容

Generating a Cyclic 2-Gray Code for Lucas Words in Constant Amortized Time

研究成果: Conference contribution同行評審

摘要

We present a two-stage algorithm to generate a cyclic 2-Gray code for Lucas words. The first step involves a simple recursive algorithm that generates a cyclic 2-Gray code for Fibonacci words starting with a 0, which are strings that avoid p consecutive ones starting with a 0. Then, by considering the first and last blocks of 1s and concatenating lists of Fibonacci words starting with a 0 of different length n, we construct the first cyclic 2-Gray code for Lucas words. By using a dynamic programming approach, our algorithm generates each Lucas word and Fibonacci word in constant amortized time per string, using O(n3) space. The algorithm can also be modified to produce the first efficient algorithm for generating q-decreasing sequences in constant amortized time per string, also using O(n3) space. Our work extends a previous result on generating a cyclic 2-Gray code for q-decreasing sequences [Conference proceeding: International Conference and Workshop on Algorithms and Computation (WALCOM), LNCS 14549:91-102, 2024].

原文English
主出版物標題36th Annual Symposium on Combinatorial Pattern Matching, CPM 2025
編輯Paola Bonizzoni, Veli Makinen
發行者Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
ISBN(電子)9783959773690
DOIs
出版狀態Published - 10 6月 2025
事件36th Annual Symposium on Combinatorial Pattern Matching, CPM 2025 - Milan, Italy
持續時間: 17 6月 202519 6月 2025

出版系列

名字Leibniz International Proceedings in Informatics, LIPIcs
331
ISSN(列印)1868-8969

Conference

Conference36th Annual Symposium on Combinatorial Pattern Matching, CPM 2025
國家/地區Italy
城市Milan
期間17/06/2519/06/25

引用此