new puzzle challenge
|
03-30-2015, 04:35 AM
Post: #4
|
|||
|
|||
RE: new puzzle challenge
I wrote a recursive Python program to do a search with backtracking, and it finds 12 solutions, but only one is unique and the remainder are rotations and/or reflections. It would be much faster if written in C. It shouldn't be too difficult to translate the Python program to RPL, though it will take much longer to run on a 50g than the Python program takes on an x86.
I haven't figured out how to restrict the search space optimally to avoid rotations and reflections, but you can restrict it slightly. A row of three pieces must have at least one piece that is 11 or less. If you start from a row along one edge, and from one end of that edge, you only have to handle cases where that end piece is 1 through 11, or the end piece is greater than 11 and the middle piece of the row is 1 though 11. Unfortunately this doesn't actually speed up the program much if backtracking is used. On a 4.0 GHz AMD FX-8350 CPU, running Fedora 21 64-bit and Python 2.7.8, it finds the seven reported solutions in at elapsed times of 4.6, 8.0, 179.9, 200.8, 259.7, 265.2, and 917.9 seconds. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)