Fast and Powerful Javascript Helper/Solver

Programs which generate, solve, and analyze Sudoku puzzles

Fast and Powerful Javascript Helper/Solver

Postby jpg » Sun Jan 08, 2006 6:40 pm

jpg
 
Posts: 6
Joined: 08 January 2006

Postby tarek » Sun Jan 08, 2006 8:33 pm

My solver is javascript, but it struggles with very advanced puzzles requiring techniques above xy wings in terms of speed..........

somebody mentioned elsewhere that the problem is mainly due to language itself being slow as it depends on the browser. do you have the same problem ?

what impact would writing the whole script embedded in the .htm file instead of .js file have in terms of speed ?
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby jpg » Sun Jan 08, 2006 8:39 pm

Javascript is definitely slower than a compiled language, but it's more than fast enough for Sudoku with the right algorithms (Sudoku Helper can find chains of length 8 or 9 in just a few seconds). Embedding the script in the .htm file will have no effect on the speed.
jpg
 
Posts: 6
Joined: 08 January 2006

Postby tarek » Sun Jan 08, 2006 9:00 pm

thanx for that. the algorithms you use are short and concise, which will explain the efficiency. can you give me a tough puzzle (which your solver can solve) with the Time needed to solve it, so that i could see how much slower my solver is (i am assuming of course:D ).

I can attempt this on my own as your solver is available on the net. I hoped that you may have something already done.

regards,

tarek
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby jpg » Sun Jan 08, 2006 9:40 pm

Try selecting the puzzle called "1-constrained #6" which I think is the hardest example there. You'll have to time it on your own computer because the time it takes depends on the speed of the computer. You can also just browse through the examples and select ones to try on your program.

J.P.
jpg
 
Posts: 6
Joined: 08 January 2006

Postby tarek » Sun Jan 08, 2006 10:42 pm

I tried that one & used my stopwatch. Now I'm not sure that this was the best example becuase my solver used a different technique from yours at the end. I think the methods at the level of chains diverged. I'm sure that your solver is faster on most of the examples but this one my solver did in 2.5 Sec compared to 5 Sec from your solver.

I'll check the rest in due course & if I find any from my collection which you may find interesting, I'll post them to you.

regrds,

tarek
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby jpg » Sun Jan 08, 2006 11:50 pm

What is the URL for your solver? I'm curious to see what technique it used.
jpg
 
Posts: 6
Joined: 08 January 2006

Postby tarek » Mon Jan 09, 2006 12:03 am

I haven't put on the net yet (I've been saying this for 4 months now:D ).

The technique which I am talking about is valid but apparantly not many use it. I thought it was some form of Forcing chains but apparantly it isn't. It is not new, but apparantly not many use it.

I was just debating it with another member after I posted a reply in a thread asking for help with a diabolical Sudoku. try that puzzle & comapare it with mine & other techniques used in that thread.

I'm happy to post the solution technique if you still wanted to??
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby jpg » Mon Jan 09, 2006 4:36 am

I assume you mean the "Any candidate in A forces x in B" technique? I have seen that one debated before; I omitted that technique (and others that involve mutliple chains with positive assumptions at the heads) because many consider them to cross the T&E line. Although from a formal logic point of view it seems valid so I might reconsider.
jpg
 
Posts: 6
Joined: 08 January 2006

Postby tarek » Mon Jan 09, 2006 5:16 am

jpg wrote:I assume you mean the "Any candidate in A forces x in B" technique?


That is the one, & it was the technique needed to solve your puzzle. I'm not sure what to call so I started a thread to see what people would say (or re-say) about it
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006


Return to Software

cron