Table of Contents
Fetching ...

PackIt! Gamified Rectangle Packing

Thomas Garrison, Marijn J. H. Heule, Bernardo Subercaseaux

TL;DR

PackIt! studies a turn-based rectangle packing game on an $n\times n$ grid where on turn $t$ a rectangle of area $t$ or $t+1$ must be placed without overlap. The authors develop arithmetic criteria using $K(m,n) = \tau(mn)$ and the gap $\gamma(m,n) = mn - T_{\tau(mn)}$, establish small-gap and large-gap impossibility results, and conjecture conditions under which perfect packings exist. They prove NP-hardness for the solitaire variant via gadget-based reductions from 4-Restricted-3-Partition and introduce an efficient $O(n^3)$-clause SAT encoding to compute perfect packings up to $n=50$, complemented by a dynamic-programming rectangle-selection stage. The work delivers both theoretical insights and practical algorithms, with extensive computational results and open questions on the 2-player version and broader packing problems.

Abstract

We present and analyze PackIt!, a turn-based game consisting of packing rectangles on an $n \times n$ grid. PackIt! can be easily played on paper, either as a competitive two-player game or in \emph{solitaire} fashion. On the $t$-th turn, a rectangle of area $t$ or $t+1$ must be placed in the grid. In the two-player format of PackIt! whichever player places a rectangle last wins, whereas the goal in the solitaire variant is to perfectly pack the $n \times n$ grid. We analyze conditions for the existence of a perfect packing over $n \times n$, then present an automated reasoning approach that allows finding perfect games of PackIt! up to $n = 50$ which includes a novel SAT-encoding technique of independent interest, and conclude by proving an NP-hardness result.

PackIt! Gamified Rectangle Packing

TL;DR

PackIt! studies a turn-based rectangle packing game on an grid where on turn a rectangle of area or must be placed without overlap. The authors develop arithmetic criteria using and the gap , establish small-gap and large-gap impossibility results, and conjecture conditions under which perfect packings exist. They prove NP-hardness for the solitaire variant via gadget-based reductions from 4-Restricted-3-Partition and introduce an efficient -clause SAT encoding to compute perfect packings up to , complemented by a dynamic-programming rectangle-selection stage. The work delivers both theoretical insights and practical algorithms, with extensive computational results and open questions on the 2-player version and broader packing problems.

Abstract

We present and analyze PackIt!, a turn-based game consisting of packing rectangles on an grid. PackIt! can be easily played on paper, either as a competitive two-player game or in \emph{solitaire} fashion. On the -th turn, a rectangle of area or must be placed in the grid. In the two-player format of PackIt! whichever player places a rectangle last wins, whereas the goal in the solitaire variant is to perfectly pack the grid. We analyze conditions for the existence of a perfect packing over , then present an automated reasoning approach that allows finding perfect games of PackIt! up to which includes a novel SAT-encoding technique of independent interest, and conclude by proving an NP-hardness result.
Paper Structure (14 sections, 10 theorems, 49 equations, 10 figures, 1 table)

This paper contains 14 sections, 10 theorems, 49 equations, 10 figures, 1 table.

Key Result

Lemma 1

For an $m \times n$ grid there is a unique number $K(m, n)$ such that if the $m \times n$ grid admits a perfect PackIt! game, then such a packing must use exactly $K(m, n)$ rectangles. In particular, $K(m, n) = \tau(m \cdot n).$

Figures (10)

  • Figure 1: Illustration of a couple of games of PackIt!. Each rectangle $a_t$ is labeled with $t$ and depicted in a different color.
  • Figure 2: Illustration of the impossibility result for $n=6$ resulting from \ref{['thm:small-gap']}. Even though turns $1$ through $6$ use the minimal possible area, the choice of area $8$ on turn $7$ is enough to make turn $9$ possible, as only $8$ empty cells remain (which is invariant under the concrete choice of packing).
  • Figure 3: Illustration of the impossibility result for $n=18$ (\ref{['thm:large-gap']}). Even though almost each rectangle $t$ has area $t+1$, except for $t \in \{18, 22\}$ (where $t+1 > n$ is prime), the total area covered by turn $24$ is only $322 = 18^2- 2$, and naturally it is not possible to fill in the two remaining cells in turn $25$.
  • Figure 4: Illustration of Case 1 for the proof of \ref{['thm:2xn2']}, for $n = 4$. In this case $\gamma_n = 1$.
  • Figure 5: Illustration of the gadgets for $T = 10$.
  • ...and 5 more figures

Theorems & Definitions (30)

  • Lemma 1
  • proof
  • Definition 1
  • Lemma 2
  • proof
  • Theorem 1: Small gap
  • proof : Proof of \ref{['thm:small-gap']}
  • Theorem 2: Large gap
  • proof : Proof of \ref{['thm:large-gap']}
  • Conjecture 1
  • ...and 20 more