How do they generate/rank Sudoku puzzles?

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?

This site shows how one can make a puzzle. And this forum 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.