How to generate Sudoku boards with unique solutions
How do you generate a Sudoku board with a unique solution? What I thought was to initialize a random board and then remove some numbers. But my question is how do I maintain the uniqueness of a solution? TMS Easy: Find all solutions with an efficient backtracking algorithm. If there is just one solution, you are done. Otherwise if you have more than one solution, find a position at which most of the solutions differ. Add the number at this position. Go to 1. I doubt you can find a solution that would be much faster than this. Here is the way my own SuDoKu program does it: Start with a complete