Sudoku solver

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Mar 29 17:21:11 EDT 2015


On 28/03/2015 23:50, BartC wrote:
> On 28/03/2015 03:39, Sayth wrote:
>> Good test for pypy to see where it's speed sits between C and Python.
>
> I've spent the last hour or so doing such tests.
>
> Using the OP's algorithm, and testing with the 'hard' puzzle posted by
> Ian Kelly, I got these approximate results:
>
> Python 3.1:     1700 seconds     (normal Python interpreter)
> PyPy:           93 seconds
> C unoptimised:  17 seconds       (gcc -O0 32-bit)
> C optimised:    3.3 seconds      (gcc -O3 32-bit)
> (X:             170 seconds)
>
> All running on Windows on x64.
>
> (X is my own interpreted language, which is where my interest in this
> is. This had been generally faster than Python until PyPy came along. It
> does however use a pure byte-code interpreter, so the result is not too
> bad.
>
> But using X *and* my own brute-force algorithm, the same puzzle took 2
> seconds to solve - faster than C!
>
> However it doesn't matter that the OP's algorithm is not great, as it
> makes an interesting new benchmark.)
>

https://attractivechaos.wordpress.com/2011/06/19/an-incomplete-review-of-sudoku-solver-implementations/

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list