This problem was so difficult for me to solve, would you mind explaining what search algorithm did you implement? Thanks.
It is a best-first search using a heuristic based on the sum of manhattan distances to target for each of the 26 tiles; solution 1310071 is slightly commented in case that helps
@daniel and by the way congrats on finishing all cody5-hard problems, that is quite an accomplishment! (I had it easier, having created a couple of problems in that same group, so mine does not count :)
I tried a similiar search but it did not end on time, and I don't know why.
PD: You're being too modest! I've been pulling all nighters all the week to finish them all, I'm sure it didn't take you all that time to solve them all.
PD2: I've made a problem (44390) in honour to all the suffering and latter satisfaction these 5th anniversay problems brought to me, you should check it out :)
I have tried something similar to this "best-first search" algorithm (if I understand the term correctly), but as I get closer to the final solution, I keep running into situations where all of the available moves move a tile out of its correct position, so my heuristic judges all of them equally, and the algorithm just starts making pseudo-random moves. Are you looking at all possibilities of some small number of moves, and picking one set of moves to move on from?
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office