The solution is divided into 2 parts:
A. Generation of a 600 billion number template
B. Masking Pattern Generation ~ 7e23 Combinations
A) For a number template, the fastest way that can generate unique combinations without spending time searching or testing
Step 1. Select an existing matrix, I chose the following, since it can be easily made by a person without any help from a computing device or solver:
First line - numbers in ascending order
The second row is also in ascending order, but starts at 4 and rotates around
The third row is also in ascending order, but starts at 7 and rotates around
Row 4,5,6: replace the column of three cells with the upper right column - 2 5 8 and flip the 3x3 cell for the last column.
Row 7,8,9: replace the column of three cells with the upper right column - 3 6 9 and flip the 3x3 cell for the last column.
1 2 3 4 5 6 7 8 9
4 5 6 7 8 9 1 2 3
7 8 9 1 2 3 4 5 6
2 3 1 5 6 4 8 9 7
5 6 4 8 9 7 2 3 1
8 9 7 2 3 1 5 6 4
3 1 2 6 4 5 9 7 8
6 4 5 9 7 8 3 1 2
9 7 8 3 1 2 6 4 5
Step 2. Shuffle the numbers and replace all other cells
Step 3. Arbitrarily rearrange columns 1,2 and 3 inside yourself
Step 4. Arbitrarily rearrange columns 4,5 and 6 inside itself
Step 5. Arbitrarily rearrange columns 7.8 and 9 inside yourself
Step 6. Arbitrarily rearrange rows 1,2 and 3 inside yourself
Step 7. Arbitrarily rearrange rows 4,5 and 6 inside yourself
Step 8. Arbitrarily rearrange rows 7.8 and 9 inside yourself
Step 9. Arbitrarily rearrange into 3 groups of 9x3 columns
Step 10. Arbitrarily rearrange in 3 rows of 3x9 rows
voila ...
5 8 3 1 6 4 9 7 2
7 2 9 3 5 8 1 4 6
1 4 6 2 7 9 3 8 5
8 5 2 6 9 1 4 3 7
3 1 7 4 2 5 8 6 9
6 9 4 8 3 7 2 5 1
4 6 5 9 1 3 7 2 8
2 3 1 7 8 6 5 9 4
9 7 8 5 4 2 6 1 3
B) For the masking template, we need a decisive algorithm. Since we already have a rather unique grid of numbers (which is also solvable!), This gives us better performance when using the solver
Step 1: Start by choosing 15 random spots out of 81.
Step 2: Check with the solver if it has a unique solution
Step 3: If the solution is not unique, select an additional location. repeat steps 2 and 3 until a unique solution is found
This should give you a very unique and fast sudoku board.
gapjiba Mar 27 '19 at 9:02 2019-03-27 09:02
source share