I am doing the 8-puzzle challenge where I have to arrange the tiles in the right order with the shortest path cost. for my heuristic, I've combined the # of misplaced tiles+ distances of n tile to its goal position.
the goal is
1 2 3
8 0 4
7 6 5
for a puzzle like this
1 2 3
7 8 4
6 0 5
it works perfectly fine
but with this configuration
1 3 4
8 0 2
7 6 5
it infinitely chooses this combination as the shortest
1)
1 0 4
8 3 2
7 6 5
2)
1 3 4
8 0 2
7 6 5
then 1) then 2)