Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Review: Search problem formulation
Uninformed search strategies
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Lecture 3: Uninformed Search
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Blind Search by Prof. Jean-Claude Latombe
Uninformed (also called blind) search algorithms) This Lecture Chapter Next Lecture Chapter (Please read lecture topic material before.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies Reading: Russell’s Chapter 3 1.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence (CS 461D)
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Review: Search problem formulation
Searching the search space graph
UnInformed Search What to do when you don’t know anything.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2002.
CS 188: Artificial Intelligence Spring 2006 Lecture 2: Queue-Based Search 8/31/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either.
1 Lecture 3 Uninformed Search
Lecture 3 Uninformed Search.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Artificial Intelligence
Vilalta&Eick:Uninformed Search Problem Solving By Searching Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States/Looping.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
Uninformed Search Methods
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Artificial Intelligence Solving problems by searching.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Uninformed (also called blind) search algorithms)
Uninformed Search Chapter 3.4.
Uninformed Search Strategies
Artificial Intelligence (CS 370D)
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
CS 188: Artificial Intelligence Spring 2007
Problem Solving and Searching
What to do when you don’t know anything know nothing
Artificial Intelligence
Searching for Solutions
Problem Solving and Searching
Principles of Computing – UFCFA3-30-1
Search Exercise Search Tree? Solution (Breadth First Search)?
Problem Spaces & Search
Problem Spaces & Search
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Search Strategies CMPT 420 / CMPG 720.
Basic Search Methods How to solve the control problem in production-rule systems? Basic techniques to find paths through state- nets. For the moment: -
Presentation transcript:

Implementation and Evaluation of Search Methods

Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack. Call this node N. 3. Push children of node N onto the stack in right-to-left order (so they are popped in left-to-right order). 4. Repeat steps 2 and 3 until stack is empty or goal is reached. Simple Algorithm Depth-First Search

A General Algorithm

Implementation of different algorithms

Comparing Search Strategies Completeness – Will a solution be found if there is one? Optimality Will the optimal solution be found? Time Complexity Space Complexity

Breadth First Search Complete Finds shallowest goal may be optimal, may not Open list can be quite large O(b^d+1) space complexity Time is equally slow – O(b^d+1) time complexity

Depth First Search Not Complete – May get stuck on an infinite path Not Optimal – Unclear where the goal will be found Open list is relatively restricted O(b^m) space complexity Time is slow, perhaps slower than BFS O(b^m) time complexity

Uniform Cost Search Complete – Will find a solution if it exists at finite depth Optimal – Expansion order guarantees optimal solution Complexity difficult to pin down, O (b c/m)

Iterative Deepening Search Complete? Yes Optimal? Yes, if step cost = 1 db + (d-1)b^2 + (d-2)b^3 + … + (1)b^d BFS: b + b^2 + b^3 + … + b^d + b^d+1 – b

Bidirectional Search  Requires an explicit goal state  Simultaneously search forward from initial state and backwards from the goal state until the two meet  Concatenate the path from initial state to the inverse of the path from the goal state to form a complete solution  Use two queues to implement- for the halves Guarantees optimal solution Time complexity is O (b d/2 ) since the search only proceeds to half solution depth. Space complexity is also O (b d/2 ) as at least one of the searches has to be breadth first to find a common state

Bi-Directional Search Complete – If we use breadth first from both directions Optimal – With same caveats as breadth first Complexity better than breadth first, O(b^d/2) space complexity Time is also better – O(b^d/2) time complexity