Question

Exercise 2: BFS, DFS, UCS Question #1. Figure 1 Consider the search problem represented in Figure...

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

  • Give a possible order in which the nodes of this figure 2 could be visited in performing a Breadth First Search (BFS) starting at C. nodes are visited in alphabetical order (when multiple choices are possible).
  • Give a possible order in which the nodes of this figure 2 could be visited in performing a Depth First Search (DFS) starting at C. nodes are visited in alphabetical order (when multiple choices are possible).
  • Give a possible order in which the nodes of this figure 2 could be visited in performing a Cost Search (UCS) starting at C. nodes are visited in alphabetical order (when multiple choices are possible).

Introduction to Artificial intelligence

Homework Answers

Answer #1

1. All graph problems are solved by search method such that the commonly used search methods are

  • Breadth First Search
  • Depth First Search

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

  • First start at the vertex 's' and do dfs in either t and u.
  • If the vertex 2 is selected label vetrex t and do dfs either v and w as follows.
  • visited node order= s,t,v,y,z,u,w,x

2. Given below Figure 2 shows a tree with nodes and performing visited nodes in BFS, DFS and UCS

Figure 2. Tree

  • Breadth First search visited node order= C,D,E,F,G,H,I
  • Depth First Search visited node order= C,E,I,H,D,G,F
  • Uniform Cost Search: In this algorithm we visit the start node at first and will visit the adjacent nodes will choose the least costly nodefrom the un-visited nodes.

The visited node comes like this: C,D,F,G,E,I,H

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
5- What is the software agent and give an example rather than(ant-spam, search engine)? 6- Using...
5- What is the software agent and give an example rather than(ant-spam, search engine)? 6- Using Breadth First Search, assume b= 9, 100byte/ node, 1000 nodes/seconds. Please Calculate the nodes required by BFS and depth level is 6? 7- Using Depth First Search, assume b= 11, 100byte/ node, 1000 nodes/seconds. Please Calculate the nodes required by DFS and depth level is 21?
Submission Question: Recursion with Trees – Depth First Search & Breadth First Search Write a Python...
Submission Question: Recursion with Trees – Depth First Search & Breadth First Search Write a Python program using the Python IDE based on recursion with trees that is both depth first and breadth first searches. The Python program to be developed will demonstrate the use of both depth-first (DFS) and breadth-first (BFS) searches. A tree node structure will be developed that will be used both for DFS and BFS searches. The program will apply recursion both for the DFS and...
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings....
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings. You must base your code on the doubly linked list implementation given in my Week 8 slides. Change the code so that instead of an ‘int’ each node stores a string (choose a suitable size). Each node should also have a next node pointer, and previous node pointer. Then write functions to implement the following linked list operations: • A printList function that prints...
The question should be answered in this approach if possible 1. Area of Law 2. Legal...
The question should be answered in this approach if possible 1. Area of Law 2. Legal 3. Cases and Authorities 4.Discussion and Application of the principles of the law to the issues. 5. Conclusion 6. Legal advice                                                                                                                                                          kofu, an entrepreneur conceived the idea of establishing a company which when is registered shall be known as bare beauty with the sole aim of investing in diamond trade and other precious jewelry.  BLESS LEMON, a popular returnee from Germany popularly called BLESS...
Match the appropriate equipment to each measurement presented: Measurement: 1) Length of a frog's backbone. 2)...
Match the appropriate equipment to each measurement presented: Measurement: 1) Length of a frog's backbone. 2) Weight of seeds collected from a fertilized plant. 3) The amount of liquid left in a Coke bottle after you take your first swig. 4) The amount of liquid you can squeeze out of a single grape. 5) The temperature at which sea water begins to boil. 6) The amount of coffee in a Starbucks grande cup. Equipment: Ruler, Thermometer, Graduated Cylinder, Microscope, Broken...
Hi, please can you show me the correct answers to these questions? Thanks Question 16 1.    ...
Hi, please can you show me the correct answers to these questions? Thanks Question 16 1.     Which of the following best describes a linear presentation? 1. Linear presentations use a backchannel such as Twitter. 2. Linear presentations build the message point by point and end with a conclusion following logical steps. 3. Linear presentations are best developed with interactive slide software such as Prezi. 4. Linear presentations are given before a live audience with a question and answer opportunity. 5....
1: Match the appropriate equipment to each measurement presented: Measurement: 1) Length of a frog's backbone....
1: Match the appropriate equipment to each measurement presented: Measurement: 1) Length of a frog's backbone. 2) Weight of seeds collected from a fertilized plant. 3) The amount of liquid left in a Coke bottle after you take your first swig. 4) The amount of liquid you can squeeze out of a single grape. 5) The temperature at which sea water begins to boil. 6) The amount of coffee in a Starbucks grande cup. Equipment: Ruler, Thermometer, Graduated Cylinder, Microscope,...
How to use C++ figure this question? Collection and Sorted Collection An array is great for...
How to use C++ figure this question? Collection and Sorted Collection An array is great for storing a list of values. However, one challenge when working with arrays is they have a fixed size. If you declare an array of size 10 and later need to actually store 11 elements you have to create a new array and copy everything over. C++ (and other langauges) create classes that handle this and other operations behind the scenes. In this assignment, we...
Question 9 (1 point) An airplane starts from rest (vo = 0) and accelerates down a...
Question 9 (1 point) An airplane starts from rest (vo = 0) and accelerates down a runway at 2 m/s2 for 23 s until it takes off. Determine the distance traveled before takeoff. Your Answer: Question 9 options: Answer Question 10 (1 point) An airplane starts from rest (vo = 0) and accelerates down a runway at 4 m/s2 and covers 245 m before it takes off. Determine the time it takes. Your Answer: Question 10 options: Answer Question 11...
QUESTION 1 Which of the following factors would most likely lead a firm to adapt its...
QUESTION 1 Which of the following factors would most likely lead a firm to adapt its products for international markets? Exporting as the sole method of international marketing Similar levels of personal income Diverse consumer preference Economies of scale in production 2 points    QUESTION 2 Why would a firm research the marketing infrastructure of a foreign market prior to entry? To determine whether its prices will be competitive. Primarily to understand the role of the media including TV, print,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT