-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by Merri
...and make it ~4.7 ms
That's the way to go, I was kind of expecting you to say something like that. Once you figure it out, there are certain things that can be optimized when you go guessing and backtracking. They're not a lot of things but they make a big difference.
Quote:
Originally Posted by dukuso
put all sudokus in one file, one row per sudoku
What does that have to do with anything?
-
Re: Contest 6 - Sudoku solver - Discussion
I think he was reffering to how to process multiple sudokus. I personally like multiple files more.
-
Re: Contest 6 - Sudoku solver - Discussion
Hello, hhalkin...
gonna join the contest?
:wave:
-Lou
-
Re: Contest 6 - Sudoku solver - Discussion
-
Re: Contest 6 - Sudoku solver - Discussion
Woot! I am so happy. I can finally solve all but 6 of NotLKH1. The only reason I can't solve those 6 are because I don't have a backtracker yet. .5-3 ms each, but that will hopefully go down a ton after I start doing real optimizations.
-
Re: Contest 6 - Sudoku solver - Discussion
input,output and timing is much easier, when you allow multiple
solutions and just count the solutions instead of printing them.
e.g.:
.........
.........
.........
...975684
...821793
...436512
...582936
...693471
...714825
230400 solutions, 15sec*GHz = 1.5e10 CPU-cycles.
Only one puzzle needed for the whole contest !
-
Re: Contest 6 - Sudoku solver - Discussion
my 100 hardest sudokus:
http://magictour.free.fr/top100
284ms*GHz
-
Re: Contest 6 - Sudoku solver - Discussion
:lol: dukuso, I think we have already decided that sudokus with multiple solutions are not considered "proper" and that we aren't going to use them. :)
-
Re: Contest 6 - Sudoku solver - Discussion
then maybe for the next contest on another webpage using another language...
And you can still use them here "inofficially" for comparing your solvers.
I'm planning to use the winning program for rating hard sudokus -
provided it does perform well on hard sudokus and not only on the easy ones.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by dukuso
input,output and timing is much easier, when you allow multiple
solutions and just count the solutions instead of printing them.
e.g.:
.........
.........
.........
...975684
...821793
...436512
...582936
...693471
...714825
230400 solutions, 15sec*GHz = 1.5e10 CPU-cycles.
Only one puzzle needed for the whole contest !
Interesting... my solver counts this in 4600 ms. It gives a valid answer, 230400 solutions.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by eyeRmonkey
I like that idea, but it is probably up to manavo for the final decision.
I was also wondering if we could get a final say-so as to wether the judges will be testing compiled code or in the IDE? It would just make me feel more confident in what I am testing. If they do it compiled I would assume most optimizations would be on? Of course that could cause some programs to crash, but if they did crash, then they probably wouldn't have won anyway? Can give word on this subject manavo?
You people post too much :)
Don't know how to test... But however it is, all the entries will be marked with the same standards so don't worry :)
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by NotLKH
Do you think the requirements should be tweaked a bit?
It seems that many of you can handle processing directories of submissions en masse.
Let's see :)
Quote:
Originally Posted by NotLKH
For the contest, it would seem like it'd be easier to judge if the progie, upon clicking "Start", that it should query for a source directory, whereby all the .msk files reside that need to be solved.
As each one is solved, the solution you've generated would be outputted to a directory parrallel to the source directory, generated by you, and recognizably named after your username. Also, once solved, a timing file is created, with the time you've detected it took to solve a submission.
I like the idea, and that way we can test a lot of sudokus instead of manually putting a few ;)
Quote:
Originally Posted by NotLKH
An option control would also be resident on your form, to toggle between "Silent" mode, and "Visual" mode {ie.. just outputing to screen your solutions, as you solve them.}
Doesn't seem that important a "feature"...
Quote:
Originally Posted by NotLKH
Thus, as the judges run each entrant, all they have to do is build a compiler to return the results of ALL the entrants, plus it would also compare the entrants solutions against the "official" .sol file.
This way, you could place any optimizations into the form_load event that you want, that don't need to ever be regenerated when you do mass processing.
-Lou
I like the idea :) I have to read farther down to see the rest of the posts and compare... Hold on :)
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by Merri
NotLKH: I don't like the idea as such, I want some freedom to the design. So cleaned up:
- there must be an option to pick a folder with the sudokus
Yes
Quote:
Originally Posted by Merri
- the folder files must be easy to benchmark
What exactly do you mean?
Quote:
Originally Posted by Merri
- the timing results must be outputted so that they're viewable by the user
In a seperate file I guess, a list with all of them and the times or something like that.
Quote:
Originally Posted by Merri
- the solutions should be outputted into a user configurable directory if the user wants
That's the whole point, to compare them after ;)
Quote:
Originally Posted by Merri
I don't want to create a separate "silent" mode. I have added some visual candy so that it is easier for a human to check if the results are valid... though these are just nice extra. But the above mentioned changes/requirements should be enough?
Doesn't seem that important the silent mode...
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by NotLKH
Well, I don't disagree with what you've suggested,
however, the timings should also not only be viewable, but also outted to a data file.
That way the judges won't have to manually tabulate the results, especially if they use the number of puzzles I can potentially provide.
Yes :)
Quote:
Originally Posted by NotLKH
The "Silent" mode is just a streamlining, so that the judges don't have to put up with screen outputs & updates.
Never mind with this, it's not a big issue...
Quote:
Originally Posted by NotLKH
And, your suggestion to be able to "Pick" a folder, well, again, all well and good. But Pasting the path is what I'd prefer, or even Drag and Drop, if I was forced to run/judge the entrents.
In inputbox or something to input a dir is just fine, nothing fancy.
-
Re: Contest 6 - Sudoku solver - Discussion
Alright then, to sum it up :
-Prompt for input of the directory containing the sudokus
-Read all sudoku files in the specified folder
-Output the solved sudoku in a folder in the app path folder with the username of the contestant
-Time and keep track of the time for each sudoku solved and output in a list at the end
Is this about it? Any other suggestions? Did I miss anything? :
-
Re: Contest 6 - Sudoku solver - Discussion
Only a small addition: "include a feature to output the solved sudoku within a folder in the app path folder with the username of the contest" - I don't want the program to output the sudokus each time I do something, that'd kill my laptop's harddisk (it is a slow one, listening to music can kill it every now and then).
On the other news... I finally coded a new logic to my code instead of optimizing the old ones. It is successful enough, NotLKH1 now below 4 ms. Overall I were very happy to see the new logic drop the required time in many of the sudokus :)
On the sad news, it seems I don't have many logic choices left... most are too complex to code, they'd just slow down the execution.
-
1 Attachment(s)
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by dukuso
I threw together a program to split these into .msk files.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by Merri
Only a small addition: "include a feature to output the solved sudoku within a folder in the app path folder with the username of the contest" - I don't want the program to output the sudokus each time I do something, that'd kill my laptop's harddisk (it is a slow one, listening to music can kill it every now and then).
So how do you suggest we show what our solver got as a solution?
-
Re: Contest 6 - Sudoku solver - Discussion
Because the same function is used, I don't see a problem? My program can actually solve the puzzle without displaying the result or storing it in any way. However, I can get it if I want to. Codewise:
- OpenSudoku (Function Boolean)
- PrepareSudoku (Sub ByRef SudokuBoard() As Byte)
- ReturnSudoku (Sub ByRef SudokuBoard() As Byte)
- SolveSudoku (Function Boolean)
If I call OpenSudoku, it returns True if it opens the file. OpenSudoku also calls PrepareSudoku which initializes the sudoku for processing. Currently this function seems to be able to open any known sudoku file format.
If I call PrepareSudoku, I give it a byte array with a puzzle in it. It then initializes the sudoku for processing.
If I call ReturnSudoku, I give it a byte array in which I want to have the current puzzle. It then fills this byte array (and resizes it if need be) with the values.
If I call SolveSudoku, it solves the current puzzle. It returns False if it fails (and it will do that only if you give it an invalid sudoku).
I have thought about adding SaveSudoku. Anyways, the point with the above: I don't need to think about returning a completed sudoku or problems with opening a file. Example code:
VB Code:
OpenSudoku "c:\test.sdk"
SolveSudoku
It opens the file and solves it. No need to display it or get a return value.
VB Code:
Dim SudokuBoard(80) As Byte
PrepareSudoku SudokuBoard
SolveSudoku
ReturnSudoku SudokuBoard
MsgBox StrConv(SudokuBoard, vbUnicode)
This code solves an empty board and shows the results as a one lined string in a message box.
Edit Duh, probably misread it before... I show my results visually, but there is no problem doing an other kind of output.
-
Re: Contest 6 - Sudoku solver - Discussion
Well, thanks for giving me about 20 tips as to how to modify my program to me more like yours. ;)
My point is that I ASSUME yours can only display 1 board at a time visually. That doesn't allow for mass processing AND mass output. So either the tester has to ensure that function to check the validity of a sudoku is correct or the tester needs to solve 1 at a time and compare the visual results with the actual solution in some way.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by eyeRmonkey
I threw together a program to split these into .msk files.
It seems that I have a LOONG way to go...
Code:
dukuso's_hardest_000.msk SOLVED in 1,814.934859 milliseconds !
dukuso's_hardest_001.msk SOLVED in 20,988.223364 milliseconds !
dukuso's_hardest_002.msk SOLVED in 1,084.403185 milliseconds !
dukuso's_hardest_003.msk SOLVED in 7,949.478775 milliseconds !
dukuso's_hardest_004.msk SOLVED in 517.331672 milliseconds !
dukuso's_hardest_005.msk SOLVED in 688.069573 milliseconds !
dukuso's_hardest_006.msk SOLVED in 28.336004 milliseconds !
dukuso's_hardest_007.msk SOLVED in 34.762239 milliseconds !
dukuso's_hardest_008.msk SOLVED in 116.598339 milliseconds !
dukuso's_hardest_009.msk SOLVED in 180.910982 milliseconds !
dukuso's_hardest_010.msk SOLVED in 1,317.542872 milliseconds !
dukuso's_hardest_011.msk SOLVED in 816.710504 milliseconds !
dukuso's_hardest_012.msk SOLVED in 63.958408 milliseconds !
dukuso's_hardest_013.msk SOLVED in 66.043031 milliseconds !
dukuso's_hardest_014.msk SOLVED in 29.587839 milliseconds !
dukuso's_hardest_015.msk SOLVED in 349.861784 milliseconds !
dukuso's_hardest_016.msk SOLVED in 822.774403 milliseconds !
dukuso's_hardest_017.msk SOLVED in 1,103.592216 milliseconds !
dukuso's_hardest_018.msk SOLVED in 7,181.811375 milliseconds !
dukuso's_hardest_019.msk SOLVED in 1,841.077288 milliseconds !
dukuso's_hardest_020.msk SOLVED in 478.773420 milliseconds !
dukuso's_hardest_021.msk SOLVED in 127.953134 milliseconds !
dukuso's_hardest_022.msk SOLVED in 1,874.943324 milliseconds !
dukuso's_hardest_023.msk SOLVED in 1,569.060034 milliseconds !
dukuso's_hardest_024.msk SOLVED in 3,256.705810 milliseconds !
dukuso's_hardest_025.msk SOLVED in 1,184.486576 milliseconds !
dukuso's_hardest_026.msk SOLVED in 1,127.795851 milliseconds !
dukuso's_hardest_027.msk SOLVED in 525.698378 milliseconds !
dukuso's_hardest_028.msk SOLVED in 641.548018 milliseconds !
dukuso's_hardest_029.msk SOLVED in 4,680.740709 milliseconds !
dukuso's_hardest_030.msk SOLVED in 2.567365 milliseconds !
dukuso's_hardest_031.msk SOLVED in 2,191.370691 milliseconds !
dukuso's_hardest_032.msk SOLVED in 1,568.653279 milliseconds !
dukuso's_hardest_033.msk SOLVED in 926.920042 milliseconds !
dukuso's_hardest_034.msk SOLVED in 72.577939 milliseconds !
dukuso's_hardest_035.msk SOLVED in 1,122.788511 milliseconds !
dukuso's_hardest_036.msk SOLVED in 17,217.268955 milliseconds !
dukuso's_hardest_037.msk SOLVED in 3.290642 milliseconds !
dukuso's_hardest_038.msk SOLVED in 158.018407 milliseconds !
dukuso's_hardest_039.msk SOLVED in 2,711.075849 milliseconds !
dukuso's_hardest_040.msk SOLVED in 4,585.880887 milliseconds !
dukuso's_hardest_041.msk SOLVED in 235.107255 milliseconds !
dukuso's_hardest_042.msk SOLVED in 7,684.072696 milliseconds !
dukuso's_hardest_043.msk SOLVED in 2,694.652533 milliseconds !
dukuso's_hardest_044.msk SOLVED in 94.306679 milliseconds !
dukuso's_hardest_045.msk SOLVED in 3.803835 milliseconds !
dukuso's_hardest_046.msk SOLVED in 1,171.015031 milliseconds !
dukuso's_hardest_047.msk SOLVED in 492.836939 milliseconds !
dukuso's_hardest_048.msk SOLVED in 1,336.245249 milliseconds !
dukuso's_hardest_049.msk SOLVED in 1,851.328311 milliseconds !
dukuso's_hardest_050.msk SOLVED in 1,563.441443 milliseconds !
dukuso's_hardest_051.msk SOLVED in 229.470226 milliseconds !
dukuso's_hardest_052.msk SOLVED in 1,751.772362 milliseconds !
dukuso's_hardest_053.msk SOLVED in 5,373.513952 milliseconds !
dukuso's_hardest_054.msk SOLVED in 3.258794 milliseconds !
dukuso's_hardest_055.msk SOLVED in 2,124.089794 milliseconds !
dukuso's_hardest_056.msk SOLVED in 362.830751 milliseconds !
dukuso's_hardest_057.msk SOLVED in 697.073511 milliseconds !
dukuso's_hardest_058.msk SOLVED in 3,070.439399 milliseconds !
dukuso's_hardest_059.msk SOLVED in 31.392537 milliseconds !
dukuso's_hardest_060.msk SOLVED in 592.567491 milliseconds !
dukuso's_hardest_061.msk SOLVED in 131.283725 milliseconds !
dukuso's_hardest_062.msk SOLVED in 5.294528 milliseconds !
dukuso's_hardest_063.msk SOLVED in 186.337370 milliseconds !
dukuso's_hardest_064.msk SOLVED in 499.935327 milliseconds !
dukuso's_hardest_065.msk SOLVED in 2,933.956690 milliseconds !
dukuso's_hardest_066.msk SOLVED in 3,703.020635 milliseconds !
dukuso's_hardest_067.msk SOLVED in 81.654791 milliseconds !
dukuso's_hardest_068.msk SOLVED in 1,566.145418 milliseconds !
dukuso's_hardest_069.msk SOLVED in 16.566351 milliseconds !
dukuso's_hardest_070.msk SOLVED in 6,697.108990 milliseconds !
dukuso's_hardest_071.msk SOLVED in 138.773783 milliseconds !
dukuso's_hardest_072.msk SOLVED in 3,035.243027 milliseconds !
dukuso's_hardest_073.msk SOLVED in 2,812.802465 milliseconds !
dukuso's_hardest_074.msk SOLVED in 1,645.052933 milliseconds !
dukuso's_hardest_075.msk SOLVED in 71.782028 milliseconds !
dukuso's_hardest_076.msk SOLVED in 1,567.040783 milliseconds !
dukuso's_hardest_077.msk SOLVED in 4.113372 milliseconds !
dukuso's_hardest_078.msk SOLVED in 160.286852 milliseconds !
dukuso's_hardest_079.msk SOLVED in 209.047519 milliseconds !
dukuso's_hardest_080.msk SOLVED in 1,637.917668 milliseconds !
dukuso's_hardest_081.msk SOLVED in 158.578255 milliseconds !
dukuso's_hardest_082.msk SOLVED in 106.245906 milliseconds !
dukuso's_hardest_083.msk SOLVED in 422.900117 milliseconds !
dukuso's_hardest_084.msk SOLVED in 586.114716 milliseconds !
dukuso's_hardest_085.msk SOLVED in 343.262901 milliseconds !
dukuso's_hardest_086.msk SOLVED in 276.229521 milliseconds !
dukuso's_hardest_087.msk SOLVED in 100.897181 milliseconds !
dukuso's_hardest_088.msk SOLVED in 585.171858 milliseconds !
dukuso's_hardest_089.msk SOLVED in 75.375781 milliseconds !
dukuso's_hardest_090.msk SOLVED in 5,191.501993 milliseconds !
dukuso's_hardest_091.msk SOLVED in 1,175.437940 milliseconds !
dukuso's_hardest_092.msk SOLVED in 2.269283 milliseconds !
dukuso's_hardest_093.msk SOLVED in 2,440.270202 milliseconds !
dukuso's_hardest_094.msk SOLVED in 7,537.211852 milliseconds !
dukuso's_hardest_095.msk SOLVED in 327.713718 milliseconds !
dukuso's_hardest_096.msk SOLVED in 111.759176 milliseconds !
dukuso's_hardest_097.msk SOLVED in 1,912.464852 milliseconds !
dukuso's_hardest_098.msk SOLVED in 38.651560 milliseconds !
dukuso's_hardest_099.msk SOLVED in 19.043202 milliseconds !
Files Processed: 100, Total Solved: 100, Total time: 172,901.809588, Average Time: 1,729.018096
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by eyeRmonkey
Well, thanks for giving me about 20 tips as to how to modify my program to me more like yours. ;)
Could you highlight those 20 tips somehow ? Cuz I didn’t get any tips from anyone, maybe I’m just too blind to see them.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by CVMichael
Could you highlight those 20 tips somehow ? Cuz I didn’t get any tips from anyone, maybe I’m just too blind to see them.
:lol: Well maybe its just because my program is so messed up to start with, but he uses a bunch of things that seem much faster that what I am using. I'm not gonna tell you if you don't know. You probably don't see them because you are already doing things similar to what he posted.
I get the feeling you are doing something wrong because nothing takes me more than 20 ms in the IDE and nothing takes more than 6 ms in .EXE.
I wish this contest wasn't a contest because I am so curious to see how everyone is doing what they are doing. I guess I will just have to wait and see.
-
1 Attachment(s)
Re: Contest 6 - Sudoku solver - Discussion
I've been giving so many tips here that it is making me sick! You can conclude all kinds of stuff from what I've said. A programmer needs his social skills too!
eyeRmonkey: I could do mass output while doing benchmarking for example. Because of the interface, it is easy to use the solver as I like. Currently the visual view isn't linked to my benchmarker in any way.
More sudokus! These include the hardest I've found so far. Beware the minimal sudokus!
-
Re: Contest 6 - Sudoku solver - Discussion
You can clearly see when my backtracker kicks in...
Code:
000.txt - 2.5243 ms
001.txt - 1.6399 ms
002.txt - 3.6608 ms
003.txt - 3.8343 ms
004.txt - 1.3488 ms
005.txt - 4.3369 ms
006.txt - 1.9092 ms
007.txt - 2.1768 ms
008.txt - 2.3430 ms
009.txt - 1.8094 ms
010.txt - 1.4924 ms
011.txt - 2.3746 ms
012.txt - 1.9064 ms
013.txt - 2.5506 ms
014.txt - 1.8986 ms
015.txt - 1.5441 ms
016.txt - 1.4773 ms
017.txt - 1.4980 ms
018.txt - 1.6913 ms
019.txt - 1.5793 ms
020.txt - 1.2935 ms
021.txt - 1.2429 ms
022.txt - 1.0985 ms
023.txt - 1.1085 ms
024.txt - 2,165.0185 ms
025.txt - 1.2644 ms
026.txt - 1.5725 ms
027.txt - 2.4539 ms
028.txt - 3.1381 ms
029.txt - 1.6276 ms
030.txt - 2.3740 ms
031.txt - 2.1142 ms
032.txt - 2.0883 ms
033.txt - 2.2978 ms
034.txt - 2.6434 ms
035.txt - 1.0959 ms
036.txt - 1.2834 ms
037.txt - 1.5156 ms
038.txt - 2.1260 ms
039.txt - 1.0806 ms
040.txt - 13.0533 ms
041.txt - 1.6441 ms
042.txt - 2.5411 ms
043.txt - 14.7834 ms
044.txt - 1.7553 ms
045.txt - 1.5991 ms
046.txt - 1.5955 ms
047.txt - 1.3334 ms
048.txt - 1.5172 ms
049.txt - 1.2474 ms
050.txt - 1.4616 ms
051.txt - 1.7994 ms
052.txt - 1.3764 ms
053.txt - 1.3692 ms
054.txt - 1.9201 ms
055.txt - 1.4960 ms
056.txt - 6.2961 ms
057.txt - 3.2194 ms
058.txt - 1.8399 ms
059.txt - 1.3069 ms
060.txt - 1.1180 ms
061.txt - 1.3627 ms
062.txt - 1.1957 ms
063.txt - 1.0683 ms
064.txt - 1.8108 ms
065.txt - 1.1515 ms
066.txt - 1.4250 ms
067.txt - 4.3992 ms
068.txt - 1.9536 ms
069.txt - 1.2256 ms
070.txt - 1.1806 ms
071.txt - 1.5387 ms
072.txt - 1.6038 ms
073.txt - 2.5154 ms
074.txt - 1.5642 ms
075.txt - 4.5545 ms
076.txt - 2.0142 ms
077.txt - 13.1447 ms
078.txt - 2.1045 ms
079.txt - 1.8279 ms
080.txt - 1.3678 ms
081.txt - 1.2217 ms
082.txt - 1.5798 ms
083.txt - 1.3865 ms
084.txt - 1.3111 ms
085.txt - 1.7122 ms
086.txt - 2.7124 ms
087.txt - 1.4714 ms
088.txt - 2.0648 ms
089.txt - 1.4982 ms
090.txt - 59.5964 ms
091.txt - 23.1236 ms
092.txt - 1.3370 ms
093.txt - 14.7910 ms
094.txt - 1.5555 ms
095.txt - 46.4939 ms
096.txt - 2.4076 ms
097.txt - 1.5220 ms
098.txt - 8.4944 ms
099.txt - 23.8248 ms
100.txt - 1.4287 ms
101.txt - 1.4720 ms
102.txt - 1.5854 ms
103.txt - 1.3457 ms
104.txt - 1.4080 ms
105.txt - 1.5963 ms
106.txt - 2.0964 ms
107.txt - 1.5874 ms
108.txt - 1.4552 ms
109.txt - 1.6097 ms
110.txt - 1.8703 ms
111.txt - 3.0954 ms
112.txt - 16.4867 ms
113.txt - 67.2197 ms
114.txt - 1.7905 ms
115.txt - 1.5921 ms
116.txt - 1.8402 ms
117.txt - 35.7082 ms
118.txt - 389.6585 ms
119.txt - 1.6999 ms
120.txt - 2.8425 ms
121.txt - 586.9436 ms
122.txt - 527.5914 ms
123.txt - 123.2903 ms
124.txt - 1.8921 ms
125.txt - 3.0135 ms
126.txt - 1.5739 ms
127.txt - 1.2356 ms
128.txt - 10.4108 ms
129.txt - 4.1494 ms
130.txt - 2.7478 ms
131.txt - 1,927.2868 ms
132.txt - 1,105.3690 ms
133.txt - 1.2678 ms
134.txt - 1.2742 ms
135.txt - 1.3024 ms
136.txt - 1.5410 ms
137.txt - 1.2650 ms
138.txt - 1.1406 ms
139.txt - 1.4091 ms
140.txt - 1.7388 ms
141.txt - 1.5860 ms
142.txt - 7.2414 ms
143.txt - 4.7660 ms
144.txt - 18.2314 ms
145.txt - 1.2354 ms
146.txt - 1.6661 ms
147.txt - 2.3070 ms
148.txt - 2.0656 ms
149.txt - 4.6436 ms
150.txt - 6.8964 ms
151.txt - 3.2093 ms
152.txt - 1.4150 ms
153.txt - 1.1180 ms
154.txt - 27.4661 ms
155.txt - 1.4561 ms
156.txt - 1.5779 ms
157.txt - 1.2940 ms
158.txt - 1.3762 ms
159.txt - 1.0985 ms
160.txt - 3.2728 ms
161.txt - 1.3046 ms
162.txt - 1.1054 ms
163.txt - 1.0675 ms
164.txt - 1.2166 ms
165.txt - 1.0627 ms
166.txt - 1.4940 ms
167.txt - 1.2060 ms
168.txt - 2.3274 ms
169.txt - 1.1971 ms
170.txt - 1.3309 ms
171.txt - 1.9651 ms
172.txt - 1.9438 ms
173.txt - 237.1480 ms
174.txt - 1.3985 ms
175.txt - 1.1680 ms
176.txt - 33.5540 ms
177.txt - 3.2552 ms
178.txt - 1.4963 ms
179.txt - 1.0946 ms
180.txt - 1.2113 ms
181.txt - 5.6348 ms
182.txt - 6.2782 ms
183.txt - 26.4176 ms
184.txt - 26.5500 ms
185.txt - 68.9856 ms
186.txt - 4.4967 ms
187.txt - 1.6952 ms
188.txt - 670.1908 ms
189.txt - 198.3515 ms
190.txt - 401.3748 ms
191.txt - 479.8657 ms
192.txt - 1.7092 ms
193.txt - 3.3415 ms
194.txt - 2.2631 ms
195.txt - 2.6632 ms
196.txt - 4.6738 ms
197.txt - 1.7681 ms
198.txt - 7.4711 ms
199.txt - 2.3598 ms
200.txt - 1.1496 ms
201.txt - 1.2275 ms
202.txt - 17.7031 ms
203.txt - 1.1018 ms
204.txt - 1.2094 ms
205.txt - 1.2460 ms
206.txt - 3.7854 ms
207.txt - 1.3362 ms
208.txt - 1.2080 ms
209.txt - 1.2155 ms
210.txt - 2.7040 ms
211.txt - 4.0019 ms
212.txt - 1.2261 ms
213.txt - 1.2817 ms
214.txt - 1.5742 ms
215.txt - 1.3999 ms
216.txt - 1.4611 ms
217.txt - 1.9525 ms
218.txt - 1.4502 ms
219.txt - 1.3136 ms
220.txt - 9.6685 ms
221.txt - 1.3965 ms
222.txt - 1.5614 ms
223.txt - 1.0677 ms
224.txt - 1.1895 ms
225.txt - 1.3044 ms
226.txt - 1.1222 ms
227.txt - 1.6315 ms
228.txt - 1.1457 ms
229.txt - 1.4474 ms
230.txt - 1.3091 ms
231.txt - 2.2145 ms
232.txt - 2.2321 ms
233.txt - 214.5468 ms
234.txt - 0.9127 ms
235.txt - 0.9163 ms
236.txt - 1.1158 ms
237.txt - 1.5547 ms
238.txt - 1.4602 ms
239.txt - 1.9835 ms
240.txt - 1.1862 ms
241.txt - 1.7664 ms
242.txt - 1.3854 ms
243.txt - 3.3957 ms
244.txt - 1.9391 ms
245.txt - 2.2852 ms
246.txt - 1.6265 ms
247.txt - 3.0825 ms
248.txt - 2.3813 ms
249.txt - 1.6485 ms
250.txt - 1.2588 ms
251.txt - 1.5019 ms
252.txt - 1.4295 ms
253.txt - 1.9860 ms
254.txt - 1.3041 ms
255.txt - 1.2560 ms
256.txt - 0.9501 ms
257.txt - 2.3631 ms
258.txt - 1.4809 ms
259.txt - 4.0541 ms
260.txt - 4.0631 ms
261.txt - 2.0218 ms
262.txt - 2.0195 ms
263.txt - 2.2469 ms
264.txt - 1.9678 ms
265.txt - 2.0215 ms
266.txt - 2.8962 ms
267.txt - 109.0035 ms
268.txt - 1.7986 ms
269.txt - 3.2462 ms
270.txt - 1.9257 ms
271.txt - 1.6617 ms
272.txt - 1.4591 ms
273.txt - 37.5411 ms
274.txt - 86.3216 ms
275.txt - 1.5591 ms
276.txt - 23.0764 ms
277.txt - 24.5313 ms
278.txt - 242.9060 ms
279.txt - 53.6814 ms
280.txt - 1.6443 ms
281.txt - 2.1732 ms
282.txt - 187.9719 ms
283.txt - 227.5588 ms
284.txt - 0.9300 ms
285.txt - 1.0236 ms
286.txt - 0.9417 ms
287.txt - 0.9303 ms
288.txt - 1.2446 ms
289.txt - 1.2625 ms
290.txt - 1.8128 ms
291.txt - 1.1476 ms
292.txt - 1.3999 ms
293.txt - 4.5310 ms
294.txt - 2.4685 ms
295.txt - 1.1985 ms
296.txt - 1.6913 ms
297.txt - 1.8972 ms
298.txt - 1.1985 ms
299.txt - 1.2133 ms
300.txt - 3.6063 ms
301.txt - 1.6997 ms
302.txt - 1.7290 ms
303.txt - 2.3475 ms
304.txt - 3.5611 ms
305.txt - 1.2546 ms
306.txt - 1.7466 ms
307.txt - 1.2566 ms
308.txt - 1.4812 ms
309.txt - 1.2963 ms
310.txt - 5.8952 ms
311.txt - 1.4616 ms
312.txt - 1.2756 ms
313.txt - 1.7656 ms
314.txt - 1.3309 ms
315.txt - 1.9461 ms
316.txt - 1.5927 ms
317.txt - 1.7273 ms
318.txt - 6.4869 ms
319.txt - 6.9157 ms
320.txt - 2.3590 ms
321.txt - 1.4340 ms
322.txt - 1.1091 ms
323.txt - 5.1484 ms
324.txt - 11.4285 ms
325.txt - 21,115.4932 ms
326.txt - 1.9827 ms
327.txt - 1.1555 ms
328.txt - 1.9019 ms
329.txt - 1.7242 ms
330.txt - 1.1974 ms
331.txt - 1.2722 ms
332.txt - 2.0813 ms
333.txt - 1.2010 ms
334.txt - 2.2743 ms
335.txt - 4.8221 ms
336.txt - 2.0695 ms
337.txt - 2.2869 ms
338.txt - 2.7138 ms
339.txt - 5.9994 ms
340.txt - 1.7100 ms
341.txt - 2.1274 ms
342.txt - 1.3647 ms
343.txt - 1.7723 ms
344.txt - 21.6606 ms
345.txt - 1.5130 ms
346.txt - 1.4669 ms
347.txt - 1.4276 ms
348.txt - 2.6095 ms
349.txt - 2.7621 ms
350.txt - 2.2874 ms
351.txt - 3.0127 ms
352.txt - 2.6696 ms
353.txt - 1.3521 ms
354.txt - 1.5318 ms
355.txt - 1.8106 ms
356.txt - 1.4516 ms
357.txt - 1.4767 ms
358.txt - 1.2449 ms
359.txt - 1.9022 ms
360.txt - 361.5337 ms
361.txt - 236.3859 ms
362.txt - 1.9494 ms
363.txt - 2.6196 ms
364.txt - 1.4915 ms
365.txt - 2.5825 ms
366.txt - 1.7539 ms
367.txt - 1.4435 ms
368.txt - 1.7161 ms
369.txt - 1.7969 ms
370.txt - 4.7042 ms
371.txt - 3.0537 ms
372.txt - 1.8821 ms
373.txt - 1.7731 ms
374.txt - 1.9718 ms
375.txt - 1.4703 ms
376.txt - 0.9954 ms
377.txt - 4.3137 ms
378.txt - 1.2261 ms
379.txt - 1.3312 ms
380.txt - 1.0878 ms
381.txt - 1.3024 ms
382.txt - 2.3120 ms
383.txt - 2.0609 ms
384.txt - 1.1166 ms
385.txt - 2.3299 ms
386.txt - 2.4400 ms
387.txt - 1.1203 ms
388.txt - 2.0933 ms
389.txt - 1.2493 ms
390.txt - 1.1144 ms
391.txt - 1.2513 ms
392.txt - 4.1773 ms
393.txt - 3.7508 ms
394.txt - 3.3091 ms
395.txt - 1.0767 ms
396.txt - 2.2911 ms
397.txt - 2.5045 ms
398.txt - 1.7458 ms
399.txt - 9.1302 ms
400.txt - 1.5270 ms
401.txt - 1.2694 ms
402.txt - 1.5899 ms
403.txt - 6.9984 ms
404.txt - 1.4055 ms
405.txt - 3.1686 ms
406.txt - 2.2707 ms
407.txt - 1.2387 ms
408.txt - 2.4092 ms
409.txt - 1.5748 ms
410.txt - 1.8944 ms
411.txt - 1.7974 ms
412.txt - 1.4086 ms
413.txt - 1.2680 ms
414.txt - 1.5644 ms
415.txt - 1.6050 ms
416.txt - 1.6125 ms
417.txt - 1.3060 ms
418.txt - 2.2151 ms
419.txt - 1.3884 ms
420.txt - 3.7485 ms
421.txt - 2.0447 ms
422.txt - 1.2345 ms
423.txt - 1.7072 ms
424.txt - 1.8807 ms
425.txt - 4.9638 ms
426.txt - 2.1145 ms
427.txt - 2.5554 ms
428.txt - 1.9374 ms
429.txt - 2.1673 ms
430.txt - 1.4885 ms
431.txt - 17.9185 ms
432.txt - 5.6007 ms
433.txt - 2.5783 ms
434.txt - 1.8189 ms
435.txt - 1.8069 ms
436.txt - 1.0962 ms
437.txt - 1.9885 ms
438.txt - 1.3789 ms
439.txt - 1.1270 ms
440.txt - 1.5904 ms
441.txt - 1.7938 ms
442.txt - 1.3627 ms
443.txt - 1.2074 ms
444.txt - 1.4555 ms
445.txt - 2.3179 ms
446.txt - 2.1503 ms
447.txt - 1.0613 ms
448.txt - 1.8025 ms
449.txt - 1.2951 ms
450.txt - 1.7851 ms
Files Processed: 451, Total Solved: 451, Total time: 33,173.741076, Average Time: 73.555967
I'm at the point of giving up on this thing, I've spent a TON of time on this, and I didn't make much improvement in speed.
-
Re: Contest 6 - Sudoku solver - Discussion
I give you a BIG tip: make your backtracker use the same code you use for logic. My history: I first made my fast logic thingy, then I made a different backtracker, then I combined the both, then I saw I just couldn't make it good with the backtracker I had, I dumbed it out and made a new backtracker based on the existing logic.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by CVMichael
You can clearly see when my backtracker kicks in...
....
I'm at the point of giving up on this thing, I've spent a TON of time on this, and I didn't make much improvement in speed.
How did you get your times down to so low all of the sudden? The last set of times you posted were in the 50-1000 range. Now you have 1-2 ms and 1000-2000ms. Were the last speeds you posted from the IDE?
-
1 Attachment(s)
Re: Contest 6 - Sudoku solver - Discussion
For all the lurkers out there: :wave:
NotLKH1, 69 files, ~15ms
NotLKH2, 532 files, ~187ms
NotLKH3, 123 files, ~55ms
Merri's Hardest, 337 files, ~513ms
Dukuso's Hardest, 100 files, ~275ms
No time for minimum sudokus as they don't have the format of the rest *.msk files. Attaching an image of my user interface - nothing fancy here. I output solutions of all directory *.msk files on the clipboard like:
Code:
Filename: E:\Projects\dotNetProjects\_Personal_\Soduku\bin\FILES\0003_0003_022.msk
Solved in 0,46628574 ms
.........
..4..3...
.2.91.4.6
.........
...32..1.
95.....32
.1...5..7
..7....53
..6.4....
189476325
764253198
325918476
273591864
648327519
951864732
812635947
497182653
536749281
Filename: E:\Projects\dotNetProjects\_Personal_\Soduku\bin\FILES\0004_0001_022.msk
Solved in 0,34931381 ms
9..2.....
....5...8
..4.1...6
59...8...
63...7...
......95.
...9.3...
.6....84.
..1...6..
983276514
126354798
754819326
597148263
632597481
418632957
845963172
369721845
271485639
My tip: when you're done applying logic rules and you have to start guessing, don't just start with the first empty cell. Finding the right cell makes a huge difference in speed. :bigyello:
-
Re: Contest 6 - Sudoku solver - Discussion
Oh, oops. I didn't notice the format difference, my solver can load several file formats :D Actually, any file... It is fun to try to load Windows system files and see if there happen to be any valid sudokus!
Humm... wonder if I'll...
...I shall persist!
...no...
...what is this weird feeling...
...I can't hold it! NO!
NotLKH1: 2.9 ms (0.042 ms per file)
NotLKH2: 39 ms (0.073 ms per file)
NotLKH3: 13 ms (0.106 ms per file)
NotLKH4: 37 ms (0.071 ms per file)
Hardest: 85 ms (0.252 ms per file)
dukuso's TOP 100: 38 ms (0.38 ms per file)
Minimum: 73 ms (0.162 ms per file)
There we go.
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by Merri
...I can't hold it! NO!
...
There we go.
lol!
-
Re: Contest 6 - Sudoku solver - Discussion
Btw... should I some time actually solve a sudoku by myself? Still have never solved one.
-
Re: Contest 6 - Sudoku solver - Discussion
I suggest, at the very least,
Run your progie on some samples, but without backtracking.
Then output your Cells, the values of the solved ones, and the could_be's of the unsolved cells, in a human friendly fashion,
and THEN try to solve that by hand.
You should see some more strategies to throw into your progie that way.
:wave:
-Lou
-
Re: Contest 6 - Sudoku solver - Discussion
-
Re: Contest 6 - Sudoku solver - Discussion
Well, I've pretty much read up about all the strategies :) I'm thinking about it as a programming task, not as a solver. There is only one potential logic left that might be fast enough to implement into my solver... about all the other ones would be more of performance killers than of help. So I can't take that as an excuse to solve one :D
-
Re: Contest 6 - Sudoku solver - Discussion
Looks good.
"Option to output the solved sudoku in a folder in the app path folder with your username"
You might want to restrict the output filename a little bit more.
Someone might name them with no relation to the input file whatsoever.
I Doubt it, but its possible.
:wave:
[edit]
"Time and keep track of the time for each sudoku solved and output in a list at the end (with the total time if possible)"
You might also want to be strict about how the entries in this list are formatted.
What is the pertinant data?
Filename and seconds
Anything else?
What is the order of the data?
What deliminates each line of data?
What deliminates between the data of each line?
Some people use commas, some decimal points for the time. Is this an issue?
How should the total time entry be formatted and where should it go?
IF someones solver fails to solve a soduko, they still need to enter the time it took.
Should each line report the status of the processed sudoku? ie... "Solved" or "Failed"?
Hmmm, I think these are about all the potential issues.
:)
-Lou
-
Re: Contest 6 - Sudoku solver - Discussion
Lou, the input ones are *.msk and the output ones *.sol?
I'll edit it, thanks for the suggestion :)
Edited! Any more suggestions?
Thanks again :)
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
FileName001.msk: (SOLVED or FAILED) in 0,000000 seconds!
FileName002.msk: (SOLVED or FAILED) in 0,000000 seconds!
FileName003.msk: (SOLVED or FAILED) in 0,000000 seconds!
.
.
.
Total Time: 0,000000 seconds
I'm not sure why we are using a comma in the seconds. Is that suppose to be the decimal point in seconds (not milliseconds)? I'm assuming so.
-
Re: Contest 6 - Sudoku solver - Discussion
Yep. That's how I know it, "," decimal point and "." to show thousands, millions, etc...
-
Re: Contest 6 - Sudoku solver - Discussion
Quote:
Originally Posted by manavo11
Yep. That's how I know it, "," decimal point and "." to show thousands, millions, etc...
Ok, maybe I am an idiot, but you just confused me more. First off, since when does a "." mark thousands, millions, etc. and do you want any "."s in the time or just a "," where the decimal point normally is?
-
Re: Contest 6 - Sudoku solver - Discussion
That's how we learn it in Greece :ehh: The "." isn't needed. Or use the dot if you want in the Format function... Doesn't make much difference...