具有常数延迟和常数辅助空间的格雷码
Gray Codes With Constant Delay and Constant Auxiliary Space
AI总结:
本文提出了两种算法,能够在常数时间内枚举所有二进制单词,同时保持常数辅助空间,分别在带机和双端队列机等新计算模型中实现。
摘要:
我们给出了第一个两个算法,以枚举所有二进制单词$\{0,1\}^\ell$(类似于格雷码)的同时确保延迟和辅助空间独立于$\ell$,即每个单词的常数时间延迟和额外的$\ell$位存储当前单词的常数内存。我们的算法是在两种新的计算模型:带机和双端队列机中给出的。我们还研究了更受限制的模型,队列机和栈机,并证明它们无法在常数辅助空间下枚举所有二进制单词,即使有无限制的延迟。一个带机是存储当前二进制单词在单个长度为$\ell$的工作带上的图灵机(该带永不增加),不使用其他带。该机器有一个头,必须通过编辑带来达到所有可能的$\{0,1\}^\ell$单词,并输出它们(在单位时间,通过进入特殊输出状态),没有重复。因此,带机通过定义使用常数辅助空间(除了头位置)。我们构造了一个带机,以实现此任务,具有连续输出之间的常数延迟,因此该机器实现所谓的耐偏斜准格雷码。然后我们构造了一个更复杂的带机,实现格雷码。双端队列机将当前二进制单词存储在长度为$\ell$的双端队列中,并存储一个常数大小的内部状态。它的工作方式如同带机,除了通过在两端进行push和pop操作来修改双端队列的内容。因此,再次,双端队列机通过定义使用常数辅助空间。我们构造了双端队列机,以在常数延迟下枚举所有$\{0,1\}^\ell$的单词。在这个模型中的主要技术挑战是正确检测枚举何时结束。
英文摘要:
We give the first two algorithms to enumerate all binary words of $\{0,1\}^\ell$ (like Gray codes) while ensuring that the delay and the auxiliary space is independent from $\ell$, i.e., constant time for each word, and constant memory in addition to the $\ell$ 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 $\ell$ (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\}^\ell$, 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 $\ell$, 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\}^\ell$ with constant-delay. The main technical challenge in this model is to correctly detect when enumeration has finished.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。