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

CH04 Informed Search Part 01

This document discusses various informed search techniques for artificial intelligence problems. It introduces best first search which combines depth first and breadth first search by selecting the most promising node to expand at each step. Admissible heuristics that underestimate cost are described. Local search algorithms like hill climbing are covered along with genetic algorithms. An example of applying best first search to find the shortest path from home to university using heuristic values is provided.

Uploaded by

hala zain
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)
20 views16 pages

CH04 Informed Search Part 01

This document discusses various informed search techniques for artificial intelligence problems. It introduces best first search which combines depth first and breadth first search by selecting the most promising node to expand at each step. Admissible heuristics that underestimate cost are described. Local search algorithms like hill climbing are covered along with genetic algorithms. An example of applying best first search to find the shortest path from home to university using heuristic values is provided.

Uploaded by

hala zain
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

Data Science and AI

Dr. Mohammad AL-Oudat


Chapter 04
Informed Search
Outline
• Introduction
• Best First Search (BFS)
• Search
• Admissible Heuristic
• Admissible Heuristic - Underestimating h
• Admissible Heuristic - Overestimating h
• Local Search Algorithms
• Local Search Algorithms – Hill Climbing Search
• Local Beam Search
• Genetic Algorithm GA
• Conclusion
Introduction
• Search is one of the most important topics in AI.
• Any problem can be represented as a search problem.
• In all cases we are in search of solution.
• This solution could be particular destination, particular medicine, or
even can be a particular person or a document.
• The search complexity increases with the complexity of the problem.
Introduction
• Uniformed searches lead to higher time and memory complexity.
• Thus, there is a need for informed or heuristic search.
• Informed search techniques are also called heuristic search techniques.
• These techniques use the information about the domain, or knowledge
about the problem or scenario to move towards the goal nodes.
• Heuristic methods do not always find the best solution, but they
guarantee to find a good solution in reasonable amount of time.
Introduction

A Heuristic function is the one that guides the decision of selection


of a path.

a heuristic function provides an estimate of the cost of the path


from the given node to reach to closest goal node.
• BFS is a combination of depth
first search and breadth first
search.
• The positive aspect of DFS is
that the goal can reached
without any need to compute
all the states.
• The positive aspect of BFS, is
Best First does not get halted or trapped
in dead paths. +
Search (BFS) • The BFS search allows us to
switch between the paths, and
thus, gets the benefit of both.
To do so, the selection of the
most promising node is done.
• So, its analysis and checks if
the selected node is better
than the pervious one. If not
found, it reverts back to the
previous path and proceeds.
Best First Search
(BFS)
• One way of combining the two is to follow a single path at a
time, but switch paths whenever some competing path looks
more promising than the current one does.

• At each step of the BFS search process, we select the most


promising of the nodes we have generated so far.
• This is done by applying an appropriate heuristic function to
each of them.

• We then expand the chosen node by using the rules to


generate its successors

• It proceeds in steps, expanding one node at each step until it


generates a node that corresponds to a goal state.
Best First Search (BFS)
• At each step, it picks the most promising of the nodes that have so far been generated
but not expanded.

• It generates the successors of the chosen node, applies the heuristic function to them,
and adds them to the list of open nodes, after checking to see if any of them have been
generated before.

• By doing this check, we can guarantee that each node only appears once in the graph,
although many nodes may point to it as a successor.
Best First Search (BFS)
• To implement such a graph-search procedure, we will need
to use two lists of nodes:
• OPEN — nodes that have been generated and have had the
heuristic function applied to them, but which have not yet been
examined (i.e., had their successors generated).
• CLOSED — nodes that have already been examined. We need to
keep these nodes in memory if we want to search a graph rather
than a tree since whenever a new node is generated, we need to
check whether it has been generated before.
Best First Search (BFS) – Algorithm

1. Start with OPEN containing just the initial state.

2. Until a goal is found or there are no nodes left on OPEN do:


• a) Pick them best node on OPEN.
• b) Generate its successors.
• c) For each successor do:
• i) if it has not been generated before, evaluate it, add it to OPEN, and record its parent.
• ii) If it has been generated before, change the parent if this new path is better than the
previous one.
• iii) In that case, update the cost of getting to this node and to any successors that this
node may already have.
Example
59
• This values on this graph 50
School Post
Office

represents the distances. Home


75
40
• However, in BFS we will use the
72
heuristic values which represent 45
Garden Railway
Station

the calculated cost. 40

• So, here This example explains


the states to proceed towards Bank
60
University

the goal of university. 28


Police
Station
Example
• The values in the example represent the heuristic (you cannot actually compute
the values; they are assumed to be computed on the basis of some pervious
experience), and hence, as the name suggests, the search proceeds in a greedy
fashion.
• Home 120
• Bank 80
• Garden 100
• School 70
• Railway station 20
• Post Office 110
• Police Station 26
Solution
Here Home is the initial or source node and Open Bank, Garden, Post office, Railway
University is the goal node.
Close Home, School
Open Home
Railway is removed from open and added to closed
Close -------
Open Bank, Garden, Post Office
The successor of Home node is added to open and
Home node is added to close Close Home, School, Railway
Open Bank, Garden, School The successor of Railway that is University is added to
open
Close Home
Open Bank, Garden, Post Office, University
Now, school is the least heuristic value, so it added to
close Close Home, School, Railway
Open Bank, Garden Now university removed from open and added to
close
Close Home, School
Open Bank, Garden, post office
The successor of node school “Post Office” and
“Railway” are added to open Close Home, School, Railway, University
Goal is Found (University)
Example
• Here C is the initial or
source node and Z are
goal node.
• Try solve it yourself???
Conclusion
• This chapter, we have discussed in detail the various
informed search methods.
• A heuristic function is used to guide the entire process.
• Estimated heuristic is the most critical aspect in these
search methods.
• Local search techniques that are based on local view
have also been discussed.
• Hill climbing and other approaches discussed.
• Genetic algorithm illustrated.
• Example given for each technique.

You might also like