think is more about just random placing the numbers, and algorithms to generate them sound really complex, i mean u gota find a semingly random pattern of numbers that fit the 1-9 rule on every column or row and then just extract the numbers u want to put on the unsolved table.
although if i think of it it wouldn't be that hard to get it:P
just randomly generate first horizontal line, then generate another line with the condition that no number is equal with any of the numbers in the same row , column or region, if it gets into a dead end condition re run the whole row. this might be an inefficient way of doing it, for all i know it might end up into a dead end after getting a full row done, so it might need a row failed count which should decrease for each new row, like last row has one solution, so it will be found first time,
the row before it has 2 solutions, and so on..........
nvm what i said above, i was typing while thinking it and then then an idea came to mind.
what if we can start from a basic template and scramble it to look random?
if u take this table
1 2 3 4 5 6 7 8 9
4 5 6 7 8 9 1 2 3
7 8 9 1 2 3 4 5 6
2 3 4 5 6 7 8 9 1
5 6 7 8 9 1 2 3 4
8 9 1 2 3 4 5 6 7
3 4 5 6 7 8 9 1 2
6 7 8 9 1 2 3 4 5
9 1 2 3 4 5 6 7 8
u can see that any row has the 1 2 3 4 5 6 7 8 9 numbers in a consecutive order, some with a bit of offset
now to scramble that we can choose a random number on the first region and swap it with another in the same region, and then swap the same numbers in all regions.
do a few swaps between random numbers and u get a solved table, from that pick some random numbers in each region and dump the rest and u got an unsolved table:P
just checked wikipedia on sudoku
In 1986, Nikoli introduced two innovations: the number of givens was restricted to no more than 32, and puzzles became
"symmetrical" (meaning the givens were distributed in rotationally symmetric cells).
if u look at the unsolved puzzle below u see the rotational symmetry they talk about:P
http://upload.wikimedia.org/wikipedia/c ... 050714.svg