0% found this document useful (0 votes)
66 views12 pages

Manhattan Distance

Uploaded by

Aruna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views12 pages

Manhattan Distance

Uploaded by

Aruna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

HEURISTIC FUNCTION AND

EXAMINE THE APPLICATION


OF HEURISTIC SEARCH
STRATEGIES USING
MANHATTAN DISTANCE.
 A heuristic function is a function that estimates the cost

from the current state to the goal state in a search problem.


 It provides an approximate measure of the 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

where the exact solution is too expensive to compute or


when the search space is too large to exhaustively search.
Heuristic search strategies are problem-solving
methods used in artificial intelligence and
computer science to find solutions to complex
problems by exploring the search space in an
intelligent and informed manner.
These strategies use heuristics, which are rules or
principles that help guide the search process by
providing an estimate of the distance to the goal
Some common heuristic search strategies include:
• Best-First Search
• A* (A-star) algorithm
• IDA* (Iterative Deepening A*)
• Greedy Best-First Search
• Hill Climbing
• Simulated Annealing
• Tabu Search
• Genetic Algorithms
• Ant Colony Optimization
• Particle Swarm Optimization
• Manhattan Distance is a metric used to measure the
distance between two points in a grid-like structure.
• It is also known as the L1 norm or city block
distance. In a two-dimensional grid, the Manhattan
Distance between two points (x1, y1) and (x2, y2) is
given by:
• The name "Manhattan Distance" comes from
the resemblance of this distance metric to the
grid-like layout of the streets in Manhattan,
New York City.
• The name "Manhattan Distance" comes from the idea
that it represents the distance a taxi would have to travel
to get from point A to point B in a city with a grid-like
street layout, like Manhattan in New York City.
• The taxi can only move forward, backward, left, or
right, and cannot make diagonal moves, so it must
travel the sum of the absolute differences in the x and y
coordinates.
Real-time application example:

• Consider a robot navigating through a warehouse with a grid-

like layout. The robot needs to find the shortest path from its
current location to a specific target location.

• The warehouse has obstacles such as shelves and aisles, which

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

algorithms because it provides a good estimate of the actual


distance between two points in a grid-like structure.
 This is particularly useful in problems where the search space is

a grid, such as pathfinding in a maze or on a chessboard.


Using Manhattan Distance as a heuristic function helps the search
algorithm to:

• Prioritize states that are closer to the goal

• Find optimal or near-optimal solutions more efficiently

• Handle large search spaces

Manhattan Distance is used with heuristic functions in AI search


algorithms because it provides a good estimate of the distance between
two points in a grid-like structure, helping the algorithm prioritize
closer states, find optimal or near-optimal solutions more efficiently,
and handle large search spaces.

You might also like