Blog - puzzles

Blog - puzzles

Solving the Partridge Packing Problem using MiniZinc

23 min read
Constraint programming MiniZinc models puzzles

The Partridge Packing Problem is a packing puzzle that was originally proposed by Robert T. Wainwright at G4G2 (the Second Gathering for Gardner conference) in 1996. In this post we will model and solve the Partridge Packing Problem using MiniZinc. The inspiration was Matt Parker's fun video on the problem.

Packing problems are a classic use-case for combinatorial solvers. In fact, the original paper that introduced the idea of global constraints for constraint programming, "Introducing global constraints in CHIP" by Beldiceanu and Contejean 1994 included the so-called diffn constraint for packing problems. The constraint ensures that a set of (n-dimensional) boxes are not overlapping.[^DiffnName]