What is Griductive and how the puzzles are made
Source: Dev.to
The Guarantee
Every Griductive puzzle promises never to require a guess.
- Each cell can be deduced by logic alone.
- There is exactly one correct solution.
This isn’t a design goal – it’s a mathematical guarantee enforced by the same class of solvers used in operations research and chip verification. If a puzzle had two valid solutions, there would be at least one cell where both Suspect and Innocent satisfy all clues. At that cell no amount of reasoning could decide which is correct, forcing a guess – which would violate the core contract of a deduction puzzle. Therefore the generator proves that no second solution exists before a puzzle is ever published.
Puzzle‑Generation Pipeline (Five Phases)
| Phase | What Happens |
|---|---|
| 1 – Solution Generation | Create a random solution grid – a full assignment of Suspect / Innocent to every cell. This is the ground‑truth the player will eventually deduce. |
| 2 – Clue Enumeration | Exhaustively enumerate every possible clue that is true on the solution board. Griductive has 26+ distinct clue types (counting, comparison, spatial, existential, uniqueness, connectivity, …). For each type the generator tests every valid parameterisation. A 4×4 grid can produce thousands of candidate clues; only those that evaluate to true on the solution are kept. |
| 3 – Minimal‑Clue Selection | From the massive pool of true statements, pick a small subset that satisfies two conditions: 1️⃣ Sufficient – together they constrain the solution space to exactly one board. 2️⃣ Non‑redundant – removing any single clue would allow multiple solutions. Greedy constraint‑satisfaction algorithm: 1. Start with no clues selected (solution space is huge). 2. Score each candidate clue by how much it narrows the remaining possibilities (e.g., eliminates 80 % → high score). 3. Add the highest‑scoring clue. 4. Re‑solve the constraint model with the updated set. 5. Repeat until the solver confirms a unique solution. 6. Prune any unnecessary clues from the final set. |
| 4 – Difficulty Scoring | Compute a difficulty rating on a 0–100 scale using four weighted factors: • Simple‑clue ratio (35 %): proportion of direct counting/identity clues. More simple clues → easier puzzle. • Complex‑clue ratio (30 %): proportion of clues requiring multi‑step or spatial reasoning. • Information scarcity (20 %): fewer clues relative to grid size → harder. • Grid scale (15 %): larger grids are intrinsically tougher (e.g., 5×5 ≈ 3× the cells of 3×3). Each clue type also carries an intrinsic complexity rating (e.g., “Julia is a suspect” = very simple; “Julia is the only person in row 3 with exactly 1 suspect neighbour” = high complexity). |
| 5 – Hint Sequence & Packaging | Build a hint sequence – a recommended solving order that guides stuck players step‑by‑step. Hints are ordered by dependency depth: cells deducible immediately come first; cells requiring long deduction chains come last. Package the final puzzle with: • Metadata (grid size, title, etc.) • The minimal clue set • The hint sequence • Difficulty score |
The Solver Behind the Scenes
At the heart of the pipeline is Google OR‑Tools CP‑SAT, a constraint‑programming solver that blends constraint propagation, integer programming, and SAT solving.
- Variables – each cell is a Boolean variable:
Suspect = 1,Innocent = 0. - Constraints – each clue translates into one or more mathematical constraints over those variables.
Example Translations
"There are exactly 2 suspects in row 3"
→ cell[3,0] + cell[3,1] + cell[3,2] + cell[3,3] = 2
"All suspects in column A are connected"
→ a connectivity constraint ensuring that suspect cells in column A form a contiguous chain with no gaps.
"Row 1 has more suspects than column B"
→ sum(row_1) > sum(col_B)How Uniqueness Is Verified
After assembling the clue set, the generator asks CP‑SAT:
“Given these constraints, does more than one valid assignment exist?”
CP‑SAT can enumerate all solutions.
- Exactly one solution → puzzle is valid.
- Two or more solutions → generator returns to Phase 3 and adds another clue.
This is a formal proof, not a heuristic. CP‑SAT exhaustively explores the solution space; if it reports a single solution, there is exactly one – period.
Scaling Considerations
A 5×5 grid has 25 cells, each with 2 possible values → (2^{25} = 33{,}554{,}432) possible boards. Brute‑forcing all of them is infeasible.
CP‑SAT is dramatically faster because of constraint propagation: when a clue says “row 3 has exactly 2 suspects,” the solver instantly reduces the search space, pruning impossible assignments before they are even considered.
TL;DR
- Griductive guarantees a single, logically deducible solution.
- A five‑phase pipeline (solution → clue enumeration → minimal‑clue selection → difficulty scoring → hint sequencing) builds each puzzle.
- Google OR‑Tools CP‑SAT provides the rigorous, provable uniqueness check and powers the entire generation process.
Enjoy the pure deduction!
How Griductive Guarantees Uniqueness
Speed of verification – CP‑SAT proves uniqueness for a 5 × 5 puzzle in milliseconds, even when “neighbors”, “connected”, and “between” clues interact in complex ways.
Formal definitions – Every clue type has a precise mathematical definition:
- Neighbors – the up‑to‑8 surrounding cells, including diagonals.
- Connected – a contiguous chain of adjacent cells.
- Between – cells in the same row or column, excluding the endpoints.
These definitions are baked directly into the constraint model, so there is no natural‑language interpretation step where ambiguity could creep in. The in‑game Clarifying Details reference shows players exactly what each spatial keyword means.
Robust solver – The CP‑SAT solver is a well‑tested, widely‑used tool maintained by Google’s optimization team. We don’t rely on trust alone; every generated puzzle is independently verified.
Verification Process
- Automated solving – An automated solver attempts to solve each puzzle step‑by‑step, simulating a human player. If it cannot reach a complete solution through logical deduction alone, the puzzle is rejected.
- Hint‑soundness checks – Each hint in the sequence is verified to be logically valid: the hinted cell must be genuinely deducible from the clues and previously revealed cells, not from hidden information.
- Clue evaluation – Every clue type has a formal evaluation function that is tested against known puzzle configurations. During clue‑pool generation, only clues that evaluate to true on the actual solution are kept; a clue that is false on the solution can never appear in the puzzle.
Puzzle‑Generation Pipeline (Recap)
When you open a Griductive puzzle, the following has already happened:
- A random solution was generated.
- Thousands of candidate clues were evaluated against it.
- A minimal, non‑redundant subset was selected.
- A formal solver proved that exactly one solution satisfies those clues.
- An automated solver independently verified that the puzzle is solvable through pure deduction.
- A difficulty score was computed and a hint sequence was generated.
This process runs every day, for all four grid sizes, without exception.
The Promise
If you’re stuck, there’s a clue you haven’t fully used yet.
If you think two answers are possible, re‑read the clues — the logic will resolve it.
And if you want proof, the Logic Graph will show you the exact deduction chain from clues to solution.
Future Directions: Adding Flavor
Right now, Griductive’s clues read like precise logical statements — clear and unambiguous, but admittedly a bit clinical.
“There are exactly 2 suspects in row 3.”
We’re actively working on changing that. The goal is to diversify how clues are expressed, weaving in thematic flavor while preserving the same underlying logical precision. Imagine clues tied to holiday events or framed as witness testimony from a specific crime scene. Instead of a sterile formula, you’d read something that feels like an actual piece of evidence from an investigation.
The key constraint hasn’t changed: every clue must remain consistent, unambiguous, and formally verifiable. The solver doesn’t care whether a clue sounds like a math textbook or a noir detective novel—it only cares about the logical content. That separation is what makes richer expression possible without compromising correctness.
Same guarantees. Same rigor. But puzzles that feel less like equations and more like cases worth cracking.
No guessing. No luck. Mathematically guaranteed.