Exercise 2: BFS, DFS, UCS
Question #1.
Figure 1
Consider the search problem represented in Figure 1, where s is the start node, give the visited node order for Breadth First Search and Depth First Search.
2. Question #2
Figure 2
Introduction to Artificial intelligence
1. All graph problems are solved by search method such that the commonly used search methods are
Given below figure 1 is a connected graph with 's' is the start node
Breadth First Search
In this search algorithm,first we have to visit start vertex 's' (fig 1) and put it into the queue by using FIFO. Then repeatedly remove that vertex from the queue and visit its adjacent vertices and again put newly visited vertices in to the queue
Therefore our visited node order = s,t,u,w,x,v,y,z
Depth First Search
2. Given below Figure 2 shows a tree with nodes and performing visited nodes in BFS, DFS and UCS
Figure 2. Tree
The visited node comes like this: C,D,F,G,E,I,H
Get Answers For Free
Most questions answered within 1 hours.