5-Informed Search Methods - Best First Search-01!02!2024
5-Informed Search Methods - Best First Search-01!02!2024
Module 2:
Problem Solving based on Searching
Dr . Saurabh Agrawal
Faculty Id: 20165
School of Computer Science and Engineering
VIT, Vellore-632014
Tamil Nadu, India
3-Feb-24 Dr. Saurabh Agrawal, SCOPE, DATABASE SYSTEMS, VIT, VELLORE 1
Outline
Introduction to Problem Solving by searching Methods-State Space search
Uninformed Search Methods
Uniform Cost Search
Breadth First Search
Depth First Search
Depth Limited Search
Iterative Deepening Depth-First-Search
Informed Search Methods
Best First Search
A* Search
S: (S,A,Action(S),Result(S,A),Cost(S,A))
NOTE: Here rootNode is the starting node for the path, and a priority queue is being
maintained to maintain the path with the least cost to be chosen for the next traversal. In
case 2 paths have the same cost of traversal, nodes are considered alphabetically.
Step 1-We will start with start node and check if we have reached
Step 2– We reach all the nodes that can be reached from S I .eA, B, S
D. And Since node S has been visited thus added to the visited List.
Now we select the cheapest path first for further expansion, i.e. A
Step 4– Now node D has been visited thus it goes to visited list and S,A,D
now since we have three paths with the same cost, we will choose
Step 6:- From C we can reach G2 and F node with 5 and 7 weights S,A,D,B,C
respectively.
Since S is present in the visited list thus, we are not considering the
C->S path.
Now C will enter the visited list. Now the next node with the
Step 7:- From E we can reach only G3. E will move to the visited S,A,D,B,C,E
list.
S->A->G1
S->D->C->G2
S->D->C->F
S->D->E->G3
Minimum is S->D->C->G2
path.
Step 4: Remove node 1 from the front of queue and visit the unvisited neighbours and push them into queue.
Step 6: Remove node 3 from the front of queue and visit the unvisited neighbours and push them into queue.
As we can see that every neighbours of node 3 is visited, so move to the next node that are in the front of the queue.
Now, all the graph nodes have been traversed, and the stack is empty.