Session 4 (2018_12_25 05_40_40 UTC).pptx

Session 4 (2018_12_25 05_40_40 UTC).pptx - Session 4...

This preview shows page 1 - 8 out of 19 pages.

Session 4 Uninformed Search 1
Image of page 1

Subscribe to view the full document.

Breadth First Search Algorithm: 1. Create a variable called NODE-LIST and set it to initial state 2. Until a goal state is found or NODE-LIST is empty do a. Remove the first element from NODE-LIST and call it E. If NODE-LIST was empty, quit b. For each way that each rule can match the state described in E do: i. Apply the rule to generate a new state ii. If the new state is a goal state, quit and return this state iii. Otherwise, add the new state to the end of NODE-LIST 2
Image of page 2
BFS Tree for Water Jug problem (0,0) (4,0) (0,3) (4,3) (0,0) (1,3) (4,3) (0,0) (3,0) 3
Image of page 3

Subscribe to view the full document.

Advantages of BFS BFS will not get trapped exploring a blind alley. If there is a solution, BFS is guarnateed to find it. If there are multiple solutions, then a minimal solution will be found. 4
Image of page 4
Uniform Cost Search 5
Image of page 5

Subscribe to view the full document.

6 Uniform Cost Search is the best algorithm for a search problem, which does not involve the use of heuristics. It can solve any general graph for optimal cost. Uniform Cost Search as it sounds searches in branches which are more or less the same in cost. Uniform Cost Search again demands the use of a priority queue. Recall that Depth First Search used a priority queue with the depth upto a particular node being the priority and the path from the root to the node being the element stored. The priority queue used here is similar with the priority being the cumulative cost upto the node. Unlike Depth First Search where the maximum depth had the maximum priority, Uniform Cost Search gives the minimum cumulative cost the maximum priority.
Image of page 6
7 The algorithm using this priority queue is the following: Insert the root into the queue While the queue is not empty Dequeue the maximum priority element from the queue (If priorities are same, alphabetically smaller path is chosen) If the path is ending in the goal state, print the path and exit Else Insert all the children of the dequeued element, with the cumulative costs as priority
Image of page 7

Subscribe to view the full document.

Image of page 8
  • Spring '19
  • Dr. Anjali Mathur
  • Depth-first search, Search algorithm

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern