Best First Search
Best First Search
Step 2: As S is not the goal node hence we remove s from the queue and arrange unvisited
neighbors of S in ascending order of their costs.
A C B
Step 3: As A is not the goal node hence we remove A from the queue and arrange all
unvisited neighbors of A in ascending order of their costs.
C B E D
Step 4: As C is not the goal node hence We remove C from queue and arrange all unvisited
neighbors of C in ascending order of their costs.
B H E D
Step 5: As B is not the goal node hence We remove B from the queue and arrange all
unvisited neighbors of B in ascending order of their costs.
H E D F G
Step 6: As H is not the goal node, hence we remove H from the queue and arrange all
unvisited neighbors of H in the ascending order of their costs.
I J E D F G
Advantages:
In this procedure at any way it will find the goal.
It does not follow a single unfruitful path for a long time.
It finds the minimal solution in case of multiple paths.
Disadvantages:
BFS consumes large memory space.
Its time complexity is more.
It has long pathways, when all paths to a destination are on approximately the same
search depth.
Best first search is an instance of graph search algorithm in which a node is selected
for expansion based on the evaluation of function f (n). Traditionally, the node which is the
lowest evaluation is selected for the explanation because the evaluation measures distance
to the goal. Best first search can be implemented within general search frame work via a
priority queue, a data structure that will maintain the fringe in ascending order of the
function values.
This search algorithm serves as combination of depth first and breadth first search
algorithm. Best first search algorithm is often referred greedy algorithm this is because they
quickly attack the most desirable path as soon as its heuristic weight becomes the most
desirable.
EXERCISE
Figure 2