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
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...
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,...
PLEASE ANSWER ASAP. PLEASE! QUESTION 20 Sean has two supervisors who both provide appraisals on Sean's...
PLEASE ANSWER ASAP. PLEASE! QUESTION 20 Sean has two supervisors who both provide appraisals on Sean's performance. On a scale of 1-5, both supervisors gave Sean a 4.2. It is likely that Sean's performance appraisal is __________. valid specific feasible reliable QUESTION 21 When a performance appraisal process is valid, what does that mean? It is feasible to use It is acceptable to all parties It is a factual measure; it measures the process that you want to measure It...
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,...
Question 2 Reported expenses are most likely to have been understated with management’s discretionary ________ A....
Question 2 Reported expenses are most likely to have been understated with management’s discretionary ________ A. increase in doubtful accounts   B. decrease in warranty provisions   C. increase in the interest earned on credit sales D. acceleration in revenue recognition. Question 3 An analyst is comparing two pharmaceutical companies, Abraham Inc. and Branson Corporation. Both companies follow the US GAAP with a fiscal year ending on 31 December. They released their first new drugs around the same time early this year....
QUESTION 1 Advanced Security Inc. was hired by the Treasury Bank Inc. for securing their systems....
QUESTION 1 Advanced Security Inc. was hired by the Treasury Bank Inc. for securing their systems. The first thing they did was implement the best practice if separation of domains. As a result of this The bank had to get a new domain name. any change made in the records points to only one party who could have made that change. If you are a technical person, you must have office in a particular area of the building. accessing outside...
1. If you want to study the effect of hormonal changes in adolescent boys, your population...
1. If you want to study the effect of hormonal changes in adolescent boys, your population would be Group of answer choices All adolescents All the people in the world All males All adolescent males 2. Which of the following is most likely to be measured categorically? Group of answer choices Weight gain in first year college students Deterioration in driving performance under the influence of alcohol Level of authoritarianism in a sample of public accountants Species of dog appearing...