Sorry for the delay in getting results posted, the testing ran a bit longer than I expected and I did not have much time following the weekend I had set aside (last weekend I was speaking at a code camp, and this weekend I was camping/kayaking with my girlfriend).
I ran into a few problems generating the results for the submissions, mainly because none of them could pass my original tests. I try to write my tests before I receive any of the submissions because the method in which I write the tests can favor certain submissions over others. Due to this I was forced to rewrite all of my tests, my initial tests were done mainly on boards that were over size eight or larger.
There were two reasons why various submissions did not work well on larger problems. The largest was that they only used a brute force based search; the problem space grows exponentially so this quickly becomes a limiting factor. A brute force search could easily take one-hundred years to run on a board size of fifty-five.
The second limiting factor was people not capping their memory usage; this would quickly become an issue on larger boards as the number of possible positions grows exponentially. They would run out of memory and begin thrashing to disk. For extremely large puzzles you will actually be better off using disk but we will discuss this more later…
In the next ten or so analysis posts (roughly one a day) we will look more in depth at how we can help get around these two issues and allow our code to run efficiently on larger boards. It is important to note that this problem is NP Complete, whatever optimizations we add will eventually reach a failure point. As an example many used tables in varying forms to remember the positions they had seen in the past but at some point this optimization will fail due to not being able to save all previous positions any more (perhaps it’s a two GB limit for memory or a two TB limit if you are storing on disk either way you will eventually hit a board that you cannot possibly hold every previous position for). We will however continue this discussion in the analysis posts for now let’s get to the results.
Testing Methodology
To summarize the tests, all were written to operate upon leaf nodes in an n depth search. For instance a board size of five with a search depth of two would generate every possible board position on a board with 15 holes and 13 pegs. This makes for ease of generating large numbers and tends to help find algorithmic differences as it covers every possible position (and as we will see in analysis helps show one specific optimization).
Size | Depth | Total Positions |
5 | 1 | 15 |
6 | 1 | 21 |
7 | 1 | 28 |
5 | 2 | 210 |
6 | 2 | 420 |
7 | 2 | 756 |
5 | 3 | 2,730 |
6 | 3 | 7,980 |
7 | 3 | 19,656 |
5 | 4 | 32,760 |
5 | 5 | 360,360 |
As I have mentioned, the testing was a bit difficult since the engines were not able to run on the larger puzzles due to this not all submissions were run on the 7 size tests as some submissions would have taken a very long time to run on this test set (on the order of hours to weeks).
The Results
| 15-1 | 15-2 | 15-3 | 15-4 | 15-5 | 21-1 | 21-2 | 21-3 | 28-1 | 28-2 | 28-3 | Total | Errors |
Bowen | 0.00262 | 0.53161 | 0.53883 | 4.523 | 37.5729 | 0.000206 | 76.70967 | 10.46 | DNR | DNR | DNR | 130.3388 | Yes |
Brooks | 0.00947 | 0.02706 | 0.04794 | 0.38668 | 3.26843 | 0.01962 | 5.29703 | 0.96051 | DNR | DNR | DNR | 10.01674 | No |
Bushman | 0.01389 | 0.31435 | 2.14839 | 14.05154 | 86.34329 | 0.00774 | 150.8724 | 1650.721 | DNR | DNR | DNR | 1904.472 | No |
Laan | 0.01272 | 0.01865 | 0.019807 | 0.11418 | 2.51365 | 0.0078 | 0.02761 | 0.33106 | 2.53936 | 8.97131 | 32.12311 | 46.67926 | No |
Rasmus | 0.0073 | 0.0022 | 0.02157 | 0.25159 | 2.282763 | 0.00936 | 0.0224 | 0.12136 | 0.1843 | 1.67424 | 4.23623 | 8.813313 | No |
Rustad | 0.04127 | 0.42313 | 3.17082 | 21.40802 | 125.3042 | 0.00408 | 197.6765 | 2023.164 | DNR | DNR | DNR | 2371.192 | No |
Young | 0.00026 | 0.0081 | 0.00895 | 0.09986 | 0.98724 | 0.00047 | 0.002469 | 0.05961 | 0.06225 | 0.52418 | 1.80063 | 3.554019 | No |
Rasmus will receive a copy of Michael Abrash's "Zen of Code Optimization" and the managed bonus of "Algorithms" by Sedgewick for coming in with the fastest entry. Wil who won second place will receive a copy of George Polya's classic work "How To Solve It".
Let me the first to congratulate our winners Rasmus Faber-Espensen and Wil Laan for their great work on this problem.
Starting this evening we will delve deep into analysis of this problem.