I need some help finding a good heuristic for the following problem:
You are given an
R-by-C
Idea:
If you have to move in a straight line, the best you can do is to end your moves with 1 and 2, for all other moves you can't do better than 3.5*distance.
Heuristic:
With ManhattanDistance = x + y the following heuristic could be used:
Heuristic = xH + yH;
where
xH = calculateStraightLineHeuristic(x)
yH = calculateStraightLineHeuristic(y)
and the function calculateStraightLineHeuristic(z) is defined as follows:
calculateStraightLineHeuristic(z)
if (z = 1)
return zH = 1
elseif (z = 2)
return zH = 2+1
else
return zH = (z-2)*3.5+2+1
end