Polyamond generation and puzzle solving

All polyamonds up to size 12, and the solutions of a few puzzles using each hexiamond exactly once.

Generation

The shapes of a certain size are generated iteratively by considering all shapes of size one less, adding all possible adjacent triangles, and removing duplicates by rotations and reflections.

All polyamonds up to size 12

Puzzles

Puzzles are solved with a classic backtracking algorithm: we try to fill up the board, row by row, by trying every piece that hasn't been used yet, in all its possible variants (rotations and reflections), and backtrack if there is no way to move forward. Forcing the algorithm to fill the board row by row helps cutting down large branches of the search tree, because it prevents creating "holes": small areas of the board in which no piece can fit.

To prevent generating symmetrical solutions, we pick one piece with no symmetries and force it to be in a limited set of variants: all those that are not equivalent through the board's symmetry group.

(Click on each puzzle for the complete list of solutions)

Source code

All source code is available on on Github