c++ – Sudoku grid generation

Question:

Question: what principle can be used to implement the construction of a Sudoku grid, namely the deletion of numbers.

Sudoku rules say that there can only be one solution. This task, as I understand it, is solved by exhaustive enumeration, since if you randomly cross out , according to my opinion, you can run into a grid that can be solved in at least 2 ways. For example, a 9 by 9 grid will not be generated for so long, but it will still take some time, and if we have a 25 by 25 grid, we also set all the complexity for this.

Complexity – how many numbers we leave on the field of not crossed out numbers, the fewer numbers, the greater the complexity.

Answer:

As a deletion criterion, you can use the minimum number of numbers involved in the field, necessary to restore the number.
Those. first remove simpler stones, and leave more sophisticated ones for later.

Scroll to Top