For the slide_puzzle problem, how to record the shortest path.
I have tried the bfs method, and also recorded its previous state for each state,as this said ,so that the path can be reconstructed at the end, which works well for the 3*3 problem.
But when n>4, the memory overflows.
Should I choose something more efficient like A star, or should I store a map of [prev,cur] states in a simpler way?
Is it reasonable to record only the coordinates of the points swapped with 0 as the current state each time?