-
5 Comments
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?
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!