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

6

The document discusses informed search algorithms in AI, emphasizing their use of heuristic functions to efficiently navigate large search spaces. It explains the concept of heuristics, including examples like Euclidean and Manhattan distances, and details the Best First Search algorithm, which combines elements of depth-first and breadth-first searches. The document also outlines the advantages and disadvantages of Best First Search, highlighting its efficiency and potential for looping.

Uploaded by

pranilmali1131
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)
3 views

6

The document discusses informed search algorithms in AI, emphasizing their use of heuristic functions to efficiently navigate large search spaces. It explains the concept of heuristics, including examples like Euclidean and Manhattan distances, and details the Best First Search algorithm, which combines elements of depth-first and breadth-first searches. The document also outlines the advantages and disadvantages of Best First Search, highlighting its efficiency and potential for looping.

Uploaded by

pranilmali1131
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/ 18

INFORMED SEARCH ALGORITHM IN AI

Informed search algorithm contains an array of knowledge such as


how far we are from the goal, path cost, how to reach to goal node,
etc.
This knowledge help agents to explore less to the search space and
find more efficiently the goal node.
node
The informed search algorithm is more useful for large search space.
 It uses the idea of heuristic function, so it is also called Heuristic
search.
“HEURISTIC”
 A heuristic (Greek Meaning: 'I find, discover'), is
approach to problem solving or self-discovery using
calculated guess' derived from previous experiences
 Herbert Simon’s study of a notion he called “bound
rationality” focused on decision making under restrict
cognitive conditions, such as limited time and informatio
 Kahneman put forward the estimate that an individ
makes around 35,000 decisions each day! To reach the
resolutions, the mind relies on either “fast” or “slo
thinking
WHAT IS HEURISTIC FUNCTION?
 Informed search make use of heuristic functions in order to reach the
goal node in a more prominent way.
way
 Heuristic functions are generally denoted by H(n)
 It gives an estimation on cost ‘n’ of getting node to the goal state.
 It helps in selecting optimal node for expansion which finally yield most
prominent path.
 It might not always give the best solution, but it guaranteed to find a
good solution in reasonable amount of time.
HEURISTIC FUNCTION WITH EUCLIDEAN DISTANCE
Consider an example of route-finding
finding application in a city
A Heuristic Function could be some measure of distance between given state node and goal
state
If location of each node is known in terms of coordinates, then the heuristic estimate of
distance could be Euclidean distance of the node from the goal node
With this we get an estimate of closeness of the current state & the goal
This estimate may be less than the straight-line
line distance, hence it is lower bound to the actual
distance
HEURISTIC FUNCTION WITH MANHATTAN DISTANCE
Another approach for distance measure can be Manhattan distance or the city block
distance
This estimates the distance assuming that the edges from the grid, as the street in most
of the Manhattan
EXAMPLE 2:

A heuristic function h(n) provides the


nformation required to solve given problem
more efficiently.
The information can be related to the nature
of the state, cost of transforming from one
tate to another, goal node A heuristic function for
characteristics, etc. the problem is:
Here the heuristic function h(n) is defining No h(n)=Number of tiles
of misplaced tiles. out of position
BEST FIRST SEARCH
The Best First Search method uses an Priority Queue is an abst
evaluation function to decide which adjacent data type that is similar to a que
is most promising and then explore. and every element has some prio
value associated with it.
It uses a priority queue or heap to store the The priority of the elements in
costs of nodes that have the lowest priority queue determines the orde
which elements are served (i.e.,
evaluation function value. order in which they are removed).
So the implementation is a variation of BFS, If in any case the elements have sa
priority, they are served as per t
it need to change Queue to PriorityQueue ordering in the queue.
WHAT IS BEST FIRST SEARCH?
lso called as Greedy Search
Greedy best-first search algorithm always selects the path which appears b
t that moment.
t is the combination of depth-first search and breadth-first search algorithms
t uses the heuristic function and heuristic search.
With the help of best-first search, at each step, we can choose the m
romising node.
riority queue is used to store the cost of nodes.
BEST FIRST SEARCH ALGORITHM
1. Place the starting node into the OPEN list
2. If OPEN list is empty, Stop and return failure
3. Remove the node n from open list which has lowest value of h(n) and places it in the
CLOSED list
4. Expand the node n and generate the successors of the node n
5. Check each successor of node n and find whether any node is a goal node or not.
If any successor node is goal node then return success and terminate the search
6. For each successor node , algorithm checks for evaluation function f(n) and then
check if the node has been in either OPEN and CLOSED list. If the node has not
been in both list, then add it to OPEN list.
7. Return step 2
EXAMPLE – BEST FIRST SEARCH
is the initial or source node and Z or L are the
al node
pen: C
osed: —

ow, C is added to Closed, and B, T, O, E and P


e added to Open.
pen: T, O, E, B, P
osed: C
EXAMPLE – BEST FIRST SEARCH
ow, T has the least distance hence, T is added
Closed.
pen: O, E, B, P
osed: C, T
EXAMPLE – BEST FIRST SEARCH
T does not have any successors, the next
de from open that is O is removed from
pen and added to closed.

pen: E, B, P

osed: C, T, O
EXAMPLE – BEST FIRST SEARCH
e successors of node O that is node I and N
e added to Open.

pen: I, E, B, P, N

osed: C, T, O
EXAMPLE – BEST FIRST SEARCH
ow, node I is removed from Open and added
closed.

pen: E, B, P, N

osed: C, T, O, I
EXAMPLE – BEST FIRST SEARCH
e successor of I that is Z is added to Open.

pen: Z, E, B, P, N

osed: C, T, O, I
EXAMPLE – BEST FIRST SEARCH
ow, node Z is removed from Open and added to
osed.

pen: E, B, P, N

osed: C, T, O, I, Z

e Goal is found. The final path is C – O – I – Z.


ADVANTAGE AND DISADVANTAGE OF BEST FIRST
SEARCH
Advantages:
1. Best first search can switch between BFS and DFS by gaining the
advantages of both the algorithms.
2. This algorithm is more efficient than BFS and DFS algorithms.
Disadvantages:
1. It can get stuck in a loop as DFS.
2. This algorithm is not optimal.

You might also like