Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

constraint based killer sudoku solver performance improvements

25 views
Skip to first unread message

Blockheads Oi Oi

unread,
Jan 26, 2012, 1:21:18 PM1/26/12
to pytho...@python.org
I have a working program based on [1] that sets up all different
constraints for each row, column and box and then sets exact sum
constraints for each cage. It'll run in around 0.2 secs for a simple
problem, but a tough one takes 2 hours 45 minutes. I did some research
into improving the performance and found [2] but can't work out how to
implement the constraints given. Can someone please help, assuming that
it's even possible.

[1] http://pypi.python.org/pypi/python-constraint/1.1
[2] http://4c.ucc.ie/~hsimonis/sudoku.pdf
--
Cheers.

Mark Lawrence.

Frank Millman

unread,
Jan 27, 2012, 1:57:10 AM1/27/12
to pytho...@python.org
I don't have an answer, but are you aware of this -

http://www.ics.uci.edu/~eppstein/PADS/Sudoku.py

It is a sudoko solver written in pure python.

I don't know what you call a tough problem, but this one solves the hardest
one I have thrown at it in the blink of an eye. It also outputs a full trace
of the reasoning it used to arrive at a solution.

Frank Millman



Blockheads Oi Oi

unread,
Jan 27, 2012, 2:47:35 AM1/27/12
to pytho...@python.org
I'd looked at this years back and forgotten all about it so thanks for
the reminder :) Some of the code names directly match ideas given in my
[2] above so I'll take another look.
--
Cheers.

Mark Lawrence.

Blockheads Oi Oi

unread,
Jan 29, 2012, 7:22:27 PM1/29/12
to pytho...@python.org
Just for the record I ended up using gecode-python and 2 hours 45
minutes became 2 milli seconds with the same model. As most politicains
have been known to say, lessons will be learned :)

--
Cheers.

Mark Lawrence.

0 new messages