Sudoku solver

Christian Gollwitzer auriocus at gmx.de
Mon Mar 30 03:13:29 EDT 2015


Am 30.03.15 um 08:50 schrieb Ian Kelly:
> On Sun, Mar 29, 2015 at 12:03 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Be careful with the benchmark comparisons. Ian's example can be solved
>> with the identical algorithm in eight different ways (four corners, left
>> or right). I ran the example with my recent Python solver and got these
>> times in the eight cases:
>>
>>      884   s
>>        2.5 s
>>       13   s
>>      499   s
>>        5.9 s
>>      128   s
>>     1360   s
>>       36   s
>
> That sounds to me like either a transcription error was made to the
> puzzle at some point, or there's something wrong with your solver. The
> whole point of that example was that it was a puzzle with the minimum
> number of clues to specify a unique solution.

I think Marko meant, that if he creates symmetrically equivalent puzzles 
by rotating / mirroring the grid, he gets vastly different execution 
times, but ends up with the same solution. This is not surprising. The 
brute force algorithm branches into different solutions first, then, 
because it fills the grid always in the same order. To compare different 
solvers, it would indeed make sense to average over all symmetric 
solutions to make sure that no solver wins the competition by sheer 
luck, i.e. choosing the right path immediately.

	Christian




More information about the Python-list mailing list