Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Heuristic Search techniques
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
State Space Representation and Search
PROBLEM SOLVING AND SEARCH
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
Part2 AI as Representation and 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.
CMSC 471 Spring 2014 Class #4 Thu 2/6/14 Uninformed Search Professor Marie desJardins,
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
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 Jim Little UBC CS 322 – Search 2 September 12, 2014
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
Review: Search problem formulation
Artificial Intelligence
UnInformed Search What to do when you don’t know anything.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Using Search in Problem Solving
Informed Search CSE 473 University of Washington.
Problem Solving and Search in AI Heuristic Search
Blind Search-Part 2 Ref: Chapter 2. Search Trees The search for a solution can be described by a tree - each node represents one state. The path from.
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
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.
Uninformed Search (cont.)
Search  Exhaustive/Blind Search Methods Depth First Search Breadth First Search  Heuristic Methods Hill Climbing Beam Search Best First Search…
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Solving Problems by Searching
State-Space Searches.
Heuristic Search Heuristic - a “rule of thumb” used to help guide search often, something learned experientially and recalled when needed Heuristic Function.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Informed Search Strategies
Problem Solving and Search Andrea Danyluk September 11, 2013.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Search: Heuristic &Optimal Artificial Intelligence CMSC January 16, 2003.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 02 : Search.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Cost-based & Informed Search Chapter 4. Review §We’ve seen that one way of viewing search is generating a tree given a state-space graph (explicitly or.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
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
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CSC3203: AI for Games Informed search (1) Patrick Olivier
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
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;
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
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.
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
For Monday Read chapter 4 exercise 1 No homework.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
CS Fall 2016 (Shavlik©), Lecture 8, Week 5
What to do when you don’t know anything know nothing
CS Fall 2016 (Shavlik©), Lecture 9, Week 5
Artificial Intelligence
Presentation transcript:

Introduction to search Chapter 3

Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning algorithms, e.g., can be seen as searching some space of hypothesis

Intelligence as search §“The solutions to problems are represented as symbol structures. A physical-symbol system exercises its intelligence in problem- solving by search -- that is, by generating & progressively modifying symbol structures until it produces a solution structure.”

The search task §Given l a description of the initial state l list of legal actions preconditions effects l goal test -- tells you if a goal has been reached §Find l an ordered list of actions to perform in order to go from the initial state to the goal

Search as a graph §Nodes l search-space states §Directed arcs l legal actions from each state to another §Example §Rather than being given, however, we often build the graph (implicitly) as we go; we aren’t given the graph explicitly

Trip as search §State: geographical location (city, street, etc.) §Actions: following a road §Initial state: Madison §Goal state: Minneapolis

§The following is the basic outline for the various search algorithms (some steps are modified depending on the specifics of the search, e.g. if doing hill climbing, iterative deepening, or beam search). General Pseudocode for Searching

OPEN = { startNode } // Nodes under consideration. CLOSED = { } // Nodes we're done with. while OPEN is not empty { remove an item from OPEN based on search strategy used - call it X if goalState?(X) return the solution found otherwise // Expand node X. { 1) add X to CLOSED 2) generate the immediate neighbors (ie, children of X) 3) eliminate those children already in OPEN or CLOSED 4) add REMAINING children to OPEN } return FAILURE // Failed if OPEN exhausted without a goal being found

“Considering” a node §If goal-state?(node) then done else expand(node) l expand = add previously unvisited neighbors / children (states that be gotten to from node by applying the operators) to the OPEN list

§Task: find a route from the start node to the goal node §build a tree (try all/many possible paths) §OPEN list allows backtracking from a path that “dies out”; saves other possible ways l nodes under consideration (to be expanded) §CLOSED list prevents us from repeatedly trying a node & ending up in an infinite loop l nodes that have been processed Search algorithm explained

General search methods §Given a set of search-space nodes, which one should we consider next? l Youngest [depth-first search] most recently created node l Oldest [breadth-first search] least-recently created node l Best [best-first search] requires a scoring function l Random simulated annealing

Implementing search strategies §Breadth l queue: first in, first out l put new nodes at the back of list §Depth l stack: last in, first out l put new nodes at the front of list §Best l priority queue l add new nodes then sort list §The next node to consider is popped off the front of the OPEN list

Example of search strategies

Search danger: infinite spaces §We must be careful that our search doesn’t go forever l the goal we are looking for may not be in the search space but because the space is infinite we might not know this l the goal may be in the search space but we go down an infinite branch l example

BFS tradeoffs §pros l guaranteed to find a solution if it exists l guaranteed to find the shortest solution (in terms of arcs) §cons l OPEN becomes too big [O(b d )] l example

DFS tradeoffs §pros l might find solution quickly l needs less space for OPEN [O(b * m)] l example §cons l can get stuck (run forever) in infinite spaces l might not find shortest solution

Best-first search tradeoffs §pro l can use domain specific knowledge §con l requires a good heuristic (scoring) function

Fixing DFS: iterative deepening §Combines the strengths of breadth- & depth-first search §do DFS but with depth limited to k l if find solution, done (return path, etc.) l else, increment k & start over §don’t save partial solutions from previous iterations; too much memory required §due to exponential growth, most work is at the bottom §guaranteed to find the shortest solution, but OPEN doesn’t get too big (as in BFS)

Iterative deepening idea §We do only a little more work overall, but our storage needs are much less l we get the good aspects of BFS -- shortest solution l without the negative aspects -- OPEN list too big

Search space examples §Define l state representation (k-rep) l initial state l goal state l operators §Draw search space (if it is small) §Build search Tree