# Pushing Blocks in Gravity is NP-Hard

### Erich FriedmanStetson University, DeLand, FL 32723efriedma@stetson.edu

Introduction

There has been much progress recently showing that certain classes of puzzles involving pushing blocks [2, 3, 4, 10] are NP-hard. For example, consider the block pushing puzzle Push-k which consists of movable unit square blocks on an integer lattice, and a robot that can move horizontally and vertically to attempt to reach a specified lattice position. The robot can push k blocks provided it pushes them to open squares. In [4], the authors prove that Push-k is NP-hard using a reduction from the 3-coloring of planar graphs. That is, for a given planar graph, they build a Push-k puzzle that can be solved if and only if the vertices of the original graph can be 3-colored. As 3-colorability is NP-hard [9], so is Push-k.

Their construction depends on the existence of four gadgets: a One-Way gadget that can only passed in one direction, a Fork gadget that allows only one of several exits to be used, an XOR Crossing gadget which allows possible passageways to cross provided that only one of these is used, and a NAND Non-Crossing gadget which allow only one of two nearby non-crossing passageways to be used. Any block puzzle that contains examples of these gadgets can be proved to be NP-hard by imitatating their proof.

We consider the block pushing puzzle called Push-1-G (the G stands for gravity) in which the robot can push only one block, and blocks that are directly over one or more open squares, fall immediately downward as far as possible. The robot is not afected by gravity. Push-1-G is fairly boring when all blocks are pushable, since all the blocks will always be in stacks at the bottom of the puzzle, so we allow the existence of fixed (non-pushable) blocks. We will use the fixed blocks to build passageways in which the robot must navigate.

An example of a simple Push-1-G puzzle is shown in Figure 1. The robot starts at S and finishes at F. The dark squares are fixed blocks, the light squares are pushable blocks, and the white squares are open. We will construct the required gadgets for Push-1-G, showing that Push-1-G puzzles are NP-hard. Since Goldpusher [8] is a subset of Push-1-G, Goldpusher is also NP-hard. All our gadgets are easily generalized to show that Push-k-G is NP-hard for general k.

Figure 1. A Push-1-G puzzle

Our One-Way gadget is shown in Figure 2. The robot can only move from left to right. We abbreviate a One-Way gadget with an arrow in a passageway.

Our Fork gadget is shown in Figure 3. The robot can only enter at the bottom, and can only proceed by pushing one of the blocks to enter one of the passageways, but this blocks the other passageway. The Fork gadget for Push-k-G uses 2 groups of k blocks separated by one open square.

Our XOR Crossing gadget is shown in Figure 4. The robot enters from one of the passageways on the left, pushes a block which blocks one of the passageways, and exits on the right. We abbreviate an XOR Crossing gadget with an X at the intersection of two passageways.

Our NAND Non-crossing gadget is shown in Figure 5. The robot can only pass through one of the two passageways.