I Ruined a Wooden Puzzle


Problem

Slide and rotate the following pieces (on the left) into the 'room' (on the right), through the 'door' (bottom left of the 'room'). The puzzle is effectively 2D, except that we are allowed to flip the pieces (this provides extra degrees of freedom compared to rotations and translations only, because some of the pieces are chiral).

If you want to solve the puzzle intuitively, reading this page won't actually ruin it, but as a disclaimer: the ipython notebook does show the solution.

Puzzle Setup

Solution Approach

Initially it seems like you would need to model complicated processes like continuous sliding. This would be hard. A much simpler problem is to find all options for the final configurations of the pieces. It turns out that if we find all possible configurations and then filter out those which obviously can't be 'slidable', we are left with only three final configurations (for this particular setup). Then it is very intuitive for a human to complete the final step by finding the only 'sliding' solution.

The fact that the simple 'filtering' approach works so well is quite lucky. This part would need more thought in order to scale well.

However, while solving this puzzle I discovered a very efficient process for finding all the possible configurations. It's this part that I'd like to explain in detail. The method is quite general so it could be easily adapted to dimensions other than 2, and I think there's potential to include different constraints on how the pieces can fit together (maybe, jigsaw-like pieces?).

Finding Configurations

What about efficiency?

Filtering Out Non-Slidable Solutions

The remarkably simple filtering system that I used was:

Conclusion

That's all. I have made it into an ipython notebook, so you can try it on different starting pieces and grids. :)