0% found this document useful (0 votes)
24 views16 pages

Module 3

Uploaded by

suhan4me
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)
24 views16 pages

Module 3

Uploaded by

suhan4me
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/ 16

Module 3

INFORMED (HEURISTIC) SEARCH STRATEGIES


Informed or Heuristic search
• Informed search, also known as heuristic search, refers to search
algorithms that utilize additional knowledge (or heuristics) to find
solutions more efficiently than uninformed (blind) search techniques.
This extra information typically helps the algorithm make better
decisions about which paths to explore, improving its speed and
accuracy in finding the optimal solution.
• They use problem-specific knowledge beyond the definition of the
problem itself
• The general approach being considered is best first search
• Best-first search is an instance of the general TREE-SEARCH or GRAPH-
SEARCH algorithm in which a node is selected for expansion based on
an evaluation function, f(n).
• The evaluation function is construed as a cost estimate, so the node
with the lowest evaluation is expanded first
• The implementation of best-first graph search is identical to that for
uniform-cost search except for the use of f instead of g to order the
priority queue
• The choice of f determines the search strategy. Most best-first
algorithms include as a component of f a heuristic function, denoted
as h(n)
• h(n) = estimated cost of the cheapest path from the state at node n to
a goal state
• Heuristic functions are the most common form in which additional
knowledge of the problem is imparted to the search algorithm
Feature Informed Search Uninformed Search

Definition Uses heuristics to guide the search Does not use any additional knowledge.
process.
Heuristic Utilizes a heuristic function h(n) to Does not have a heuristic; treats all
Function estimate the cost to the goal. nodes equally.

Knowledge Incorporates domain-specific knowledge Lacks specific knowledge about the


problem.
Adapts exploration based on heuristic
Exploration values, focusing on the most promising Follows a fixed strategy (e.g., breadth-
Strategy nodes first, depth-first) without adaptation.
May guarantee optimality (e.g., A*) if the
Certain algorithms (like breadth-first
heuristic is admissible; otherwise, it may
Optimality search) guarantee optimality if path
not guarantee optimal solutions (e.g.,
Greedy Best-First Search). costs are uniform.
Typically more efficient due to targeted
Often less efficient, potentially exploring
Efficiency exploration, resulting in fewer node
many unnecessary nodes.
expansions.
Feature Informed Search Uninformed Search
Examples A*, Greedy Best-First Search, Beam Breadth-First Search, Depth-First
Search. Search, Uniform Cost Search.

Space May require more memory due to storing Generally has lower memory
Complexity heuristic information and expanded requirements, depending on the
nodes. strategy used.

Use Cases Suitable for complex problems where Used in simpler problems or when no
heuristic information is available (e.g., heuristic information is available.
pathfinding, AI)
3.5.1 Greedy best-first search
• Greedy best first search tries to expand the node that is closest to the
goal, on the grounds that this is likely to lead to a solution quickly
• It evaluates nodes by sing just the heuristic function; i.e. f(n)=h(n)
• In route finding problems, straight line distance heuristic is used
normally being called as hSLD
• It can be well explained with route-finding problems in Romania
• From the table 3.22, hSLD (In(Arad)) = 366  it means straight line
distance from Arad to Bucharest is 366
• Notice that the values of hSLD cannot be computed from the problem
description itself. Moreover, it takes a certain amount of experience to
know that hSLD is correlated with actual road distances and is, therefore,
a useful heuristic.
Why it is called as greedy ?
• The greedy best-first search , for a given problem, using hSLD finds a
solution without ever expanding a node that is not on the solution
path; hence its search cost is minimal but it is not optimal.
• From the above problem we discussed, the path via Sibiu and Fagaras
to Bucharest is 32 km longer than the path through Rimnicu vilcea
and Pitesti. This shows why the algorithm is called greedy – at each
step it tries to get as close to the goal as it can
A* Search
• The most widely known form of best-first search is called A∗ search
• It evaluates nodes by combining g(n), the cost to reach the node, and h(n),
the cost to get from the node to the goal: f(n) = g(n) + h(n)
• Since g(n) gives the path cost from the start node to node n, and h(n) is the
estimated cost of the cheapest path from n to the goal,
• we have f(n) = estimated cost of the cheapest solution through n
• Thus, if we are trying to find the cheapest solution, a reasonable thing to try
first is the node with the lowest value of g(n) + h(n).
• It turns out that this strategy is more than just reasonable: provided that the
heuristic function h(n) satisfies certain conditions, A∗ search is both
complete and optimal.
• The algorithm is identical to UNIFORM-COST-SEARCH except that A∗ uses g
+ h instead of g.
• Before we start with actual concepts, lets have basics on some point
• Optimality means finding the best possible solution. In search
algorithms, this usually means finding the shortest path or the least
costly way to reach a goal
• A heuristic (a smart guess about the distance or cost to the goal) is
admissible if it never overestimates the actual cost to reach the goal
• Simple example: Imagine you are using a map to find the shortest route to a
city. An admissible guess about the distance would be something that’s equal
to or less than the real distance. For example, guessing the straight-line
distance between two cities is admissible because it will never be more than
the actual road distance (since roads are often longer than straight lines)
• Why it matters: If the algorithm only uses admissible guesses, it will
always find the best solution, or in other words, the optimal path
Consistency (also called Monotonicity)
• A heuristic is consistent if it not only never overestimates but also
guarantees that every step you take towards the goal doesn’t make
the guess worse
• Simple example: Let’s say you are walking from point A to point B, and your
guess about how much distance is left should not increase as you move closer
to B. In other words, every time you take a step towards the goal, your guess
should decrease in a way that makes sense
• Why it matters: If the heuristic is consistent, the algorithm becomes
more efficient because it won’t need to recheck paths it has already
considered. It ensures that as you move through the search space,
you are always moving in a sensible way towards the goa
Conditions for optimality: Admissibility and consistency
• The first condition we require for optimality is that h(n ) be an
admissible heuristic
• An admissible heuristic is one that never overestimates the cost to
reach the goal.
• Because g(n) is the actual cost to reach n along the current path, and
f(n)=g(n) + h(n), we have as an immediate consequence that f(n)
never overestimates the true cost of a solution along the current path
through n.
• Admissible heuristics are by nature optimistic because they think the
cost of solving the problem is less than it actually is.
• An obvious example of an admissible heuristic is the straight-line
distance hSLD that we used in getting to Bucharest
• Straight-line distance is admissible because the shortest path
between any two points is a straight line, so the straight line cannot
be an overestimate
• A heuristic h(n) is consistent if, for every node n and every successor
n’ of n generated by any action a, the estimated cost of reaching the
goal from n is no greater than the step cost of getting to n’ plus the
estimated cost of reaching the goal from n’

h(n) ≤ c(n, a, n’ ) + h(n’)

You might also like