All or Nothing, Water Walk, and Remembered Length are pencil puzzles that involve constructing a continuous loop on a rectangular grid under specific constraints. In this paper, we analyze their computational complexity using the T-metacell framework developed by Tang and MIT Hardness Group. We establish that the puzzles are NP-complete by providing reductions; the first two puzzles, from the problem of finding a Hamiltonian cycle in a maximum-degree-3 spanning subgraph of a rectangular grid graph, and the last, from the problem of finding a Hamiltonian cycle in a required-edge directed rectangular grid graph.
翻译:“全或无”、“水行迹”与“记忆长度”均属于笔谜类型,其目标是在特定约束条件下于矩形网格上构建一条连续回路。本文采用Tang与MIT Hardness Group所提出的T-metacell框架,对这些谜题的计算复杂性进行了分析。通过构造归约,我们证明了这些谜题均属于NP完全问题:前两个谜题的归约源于在矩形网格图的最大度数为3的生成子图中寻找哈密顿回路问题;最后一个谜题的归约则源于在带必需边的有向矩形网格图中寻找哈密顿回路问题。