questions regarding the use of A* with the 15-square puzzle

前端 未结 8 1925
无人共我
无人共我 2021-02-07 12:41

I\'m trying to build an A* solver for a 15-square puzzle.

The goal is to re-arrange the tiles so that they appear in their natural positions. You can only sli

8条回答
  •  不思量自难忘°
    2021-02-07 13:17

    Yes, that's how I've heard of this problem being done. g(x) is the number of tile slides that have taken place, and h(x) is the total distance that all tiles are from their required squares. I hadn't seen anything used but this approach (the Manhattan heuristic) before today, but just found this so-called diagonal shortcut -- you might want to check it out.

提交回复
热议问题