I am looking for an algorithm to solve a "sliding puzzle", the kind of puzzle where you have an image broken into 16 pieces in a 4x4 frame

freman1952 picture freman1952 · Jun 18, 2013 · Viewed 25.6k times · Source

I am looking for an algorithm to solve a "sliding puzzle", the kind of puzzle where you have an image broken into 16 pieces in a 4x4 frame, that you try to reassemble for a scrambled starting position. This particular puzzle has a restriction, the rows move only to the right (and wrap around), the whole row at once and the columns move only up (and wrap around), the whole column at once, both in one-tile steps. Is the math too complex? Anyone has experience with this kind of problem?

Answer

Mukul Joshi picture Mukul Joshi · Jun 18, 2013

This link will provide you the answer. They talk about the different distance functions used by the heuristic. A* is simpler to find open source implementations of.