The Interactive Sudoku Solver (ISS) is a solver designed to quickly solve variant sudoku puzzles. It does not use human solving techniques, instead optimizing for speed.
Use it to find all the solutions, count the solutions, or see all the valid values for each cell in a puzzle.
Visit the github repository to view the source code and report bugs.
Some constraint types aren't directly supported but can be constructed using combinations of available constraints.
Description: Two regions of the same shape and size, which must have the same values in corresponding cells.
Use the SameValueSets
on every pair of corresponding cells
to mark them as equal. Each pair must be a separate constraint.
Description: A square of cells, where the sum of the values in each row, column, and diagonal is the same.
Use the Cage
constrain each row, column, and diagonal to
sum to 15.
Description: A thermometer (values are strictly increasing) where the values are either all odd or all even.
Create a Custom Binary Constraint with the following formula:
a < b && (a % 2 == b % 2)
Description: No two digits along the line may be be consecutive. ("Nabner" is "Renban" spelled backwards.)
Create a Custom Binary Constraint with "Chain handling" set to "All pairs" and use the following formula:
Math.abs(a - b) > 1
Description: Unlike Naber, this is how to create a set where all the values taken together are not consecutive.
This requires checking that there is at least one pair of cells which
have a difference of at least two, and where none of the other cells
have values which are between them.
Each pair can be checked with a Lockout
constraint, with
all the pairs inside an Or
.
This results in n(n-1)/2
constraints inside the
Or
.
Here's how you can generate the constraint (run in the browser developer console):
function makeNotRenban(cells) { const n = cells.length; const constraints = []; for (let i = 0; i < n; i++) { for (let j = i+1; j < n; j++) { const line = [...cells]; [line[0], line[i]] = [line[i], line[0]]; [line[n-1], line[j]] = [line[j], line[n-1]]; constraints.push(new SudokuConstraint.Lockout(2, ...line)); } } return new SudokuConstraint.Or(constraints); } console.log(makeNotRenban('R1C1', 'R1C2', 'R1C3').toString());