We investigate the reconfiguration of $n$ blocks, or "tokens", in the square grid using "line pushes". A line push is performed from one of the four cardinal directions and pushes all tokens that are maximum in that direction to the opposite direction. Tokens that are in the way of other tokens are displaced in the same direction, as well. Similar models of manipulating objects using uniform external forces match the mechanics of existing games and puzzles, such as Mega Maze, 2048 and Labyrinth, and have also been investigated in the context of self-assembly, programmable matter and robotic motion planning. The problem of obtaining a given shape from a starting configuration is know to be NP-complete. We show that, for every $n$, there are "sparse" initial configurations of $n$ tokens (i.e., where no two tokens are in the same row or column) that can be rearranged into any $a\times b$ box such that $ab=n$. However, only $1\times k$, $2\times k$ and $3\times 3$ boxes are obtainable from any arbitrary sparse configuration with a matching number of tokens. We also study the problem of rearranging labeled tokens into a configuration of the same shape, but with permuted tokens. For every initial "compact" configuration of the tokens, we provide a complete characterization of what other configurations can be obtained by means of line pushes.
翻译:我们研究了在正方形网格中使用"直线推动"对$n$个方块(或"标记")进行重构的问题。直线推动从一个基本方向执行,将所有在该方向上处于极值位置的标记推向相反方向。阻挡其他标记路径的标记也会沿相同方向移动。这种利用统一外部力操纵物体的模型与现有游戏和谜题(如Mega Maze、2048和Labyrinth)的机制相匹配,并在自组装、可编程物质和机器人运动规划等领域得到研究。从初始配置获得给定形状的问题已知是NP完全的。我们证明:对于每个$n$,存在$n$个标记的"稀疏"初始配置(即任意两个标记不在同一行或列),这些配置可被重新排列成任意满足$ab=n$的$a\times b$矩形。然而,从任意具有匹配标记数量的稀疏配置中,仅能获得$1\times k$、$2\times k$和$3\times 3$的矩形。我们还研究了将有标签标记重排为相同形状但标记排列不同的配置问题。对于每个初始"紧凑"配置的标记,我们完整刻画了通过直线推动可获得的其它配置。