Manhattan Distance
Manhattan Distance
between the current state and the goal state, helping search
algorithms to prioritize which states to expand next.
Heuristic functions are particularly useful in problems
like layout. The robot needs to find the shortest path from its
current location to a specific target location.
the robot must avoid. The robot can move only in four
directions: up, down, left, and right.
• The Manhattan Distance can be used as a heuristic function in
various search algorithms, to estimate the distance from the
current state to the goal state.
• The heuristic function h(n) is defined as the Manhattan
Distance between the current state n and the goal state.
• For example, let's say the robot is at position (3, 5) and the
target is at position (8, 10). The Manhattan Distance between
these two points is:
• |3 - 8| + |5 - 10| = 5 + 5 = 10
• Using the Manhattan Distance as a heuristic
function, the search algorithm can prioritize
expanding states that are closer to the goal,
ultimately finding an optimal or near-optimal
solution more efficiently.
Reason for using Manhattan Distance with heuristic function in
AI:
Manhattan Distance is used with heuristic functions in AI search