[Math] How to solve an empty sudoku

algorithmsmatricessudoku

I am making a computer game sudoku.
I have a simple algorithm(more like a rule) : check rows and columns before placing a number.
But solving like that sometimes get me stuck and I want to avoid correction algorithm unless there is no choice.
here is a case :
Fill any diagonal matrices with random numbers 0-9 :
enter image description here
Now pick one matrix and by the rule fill the numbers randomly :
enter image description here
But this step has a problem as shown in picture.
How to overcome that problem ?

P.S : I need a solved sudoku in order to turn it into a question.

Best Answer

Not a strong answer, but probably worth writing everything. Any sudoku with less than 17 numbers does not have a unique solution. So, randomly guessing 16 numbers will likely have at least one solution, and could be found by lots of trial and error. Computers could make this easier.

Mind you, even with 16 numbers, no solution is guaranteed, but there are multiple "paths" to check.

A sudoku with 17 or more numbers MAY have a unique solution, or MAY not have a solution. It also MAY have multiple solutions. If you want to be sure you have multiple paths to take, don't work up to 17.

Related Question