0

Is there any algorithm to find, number of moves required to solve 8-puzzle, or find the complexity of 8-puzzle?

I tried to check number of inversions in a problem, but it does not imply its complexity, i am looking for the best algorithm to find the number of moves in a given problem.

  • The answer to this question would depend on a number of unspecified things. Eg how are you able to check if the puzzle is in a currently solved state? Basically: What does the data representation of this problem look like? Currently we have no idea. It *might* be a 3x3 array containing integers 1-8, plus 0 for the unfilled space. But it could be literally anything. – FreelanceConsultant Apr 29 '23 at 15:28
  • A*? (https://blog.goodaudience.com/solving-8-puzzle-using-a-algorithm-7b509c331288) – Dave Apr 29 '23 at 15:55
  • You're not the first person to do this, just search the web for "algorithm for solving sliding 8 tile puzzle" or the like, and done. There are a whole lot of blog posts out there already that explain how to do this, no need for SO here. – Mike 'Pomax' Kamermans Apr 29 '23 at 16:04
  • "the number of moves" is not derived with a formula, but needs a search (or a database based on previous searches). So, solve the puzzle in an optimal way (using known techniques) and count the number of moves. The question of how to solve it, has been asked before, so this question will be closed. – trincot Apr 29 '23 at 16:19

0 Answers0