# How do they generate/rank Sudoku puzzles?

**URL:** <https://boards.straightdope.com/t/how-do-they-generate-rank-sudoku-puzzles/317528>\
**Category:** Factual Questions\
**Created:** [August 18, 2005, 2:50am UTC](https://boards.straightdope.com/t/how-do-they-generate-rank-sudoku-puzzles/317528 "2005-08-18T02:50:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CookingWithGas](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cookingwithgas/32/485_2.png) [@CookingWithGas](https://boards.straightdope.com/u/CookingWithGas)\
**Post date:** [August 18, 2005, 2:50am UTC](https://boards.straightdope.com/t/how-do-they-generate-rank-sudoku-puzzles/317528/1 "2005-08-18T02:50:22Z")

</div>

You may have seen the other threads on these boards about a logic game called Sudoku. I will spare you the explanation other than to say you get a grid with some numbers and you have to find a unique solution that fills in the grid with certain criteria. Puzzles are typically ranked for difficulty, and have only one solution. I have three questions.

1. I can see how a simple program could generate all possible solved puzzles by exhaustive iteration and elimination of any configurations that do not meet the criteria. But once you have a valid solution, **how do you decide which numbers to eliminate to create the puzzle?** This question presupposes that you start with the solution and work backwards. This may not be true but I can’t imagine any other way.

2. And once you have created the puzzle, **how do you rate it for difficulty** unless you actually solve it, which they don’t because there are too many (I am currently solving #2,467,499,532).

3. And finally, **how do you guarantee that once you have created the puzzle, there is exactly one solution?**

---

<div class="post-metadata">

**Author:** ![MaceMan](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@MaceMan](https://boards.straightdope.com/u/MaceMan)\
**Post date:** [August 18, 2005, 5:37am UTC](https://boards.straightdope.com/t/how-do-they-generate-rank-sudoku-puzzles/317528/2 "2005-08-18T05:37:52Z")

</div>

[This site](http://www.pro.or.jp/~fuji/java/puzzle/numplace/makesudoku/sudoku01.html.en) shows how one can make a puzzle. And this [forum](http://www.sudoku.com/forums/) has a wealth of information. Rating for difficulty is basically a process of analyzing how many complex logical deductions must be made, based on the puzzles design.
