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$. 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. We construct a tape machine that achieves this task with constant delay between consecutive outputs, which implies 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. 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. Our work on deque machine is also motivated by other contexts in which endpoint modifications occur naturally. In particular, our result is a first step towards enumerating walks in directed graphs with constant delay and constant auxiliary space, addressing a core task in modern graph database query processing.


翻译:我们首次提出了两种算法,能够枚举所有$\{0,1\}^\ell$中的二进制字(类似于格雷码),同时确保延迟和辅助空间与$\ell$无关,即每个字的处理时间为常数,且除存储当前字的$\ell$位内存外,仅需常数内存。我们的算法基于两种新的计算模型:磁带机与双端队列机。我们还研究了更受限的模型——队列机与栈机,并证明即使允许无限制延迟,它们也无法在常数辅助空间下枚举所有二进制字。磁带机是一种将当前二进制字存储在长度为$\ell$的单条工作磁带上的图灵机。该机器具有单个磁头,必须通过编辑磁带来遍历$\{0,1\}^{\ell}$中的所有可能字,并输出它们(通过进入特殊输出状态以单位时间完成),且不允许重复。我们构建了一种磁带机,能够在连续输出间实现恒定延迟,这意味着该机器实现了所谓的容偏斜准格雷码。随后,我们构建了一种更复杂的磁带机来实现标准格雷码。双端队列机将当前二进制字存储在长度为$\ell$的双端队列上,并维护一个常数大小的内部状态。其操作方式类似于磁带机,但通过对队列端点执行压入和弹出操作来修改队列内容。我们构建了能够以恒定延迟枚举所有$\{0,1\}^\ell$中字的双端队列机。该模型中的主要技术挑战在于正确检测枚举何时完成。我们对双端队列机的研究也受到其他自然涉及端点修改的应用场景的推动。特别地,我们的成果是朝着以恒定延迟和恒定辅助空间枚举有向图中路径迈出的第一步,这直接关联现代图数据库查询处理中的核心任务。

0
下载
关闭预览

相关内容

【NeurIPS2023】大型语言模型是零样本的时间序列预测者
专知会员服务
47+阅读 · 2023年10月13日
《分布式多智能体强化学习的编码》加州大学等
专知会员服务
55+阅读 · 2022年11月2日
【Code】GraphSAGE 源码解析
AINLP
31+阅读 · 2020年6月22日
高效的文本生成方法 — LaserTagger 现已开源
TensorFlow
30+阅读 · 2020年2月27日
预知未来——Gluon 时间序列工具包(GluonTS)
ApacheMXNet
24+阅读 · 2019年6月25日
R语言时间序列分析
R语言中文社区
12+阅读 · 2018年11月19日
R语言之数据分析高级方法「时间序列」
R语言中文社区
17+阅读 · 2018年4月24日
最新|深度离散哈希算法,可用于图像检索!
全球人工智能
14+阅读 · 2017年12月15日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月21日
VIP会员
相关VIP内容
【NeurIPS2023】大型语言模型是零样本的时间序列预测者
专知会员服务
47+阅读 · 2023年10月13日
《分布式多智能体强化学习的编码》加州大学等
专知会员服务
55+阅读 · 2022年11月2日
相关资讯
【Code】GraphSAGE 源码解析
AINLP
31+阅读 · 2020年6月22日
高效的文本生成方法 — LaserTagger 现已开源
TensorFlow
30+阅读 · 2020年2月27日
预知未来——Gluon 时间序列工具包(GluonTS)
ApacheMXNet
24+阅读 · 2019年6月25日
R语言时间序列分析
R语言中文社区
12+阅读 · 2018年11月19日
R语言之数据分析高级方法「时间序列」
R语言中文社区
17+阅读 · 2018年4月24日
最新|深度离散哈希算法,可用于图像检索!
全球人工智能
14+阅读 · 2017年12月15日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员