Home Source Analytics

Sudoku

Solver

"Wave function collapse" is a heuristic we can use to find empty spots to fill. The best empty spot is the one with the fewest possible values. Selecting this space will split the search space the most evenly. Back tracking will then search the potential space faster. Inherently it will not select new values that are invalid.

Solved: No
Steps: 0 (0 0 ⁺∕₋ 0 0)
Backtracked: 0 (0.0 0.0 ⁺∕₋ 0.0 0.0)
Branched: 0 (0.0 0.0 ⁺∕₋ 0.0 0.0)
Stack size: 0 (0.0 0.0 ⁺∕₋ 0.0 0.0)
Clues: 25
Print
1 2 3
4 5 6
7 8 9
1 5
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
6
8
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
4
1 2 3
4 5 6
7 8 9
5
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
9 2
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
7 2
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
9 3 1
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
6
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
6 3
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
4
4
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
5
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
2
1 2 3
4 5 6
7 8 9
3
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
6 8
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
4
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
Solvable: Yes
Unique:

Grid Generator

Start with an empty board and use the solver until it is valid. The grid is valid if there are no duplicate values in any row, column, or 3x3 square. We backtrack if we reach a point where we cannot place a value without violating the rules.

Grids in cache 0
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
Solvable: Yes
Unique:

Puzzle Generator

To generate a sudoku, we can start with a solved grid and remove values. If we cannot delete a value without making the board non-unique, we have reached the maximum difficulty.

Failure count: 0
Puzzles in cache 2
2 1 5 7 8 4 3 9 6
8 9 7 6 2 3 4 1 5
3 4 6 1 5 9 2 8 7
7 2 8 4 6 5 9 3 1
9 5 4 3 1 2 7 6 8
1 6 3 8 9 7 5 2 4
4 8 9 5 3 1 6 7 2
5 3 1 2 7 6 8 4 9
6 7 2 9 4 8 1 5 3
Solvable: Yes
Unique:

Difficulty Grader

The difficulty of the puzzle can likely be determined as a function of steps, backtracks and branches. The obvious metric is to use the number of steps, but the number of backtracks and branches may also be useful. For now the number of steps will be used, but the other metrics will be stored for future use.

Top 5 of 2 found puzzles

Rating Puzzle
0
0

Bottom 5 of 2 found puzzles

Rating Puzzle
0
0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
Solvable: No
Unique:

FAQ

How do we test for uniqueness?

After the solver has found a solution, we backtrack if the branch stack has remaining items and continue solving. We keep track of how many times we have found a solution and if we find a solution more than once, the board is not unique. The current implementation short-circuits on finding the second solution. The algorithm is behind a calculate button because it is computationally expensive to calculate each time we update the board.

How do we update sigma values?

When we don't have a sigma, we use the first observation as the sigma. When we observe a new value, we calculate the variance between the observation and our expected mean. We treat sigma as all observed variances then take the square root of the sum of the squares of the variances. We observe 4 historical points with 1 new observation. Lastly, we divide by 5 to get the average difference. It is important to note that black swan observations whilst smoothed, can cause the sigma to be very large immediately after the observation.

Cache

NOTE: Currently using local storage. Switching your browser switches the cache. I am considering using an online service to maintain a cache.

0 grids (2 bytes)
2 puzzles (329 bytes)