The principle of this heuristic is to use the goal's coordinate as a base for master block.
-
Move along horizontal line first and then go vertical to reach the goal.
-
Move along vertical line first and then go horizontal to reach the goal.
This method will detect if there are other sliding bricks on the way. If so, heuristic value will add 2 because you have to move bricks on the way to other places first then you can move master brick one step. If there are spot“0” on the way. Heuristic value will add only 1.
The heuristic value will take the minimum value of heu1 and heu2.