0% found this document useful (0 votes)
5 views

AI Notes

The document discusses informed (heuristic) search strategies in artificial intelligence, including techniques such as Best-first search, A*, and Hill climbing. It highlights the importance of heuristic functions in guiding searches efficiently and compares various search techniques based on completeness, optimality, and time/space complexity. Additionally, it addresses the potential issues with heuristic functions and the characteristics of different search methods.

Uploaded by

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

AI Notes

The document discusses informed (heuristic) search strategies in artificial intelligence, including techniques such as Best-first search, A*, and Hill climbing. It highlights the importance of heuristic functions in guiding searches efficiently and compares various search techniques based on completeness, optimality, and time/space complexity. Additionally, it addresses the potential issues with heuristic functions and the characteristics of different search methods.

Uploaded by

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

Artificial Intelligence

SOLVING PROBLEMS BY SEARCHING


Informed (Heuristics) Searches
In which we see how an agent can look ahead to find a sequence of actions that will eventually achieve its
goal.

CS-412
Week-05-Fall 2024

03/10/2024 12:47 pm
Informed (Heuristics) Searches
• Best-first search, Hill climbing, Beam search, A*
• New terms
• Heuristics
• Optimal solution
• Informedness
• Hill climbing problems
• Admissibility
• New parameters
• g(n) = estimated cost from initial state to state n
• h(n) = estimated cost (distance) from state n to closest goal
• h(n) is our heuristic
• Robot path planning, h(n) could be Euclidean distance
• 8 puzzle, h(n) could be #tiles out of place
• Search algorithms which use h(n) to guide search are heuristic
search algorithms
Informed (Heuristics) Searches
• Informed search strategy—one that uses domain-specific hints about
the location of goals—can find solutions more efficiently than an
uninformed strategy.
• The hints come in the form of a heuristic function,
denoted h(n):
Heuristic function h(n) = estimated cost of the cheapest path from the
state at node n to a goal state.
Best-First Search
• QueueingFn is sort-by-h
• Best-first search only as good as heuristic
• Example heuristic for 8 puzzle: Manhattan Distance
Example
Example
Example
Example
Example
Example
Example
Example
Example
Comparison of Search Techniques
DFS BFS UCS Best
Complete N Y Y N
Optimal N N Y N
Heuristic N N N Y
Time bm bd+1 bm bm
Space bm bd+1 bm bm
A*
• QueueingFn is sort-by-f
• f(n) = g(n) + h(n)
• Note that UCS and Best-first both improve search
• UCS keeps solution cost low
• Best-first helps find solution quickly
• A* combines these approaches
Power of f
• If heuristic function is wrong it either
• overestimates (guesses too high)
• underestimates (guesses too low)
• Overestimating is worse than underestimating
• A* returns optimal solution if h(n) is admissible
• heuristic function is admissible if never overestimates true cost to nearest
goal
• if search finds optimal solution using admissible heuristic, the search is
admissible
Example
Example
Example
Example
Example
Example
Example
Example
Optimality of A*
• Suppose a suboptimal goal G2 is on the open list
• Let n be unexpanded node on smallest-cost path to
optimal goal G1

f(G2) = g(G2) since h(G2) = 0


>= g(G1) since G2 is suboptimal
>= f(n) since h is admissible

Since f(G2) > f(n), A* will never select G2 for expansion


Hill Climbing (Greedy Search)
• QueueingFn is sort-by-h
• Only keep lowest-h state on open list
• Best-first search is tentative
• Hill climbing is irrevocable
• Features
• Much faster
• Less memory
• Dependent upon h(n)
• If bad h(n), may prune away all goals
• Not complete
Example
Example
Hill Climbing Issues
• Also referred to as gradient descent
• Foothill problem / local maxima / local minima
• Can be solved with random walk or more steps
• Other problems: ridges, plateaus

global maxima

local maxima
Comparison of Search Techniques
DFS BFS UCS Best HC

Complete N Y Y N N

Optimal N N Y N N

Heuristic N N N Y Y

Time bm bd+1 bm bm mn

Space bm bd+1 bm bm b
Beam Search
• QueueingFn is sort-by-h
• Only keep best (lowest-h) n nodes on open list
• n is the “beam width”
• n = 1, Hill climbing
• n = infinity, Best first search
Example
Example
Example
Example
Example
Example
Example
Example
Example
Comparison of Search Techniques
DFS BFS UCS Best HC Beam

Complete N Y Y N N N

Optimal N N Y N N N

Heuristic N N N Y Y Y

Time bm bd+1 bm bm bm nm

Space bm bd+1 bm bm b bn

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy