Re: Soduku

2006-02-15 Thread Jack Diederich
On Wed, Feb 15, 2006 at 06:56:56PM -0800, Raymond Hettinger wrote: > [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 fo

Re: Soduku

2006-02-15 Thread Raymond Hettinger
[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 meani

Re: Soduku

2006-02-15 Thread Mikael Olofsson
Jonathan Gardner wrote: > How do you have a 16x16 grid for soduku? Are you using 16 digits? 0-F? > > The one I am using has 9 digits, 9 squares of 9 cells each, or 9x9 > cells. What alphabet you use is irrelevant. Sudokus has really nothing to do with numbers. You can use numbers

Re: Soduku

2006-02-14 Thread Atanas Banov
you dont measure single run, you measure multiple runs using the "timeit" module (for me 1000 repeats was about right). here are some results which i recorded when i was implementing Sudoku solver (on AMD Athlon 1.25GHz, using the sample shown on www.sudoku.com front page): brute: 10

Re: Soduku

2006-02-14 Thread Jonathan Gardner
27ms == 0.027s How do you have a 16x16 grid for soduku? Are you using 16 digits? 0-F? The one I am using has 9 digits, 9 squares of 9 cells each, or 9x9 cells. The least efficient part of the algorithm is that part to calculate what to put in a hole (as anyone might've guessed.) My algo

Re: Soduku

2006-02-14 Thread Jack Diederich
sions, about 2x as fast. A few other minor tweaks > made it run even faster. > > And we've been playing with different algorithms for soduku solutions. > I had it down to 27 ms to solve the puzzle. > A nice story to hear, did you measure how long each of the solutions took you

Re: Soduku

2006-02-14 Thread Felipe Almeida Lessa
Em Ter, 2006-02-14 às 17:32 -0800, Jonathan Gardner escreveu: > So, one more story on why Python is really good. I think, at least with > 2.4, we should start bragging about Python's speed. I mean, it beats > Java AND perl! Maybe the other implementations also have errors? Well, I'm not saying Pyt

Soduku

2006-02-14 Thread Jonathan Gardner
erent algorithms for soduku solutions. I had it down to 27 ms to solve the puzzle. So, one more story on why Python is really good. I think, at least with 2.4, we should start bragging about Python's speed. I mean, it beats Java AND perl! -- http://mail.python.org/mailman/listinfo/python-list