Table of Contents
Fetching ...

Complexity of 2D Snake Cube Puzzles

MIT Hardness Group, Nithid Anchaleenukoon, Alex Dang, Erik D. Demaine, Kaylee Ji, Pitchayut Saengrungkongka

TL;DR

This work establishes the NP-hardness of several 2D and hexagonal variants of Snake Cube puzzles, including 1×H×W and 2×H×W boxes, as well as hexagonal-prism realizations. The authors develop a unified reduction framework from Numerical 3D Matching, built from block gadgets, wiring lemmas, and a segment-packing principle that force a one-to-one correspondence with a valid 3DM solution. They also address a weak NP-hardness result by encoding repeated patterns with a compressed input form via 2-Partition, and extend the constructions to triangular lattices with a shelf frame to handle multi-layer and closed-chain variants. Collectively, the results deepen our understanding of the algorithmic hardness of puzzle-folding problems and introduce versatile gadgets (segment packing, wires, shelves, and Hamiltonian-fillings) that can be reused across dimensional and geometric variants, with potential implications for puzzle design and complexity theory.

Abstract

Given a chain of $HW$ cubes where each cube is marked "turn $90^\circ$" or "go straight", when can it fold into a $1 \times H \times W$ rectangular box? We prove several variants of this (still) open problem NP-hard: (1) allowing some cubes to be wildcard (can turn or go straight); (2) allowing a larger box with empty spaces (simplifying a proof from CCCG 2022); (3) growing the box (and the number of cubes) to $2 \times H \times W$ (improving a prior 3D result from height $8$ to $2$); (4) with hexagonal prisms rather than cubes, each specified as going straight, turning $60^\circ$, or turning $120^\circ$; and (5) allowing the cubes to be encoded implicitly to compress exponentially large repetitions.

Complexity of 2D Snake Cube Puzzles

TL;DR

This work establishes the NP-hardness of several 2D and hexagonal variants of Snake Cube puzzles, including 1×H×W and 2×H×W boxes, as well as hexagonal-prism realizations. The authors develop a unified reduction framework from Numerical 3D Matching, built from block gadgets, wiring lemmas, and a segment-packing principle that force a one-to-one correspondence with a valid 3DM solution. They also address a weak NP-hardness result by encoding repeated patterns with a compressed input form via 2-Partition, and extend the constructions to triangular lattices with a shelf frame to handle multi-layer and closed-chain variants. Collectively, the results deepen our understanding of the algorithmic hardness of puzzle-folding problems and introduce versatile gadgets (segment packing, wires, shelves, and Hamiltonian-fillings) that can be reused across dimensional and geometric variants, with potential implications for puzzle design and complexity theory.

Abstract

Given a chain of cubes where each cube is marked "turn " or "go straight", when can it fold into a rectangular box? We prove several variants of this (still) open problem NP-hard: (1) allowing some cubes to be wildcard (can turn or go straight); (2) allowing a larger box with empty spaces (simplifying a proof from CCCG 2022); (3) growing the box (and the number of cubes) to (improving a prior 3D result from height to ); (4) with hexagonal prisms rather than cubes, each specified as going straight, turning , or turning ; and (5) allowing the cubes to be encoded implicitly to compress exponentially large repetitions.
Paper Structure (32 sections, 12 theorems, 35 equations, 20 figures)

This paper contains 32 sections, 12 theorems, 35 equations, 20 figures.

Key Result

Theorem 2.5

2-Partition is weakly NP-hard, i.e., NP-hard when the numbers $a_i$ are encoded in binary (and thus could be exponential in value).

Figures (20)

  • Figure 1: An example instance of $D\times H\times W$ Snake Cube with input $D = 1$, $H = 5$, $W = 5$, and the program $\texttt{STTSSSTSSSTTSSTTSSTSTTTTT}$. The gray and white cells represent cubes following instructions $\texttt{T}$ and $\texttt{S}$, respectively.
  • Figure 2: The reduction
  • Figure 3: Example of the setup wire packing when $n=3$. The red area represents the available space.
  • Figure 4: Packing of wires in the reserved spaces on the top and bottom of the rectangle.
  • Figure 5: Example of wires after Adjust Crossing step when $X_2$ is placed above $X_1$, $X_3$, and $X_4$. Since wires $U_1$ and $V_1$ are placed before $U_2$ and $V_2$, they do not have to detour around $X_2$. However, since wires $U_3$, $V_3$, $U_4$, and $V_4$ are placed after $U_2$ and $V_2$, they have to detour around $X_2$ (The lengths depicted are very not to scale.)
  • ...and 15 more figures

Theorems & Definitions (33)

  • Definition 2.1
  • Definition 2.2
  • Definition 2.3
  • Definition 2.4: 2-Partition
  • Theorem 2.5
  • proof
  • Definition 2.6
  • Theorem 2.7
  • proof
  • Proposition 2.8
  • ...and 23 more