Solve New York Times Pips puzzles with backtracking
Pips is a logic puzzle from the New York Times where you must place dominoes on a grid while satisfying various constraints. Each domino has two halves with pips (dots) numbered 0-6, and regions on the board may require specific sums, equal values, or other relationships.
Important: Unlike traditional dominoes, touching domino halves don't need to match—only the region rules apply. Boards can also be non-rectangular with irregular shapes and holes.
Our solver uses a backtracking algorithm to systematically explore all possible domino placements. When a placement violates a constraint, the algorithm "backtracks" to try a different option.
Watch how backtracking solves a simple puzzle with constraint violations:
Start with an empty board. The green region must sum to 8.
The solver includes several optimizations to reduce search space:
Solving Pips exactly is a finite-domain constraint satisfaction problem (CSP) and is exponential in the worst case (NP-hard style). This means there's no known algorithm that can solve all instances efficiently. In practice, our backtracking approach with pruning and propagation makes typical instances very fast.
Easy puzzles typically explore hundreds of configurations, while hard puzzles may explore tens of thousands before finding a solution. Some puzzles may even have multiple valid solutions.
Watch the backtracking algorithm solve real NYT Pips puzzles step-by-step with our interactive visualizer!
Try the Visualizer →