View previous topic :: View next topic |
Author |
Message |
| barleyfarmer
| Joined: 12 Jul 2005 | Posts: 3 | : | | Items |
|
Posted: Wed Jul 13, 2005 12:00 am Post subject: Sudoku solver that returns more than one solution |
|
|
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 |
|
Back to top |
|
|
| Simes
| Joined: 08 Apr 2005 | Posts: 71 | : | Location: North Yorkshire, UK | Items |
|
Posted: Wed Jul 13, 2005 7:09 am Post subject: |
|
|
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 |
|
|
| barleyfarmer
| Joined: 12 Jul 2005 | Posts: 3 | : | | Items |
|
Posted: Wed Jul 13, 2005 9:01 am Post subject: |
|
|
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 |
|
|
| abik
| Joined: 10 Sep 2005 | Posts: 18 | : | Location: Santa Clara | Items |
|
Posted: Sat Sep 10, 2005 5:45 am Post subject: |
|
|
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 |
|
|
| dukuso
| Joined: 14 Jul 2005 | Posts: 424 | : | Location: germany | Items |
|
Posted: Sat Sep 10, 2005 6:47 am Post subject: |
|
|
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 |
|
|
| ssubbanna
| Joined: 22 Sep 2005 | Posts: 1 | : | | Items |
|
Posted: Thu Sep 22, 2005 9:49 am Post subject: More than one solution to a sudoku |
|
|
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 |
|
|
| abik
| Joined: 10 Sep 2005 | Posts: 18 | : | Location: Santa Clara | Items |
|
Posted: Thu Sep 22, 2005 4:39 pm Post subject: multi solutions |
|
|
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 |
|
|
|