All or Nothing and Water Walk 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 both puzzles are NP-complete by providing reductions from the problem of finding a Hamiltonian cycle in a maximum-degree-3 spanning subgraph of a rectangular grid graph.
翻译:全有或全无与水行谜题是两类在矩形网格上依据特定约束构造连续回路的纸笔谜题。本文采用Tang与MIT Hardness Group提出的T-元胞框架分析其计算复杂性。通过从矩形网格图的最大度数为3的支撑子图中寻找哈密顿回路问题进行归约,我们证明这两类谜题均属于NP完全问题。