Solving the NYTimes Pips puzzle with a constraint solver (www.righto.com)

🤖 AI Summary
The New York Times’ new daily puzzle Pips — placing dominoes on a grid to satisfy pip-sum and equality conditions — was modeled and solved using the MiniZinc constraint‑modeling system. The author went from zero experience to a working solver in under two hours; MiniZinc found the unique solution for an “easy” 3×3 instance in about 109 ms. The exercise demonstrates how a declarative constraint solver lets you state “what” must hold (sum, bounds, equality) instead of “how” to search, making it straightforward to encode combinatorial puzzles and often vastly faster than naive brute force. Technically, the model used arrays for pips and dominogrid, and represented each domino half with var x,y coordinates so orientation need not be handled separately. Key constraints: adjacency (abs(dx)+abs(dy)==1), pips[y,x]==spots[i,j] to place spot values, dominogrid occupancy to prevent overlap, and grid mask constraints to forbid invalid cells. Important modeling choices included finite domains (0..6 pips, limited coord ranges) to constrain search size. Practical lessons: solvers can return unintended solutions if “empty” cells aren’t constrained, debugging often means relaxing constraints to localize errors, and backend choice matters — Gecode stalled on a harder instance while Chuffed quickly produced 384 solutions. Overall, the post shows constraint solvers are approachable, powerful tools for AI/ML practitioners tackling combinatorial search — but success hinges on careful modeling and solver selection.
Loading comments...
loading comments...