TY - GEN
T1 - Gray Codes with Constant Delay and Constant Auxiliary Space
AU - Amarilli, Antoine
AU - David, Claire
AU - Francis, Nadime
AU - Marsault, Victor
AU - Monet, Mikaël
AU - Strozecki, Yann
N1 - Publisher Copyright:
© Antoine Amarilli, Claire David, Nadime Francis, Victor Marsault, Mikaël Monet, and Yann Strozecki.
PY - 2026/7/1
Y1 - 2026/7/1
N2 - We give the first two algorithms to enumerate all binary words of {0, 1}ℓ (like Gray codes) while ensuring that the delay and the auxiliary space is independent from ℓ, i.e., constant time for each word, and constant memory in addition to the ℓ bits storing the current word. Our algorithms are given in two new computational models: tape machines and deque machines. We also study more restricted models, queue machines and stack machines, and show that they cannot enumerate all binary words with constant auxiliary space, even with unrestricted delay. A tape machine is a Turing machine that stores the current binary word on a single working tape of length ℓ (which never increases), using no other tape. The machine has a single head and must edit its tape to reach all possible words of {0, 1}ℓ, and output them (in unit time, by entering special output states), with no duplicates. Hence a tape machine uses constant auxiliary space by definition (up to the head position). We construct a tape machine that achieves this task with constant delay between consecutive outputs, so that the machine implements a so-called skew-tolerant quasi-Gray code. We then construct a more involved tape machine that implements a Gray code. A deque machine stores the current binary word on a double-ended queue of length ℓ, and stores a constant-size internal state. It works as a tape machine, except that it modifies the content of the deque by performing push and pop operations on the endpoints. Hence again a deque machine uses constant auxiliary space by definition. We construct deque machines that enumerate all words of {0, 1}ℓ with constant-delay. The main technical challenge in this model is to correctly detect when enumeration has finished.
AB - We give the first two algorithms to enumerate all binary words of {0, 1}ℓ (like Gray codes) while ensuring that the delay and the auxiliary space is independent from ℓ, i.e., constant time for each word, and constant memory in addition to the ℓ bits storing the current word. Our algorithms are given in two new computational models: tape machines and deque machines. We also study more restricted models, queue machines and stack machines, and show that they cannot enumerate all binary words with constant auxiliary space, even with unrestricted delay. A tape machine is a Turing machine that stores the current binary word on a single working tape of length ℓ (which never increases), using no other tape. The machine has a single head and must edit its tape to reach all possible words of {0, 1}ℓ, and output them (in unit time, by entering special output states), with no duplicates. Hence a tape machine uses constant auxiliary space by definition (up to the head position). We construct a tape machine that achieves this task with constant delay between consecutive outputs, so that the machine implements a so-called skew-tolerant quasi-Gray code. We then construct a more involved tape machine that implements a Gray code. A deque machine stores the current binary word on a double-ended queue of length ℓ, and stores a constant-size internal state. It works as a tape machine, except that it modifies the content of the deque by performing push and pop operations on the endpoints. Hence again a deque machine uses constant auxiliary space by definition. We construct deque machines that enumerate all words of {0, 1}ℓ with constant-delay. The main technical challenge in this model is to correctly detect when enumeration has finished.
KW - Constant auxiliary space
KW - Constant delay
KW - Counter implementation
KW - Deque machines
KW - Enumeration algorithms
KW - Gray code
KW - Linear bounded automata
KW - Tape machine
UR - https://www.scopus.com/pages/publications/105044580534
U2 - 10.4230/LIPIcs.ICALP.2026.160
DO - 10.4230/LIPIcs.ICALP.2026.160
M3 - Conference contribution
AN - SCOPUS:105044580534
T3 - Leibniz International Proceedings in Informatics, LIPIcs
BT - 53rd International Colloquium on Automata, Languages, and Programming, ICALP 2026
A2 - Bhattacharya, Sayan
A2 - Nanongkai, Danupon
A2 - Benedikt, Michael
A2 - Puppis, Gabriele
PB - Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
T2 - 53rd International Colloquium on Automata, Languages, and Programming, ICALP 2026
Y2 - 7 July 2026 through 10 July 2026
ER -