Soduku

Raymond Hettinger python at rcn.com
Wed Feb 15 21:56:56 EST 2006


[Jack Diederich]
> Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz)
> an empty python program takes 10ms to run (0.010 secs).  I ask out of
> vanity, my own solver takes .15 seconds to run (20 seconds for a 16x16 grid).

Comparisons for individual puzzles are likely to be meaningless.  Any
algorithm is at some point forced to try out assumptions from many
possiblities.  A lucky or unlucky string of guesses would throw-off the
comparisons.  Ideally, they should run hundreds of sample puzzles and
include a good many that involve making mulitple levels of assumptions.
 Some of the easy puzzles solve readily without a depth-first search
(so a good chuck of the code may go unexercised).  Another comparison
issue is the choice of data structures for input, working data, and
output -- the accessing differing structures may cloud the comparison
of difference algorithms.

FWIW, my version is listed on ASPN:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473893


Raymond




More information about the Python-list mailing list