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

Session - 3 CO1-Introduction To Heuristic Search

The document discusses the limitations of uninformed search methods, highlighting the combinatorial explosion in search space size, particularly in the context of puzzles like the 8-puzzle. It introduces heuristic search as a more efficient approach that uses heuristic functions to estimate costs and improve search efficiency. The document also outlines various heuristic search techniques, including A* search, and emphasizes the importance of heuristic quality in optimizing search performance.

Uploaded by

sanjanarrao.2005
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)
9 views12 pages

Session - 3 CO1-Introduction To Heuristic Search

The document discusses the limitations of uninformed search methods, highlighting the combinatorial explosion in search space size, particularly in the context of puzzles like the 8-puzzle. It introduces heuristic search as a more efficient approach that uses heuristic functions to estimate costs and improve search efficiency. The document also outlines various heuristic search techniques, including A* search, and emphasizes the importance of heuristic quality in optimizing search performance.

Uploaded by

sanjanarrao.2005
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

ARTIFICIAL

INTELLIGENCE
&
MACHINE LEARNING
SESSION NO: 3
TOPIC: INFORMED SEARCH-INTRODUCTION TO HEURISTIC SEARCH
LIMITATIONS OF UNINFORMED SEARCH
• Search Space Size makes search tedious
• Combinatorial Explosion

• For example, 8-puzzle


• Avg. solution cost is about 22 steps
• branching factor ~ 3
• Exhaustive search to depth 22:
• 3.1 x 1010 states
• E.g., d=12, IDS expands 3.6 million states on average

[24 puzzle has 1024 states (much worse)]


RECALL TREE SEARCH…
RECALL TREE SEARCH…

This “strategy” is what


differentiates different search
algorithms
HEURISTIC SEARCH

• All of the search methods in the preceding section are uninformed in that they
did not take into account the cost incurred to reach the goal.
• They do not use any information about where they are trying to get to unless
they happen to stumble on a goal.
• A heuristic is a method that improves the efficiency of the search process.
• To find a solution in proper time rather than a complete solution in unlimited
time we use heuristics.
• These heuristic search methods use heuristic functions to evaluate the next
state towards the goal state
• A heuristic function h(n), takes a node n and returns a non-negative real
number that is an estimate of the cost of the least-cost path from node n to a
goal node.
5
HEURISTIC SEARCH

 Idea: use an evaluation function f(n) for each node


and a heuristic function h(n) for each node
 g(n) = known path cost so far to node n.
 h(n) = estimate of (optimal) cost to goal from node n.
 f(n) = g(n)+h(n) = estimate of total cost to goal through node n.
 f(n) provides an estimate for the total cost:
Expand the node n with smallest f(n).

 Implementation:
Order the nodes in frontier by increasing estimated cost.
 Evaluation function is an estimate of node quality
Þ More accurate name for “best first” search would be “seemingly best-first search”

Þ Search efficiency depends on heuristic quality!


Þ The better your heuristic, the faster your search!
HEURISTIC FUNCTION

Heuristic:
 Definition: a commonsense rule (or set of rules) intended to increase the probability of solving some problem
 Same linguistic root as “Eureka” = “I have found it”
 “using rules of thumb to find answers”

Heuristic function h(n)


 Estimate of (optimal) remaining cost from n to goal
 Defined using only the state of node n
 h(n) = 0 if n is a goal node
 Example: straight line distance from n to Bucharest
 Note that this is not the true state-space distance
 It is an estimate – actual state-space distance can be higher
 Provides problem-specific knowledge to the search algorithm
HEURISTIC FUNCTIONS FOR 8-PUZZLE
• 8-puzzle
• Avg. solution cost is about 22 steps
• branching factor ~ 3
• Exhaustive search to depth 22:
• 3.1 x 1010 states.
• A good heuristic function can reduce the search process.

• Two commonly used heuristics


• h1 = the number of misplaced tiles
• h1(s)=8
• h2 = the sum of the distances of the tiles from their goal positions (Manhattan
distance).
• h2(s)=3+1+2+2+2+3+3+2=18
RELATIONSHIP OF SEARCH
ALGORITHMS
• g(n) = known cost so far to reach n
• h(n) = estimated (optimal) cost from n to goal
• f(n) = g(n) + h(n)

= estimated (optimal) total cost of path through n to goal


• Uniform Cost search sorts frontier by g(n)
• Greedy Best First search sorts frontier by h(n)
• A* search sorts frontier by f(n)
• Optimal for admissible/consistent heuristics
• Generally the preferred heuristic search
• Memory-efficient versions of A* are available
• RBFS, SMA*
HEURISTIC SEARCH TECHNIQUES IN AI
SUMMARY

 Uninformed search methods have uses, also severe limitations


 Heuristics are a structured way to add “smarts” to your search
 Informed (or heuristic) search uses problem-specific heuristics to improve
efficiency
 Best-first, A* (and if needed for memory limits, RBFS, SMA*)
 Techniques for generating heuristics

 Can provide significant speed-ups in practice


 E.g., on 8-puzzle, speed-up is dramatic
 Still have worst-case exponential time complexity
 In AI, “NP-Complete” means “Formally interesting”
• Reference Books:

• 1. Russel and Norvig, ‘Artificial Intelligence’, third edition, Pearson Education, PHI, (2015)

• 2. Elaine Rich & Kevin Knight, ‘Artificial Intelligence’, 3nd Edition, Tata Mc Graw Hill Edition,
Reprint( 2008)

• Sites and Web links:

1. https://www.virtusa.com/digital-themes/heuristic-search-techniques

2. https://towardsdatascience.com/a-star-a-search-algorithm-eb495fb156bb

3. https://www.tutorialandexample.com/local-search-algorithms-and-optimization-problem/

4. http://cgi.di.uoa.gr/~ys02/siteAI2008/local-search-2spp.pdf

5. http://aima.eecs.berkeley.edu/slides-pdf/chapter04b.pdf

12

You might also like