Generating all sudokus from a bit pattern

Everything about Sudoku that doesn't fit in one of the other sections

re: generating all SuDoku puzzles for a layout

Postby Pat » Wed Aug 24, 2011 12:38 pm

ab wrote:I think he's trying to find every puzzle for a given layout of clues
by overlaying that layout over every possible solution and seeing which ones give a valid puzzle.


ab wrote:I think the answer to the original question is no!
You need to do all the column and row and box swapping to get every puzzle.

i agree
User avatar
Posts: 3674
Joined: 18 July 2005

Re: Generating all sudokus from a bit pattern

Postby eleven » Wed Aug 24, 2011 1:10 pm

The method sketched by dobrichev is probably not a bad one to find all unique puzzles with symmetrical patterns and many givens, because the uniqueness test is fast for them.
For one pattern in a million grids i needed about 6 seconds. I.e. given i have all grids unpacked, it could be done in about 3 weeks.

Canonicalizing the puzzles is much slower, but you only would have to do it for the puzzles in automorphic grids to eliminate all equivalents.
Posts: 1913
Joined: 10 February 2008

Re: Generating all sudokus from a bit pattern

Postby ab » Wed Aug 24, 2011 3:53 pm

coloin wrote:So he wants to generate all the sudoku puzzles with this pattern
If he means sudoku puzzles - the answer is yes [obviously]

The answer is only yes if he also carries out all possible row swaps and band swaps as well as rotations and reflections, which I believe was his original question, which is why I said I think the answer is no!
Posts: 451
Joined: 06 September 2005


Return to General