ShardFire wrote:
It seemed to hang for quite a while (maybe 10 seconds) on lvl504 for some reason. Must have been a particularly difficult one. 513 however was solved in about a second (after it had been downloaded).
It's an interesting problem, because you can get to various stages with progressively more scalable algorithms, and it's not always a matter of starting from scratch - in some cases the tweaks were relatively minor.
I'm now in a position where I can solve any puzzle in under 1.5 seconds. Only three of the 513 levels take longer that 1 second, and I can solve all of them (from predownloaded copies) in under a minute. It's a shame the server can't produce bigger boards - I'm wondering how far my algorithm actually would scale now.
Interestingly, I got to level 511 on an NP algorithm (refactored on level 98, and optimised to reduce memory usage by level 200) - some levels took a while, though (e.g. 5/20/40 minutes). Level 511, however, took over a day and still didn't get a solution - something about that one was particularly stressing my algorithm's lack of scalability.
It was only a relatively simple change to one of the lower level routines to get it to the point it's at now. I think that's what's interesting here - relatively simple tweaks to the algorithm can have such dramatic (and visible) effects.
Level 504 came about 15th for me, in terms of time taken, and 512/513 are the top two. It's interesting if different "good" algorithms have trouble on different levels - I guess it could be down to either randomization of generated levels, or fairly arbitrary preferences in the algorithms (e.g. prefer longer or shorter solutions, prefer horizontal before vertical moves).
In case it's of any interest, my solver is written in Python (which I'm not very experienced with), with a shell script harness to fetch pages and submit the solutions the script works out. Python's not the fastest language in the world, but I agree with points others have made - it's mostly about the algorithm, not the language. However, bad use of any language can cause terrible performance - especially when it comes to data structures.