Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Sudoku solver that returns more than one solution

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku
View previous topic :: View next topic  
Author Message
barleyfarmer

Joined: 12 Jul 2005
Posts: 3
:

Items
PostPosted: Wed Jul 13, 2005 12:00 am    Post subject: Sudoku solver that returns more than one solution Reply with quote

A UK satellite channel put up a massive sudoku board in the UK somewhere near Bristol that is carved into a chalk hillside.

Unfortunately, it gives more than one solution;

506020903
008000500
000000000
600285009
000903000
800761004
000000000
004000300
201050607

1,905 - apparently, it was tested with some free software on the web and it came back with only one solution. I noted that the free solver on this site said the puzzle was unique. Oooops.

I like a combination of brute-force and heuristics, in fact I have two programs, one for each. The heuristics based one finds a solution in "spring-time" i.e. the time it takes for the spring to push up the Enter key. The brute force one took under 3 mins to shove out all 1,905 permutations.

Sad, as it may seem, I still use a pencil, rubber and grey matter. The programming is just for fun.

BTW:My phone call to the channel concerned was "Ummm, we'll call you back..." they never did. Probably thought I was a crank...

Steve Wink
Back to top
View user's profile Send private message
Simes

Joined: 08 Apr 2005
Posts: 71
:
Location: North Yorkshire, UK

Items
PostPosted: Wed Jul 13, 2005 7:09 am    Post subject: Reply with quote

Hi Steve,

You've already seen my solver, but did you notice that it can first count, and then show all solutions?
_________________
Simes
www.sadmansoftware.com/sudoku
Back to top
View user's profile Send private message Visit poster's website
barleyfarmer

Joined: 12 Jul 2005
Posts: 3
:

Items
PostPosted: Wed Jul 13, 2005 9:01 am    Post subject: Reply with quote

Yes, thanks, the program works very well. It's the best of the 10 I tried and the only one to prove an incorrect sudoku, e.g. Sky's hillside blunder.
Back to top
View user's profile Send private message
abik

Joined: 10 Sep 2005
Posts: 18
:
Location: Santa Clara

Items
PostPosted: Sat Sep 10, 2005 5:45 am    Post subject: Reply with quote

I can confirm the number of different solutions, found in about 4 milliseconds with a backtracking solver in C.

Code:

PROBLEM:
  +---+---+---+
  |5 6| 2 |9 3|
  |  8|   |5  |
  |   |   |   |
  +---+---+---+
  |6  |285|  9|
  |   |9 3|   |
  |8  |761|  4|
  +---+---+---+
  |   |   |   |
  |  4|   |3  |
  |2 1| 5 |6 7|
  +---+---+---+


SOLUTIONS=1905 DIFFICULTY=2

nodes=38475 clocks=12365896 millisecs=4.12
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dukuso

Joined: 14 Jul 2005
Posts: 424
:
Location: germany

Items
PostPosted: Sat Sep 10, 2005 6:47 am    Post subject: Reply with quote

abik wrote:
SOLUTIONS=1905 DIFFICULTY=2

nodes=38475 clocks=12365896 millisecs=4.12[/code]



I have:
nodes:about 27000, 43ms
so yours would be 10 times faster !
BTW. there was a speed contest at
http://www.vbforums.com/showthread.php?t=351476&page=11&pp=40
the best program was about twice as fast as mine,
but complicated and in VB6.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssubbanna

Joined: 22 Sep 2005
Posts: 1
:

Items
PostPosted: Thu Sep 22, 2005 9:49 am    Post subject: More than one solution to a sudoku Reply with quote

I have a couple of Sudokus that have more than one correct soluytion .Can I post them ? If so, please let me know.. how.
Thank you Sir
Ssubbanna
Bangalore
India
Back to top
View user's profile Send private message
abik

Joined: 10 Sep 2005
Posts: 18
:
Location: Santa Clara

Items
PostPosted: Thu Sep 22, 2005 4:39 pm    Post subject: multi solutions Reply with quote

Why don't you join the discussion in the nodes-per-second thread in this same forum? Post your puzzles any place on the Web where we can download them. Use a commonly used format such as a file with lines of 81 characters 0..9 where each puzzle starts at a new line. An example with two puzzles follows.

Code:

000400500000270080006008004300600400040050070002009006200900700080030050154762008
536020900008000000000000000600285009000903000800761004000000000004000000201000007
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron