Heuristic searching. State spaces zA state space consists of yA (possibly infinite) set of states xThe start state represents the initial problem xEach.

Slides:



Advertisements
Similar presentations
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Advertisements

Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
Chapter 4 Search Methodologies.
CSC 423 ARTIFICIAL INTELLIGENCE
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
State-Space Searches. State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Artificial Intelligence
1 Chapter 4 Search Methodologies. 2 Chapter 4 Contents l Brute force search l Depth-first search l Breadth-first search l Properties of search methods.
17-Jun-15 Searching in BeeperHunt (Mostly minor variations on old slides)
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Informed Search CSE 473 University of Washington.
Pathfinding Algorithms Josh Palmer Rachael Beers.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
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
ITCS 3153 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
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.
Solving Problems by Searching
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
CMU Snake Robot
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
State-Space Searches. The states of Pac-Man The ghosts in Pac-Man.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
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.
CS 416 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)
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,
Informed (Heuristic) 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.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
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
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search CSE 473 University of Washington.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
February 18, 2016Introduction to Artificial Intelligence Lecture 8: Search in State Spaces III 1 A General Backtracking Algorithm Sanity check function.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Review: Tree search Initialize the frontier using the starting state
Artificial Intelligence Problem solving by searching CSC 361
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
EA C461 – Artificial Intelligence
CSE 473 University of Washington
CPSC 322 Introduction to Artificial Intelligence
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
State-Space Searches.
State-Space Searches.
HW 1: Warmup Missionaries and Cannibals
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Presentation transcript:

Heuristic searching

State spaces zA state space consists of yA (possibly infinite) set of states xThe start state represents the initial problem xEach state represents some configuration reachable from the start state xSome states may be goal states (solutions) yA set of operators xApplying an operator to a state transforms it to another state in the state space xNot all operators are applicable to all states

Example 1: Maze zA maze can be represented as a state space yEach state represents "where you are" in the maze yThe start state represents your starting position yThe goal state represents the exit from the maze zOperators (for a rectangular maze) are: move north, move south, move east, move west yEach operator takes you to a new state (maze location) yOperators may not always apply, because of walls in the maze

Example 2: The 15-puzzle zThe start state is some (almost) random configuration of the tiles zThe goal state is as shown zOperators are yMove empty space up yMove empty space down yMove empty space right yMove empty space left zOperators apply if not against edge

Example 3: Missionaries and cannibals z3 missionaries, 3 cannibals, 1 boat need to cross the Limpopo river zCannibals may never outnumber missionaries zInitial state is (3, 3, 1), representing the number of missionaries, cannibals, boats on the initial side zThe goal state is (0, 0, 0) zOperators are addition or subtraction of the vectors (1 0 1), (2 0 1), (0 1 1), (0 2 1), (1 1 1) zOperators apply if result is between (0 0 0) and (3 3 1)

State-space searching zMost problems in AI can be cast as searches on a state space zThe space can be tree-shaped or graph-shaped yIf a graph, need some way to keep track of where you have been, so as to avoid loops zThe state space is often very, very large zWe can minimize the size of the search space by careful choice of operators zExhaustive searches don't work--need heuristics

The basic search algorithm zInitialize: put the start node into OPEN zwhile OPEN is not empty ytake a node N from OPEN yif N is a goal node, report success yput the children of N onto OPEN  Report failure  How do we choose which node to take from OPEN ?

Breadth-first searching  If we take the node that has been in OPEN the longest, we have a queue zThe result is a breadth-first search zIf we find a path, it will be a shortest-possible path, because we look first near the start node zSpace requirements are exponential, because the queue will hold all the nodes at one level before we begin searching the next level

Depth-first searching  If we take the node that has been in OPEN the least amount of time, we have a stack zThe result is a depth-first search zIf we find a path, it may be arbitrarily long  Space requirements are linear in the length of the path we find, because the stack holds only b nodes from each level, where b is the branching factor

Iterative deepening zSet LIMIT to zero zdo forever yDo a depth-first search up to LIMIT levels deep yIf a goal is found, return success,  else add 1 to LIMIT zEach time through the loop we start all over! zIf we find a path, it will be shortest-possible path zOnly requires linear space, because it's all DFS zIncreased time requirements are only linear!

Heuristic searching zAll the previous searches have been blind yThey make no use of any knowledge of the problem yIf we know something about the problem, we can usually do much, much better zExample: 15-puzzle yFor each piece, figure out how many moves away it is from its goal position, if no other piece were in the way yThe total of these gives a measure of distance from goal yThis is a heuristic measure

Heuristics zA heuristic is a rule of thumb for deciding which way to choose zThere is no general theory for finding heuristics, because every problem is different zChoice of heuristics depends on knowledge of the problem space zThere are many well-known heuristics for chess zThis is where the "I" in "AI" comes in

Best-first searching zUse the same basic search algorithm  Choose from OPEN the "best" node, that is, the one that seems to be closest to a goal zGenerally, even very poor heuristics are significantly better than blind search, but... zNo guarantee that the best path will be found zNo guarantee on the space requirements

The A* algorithm zSuppose:  you keep track of the distance g(N) that each node N you visit is from the start state  you have some heuristic function, h(N), that estimates the distance between node N and a goal zThen  f(N) = g(N) + h(N) gives you the (partially estimated) distance from the start node to a goal node  The A* algorithm is: choose from OPEN the node N with the smallest value of f(N)

The A* formula  g(N) is the (known) distance from start to N  h(N) is the (estimated) distance from N to a goal  f(N) is our best guess as to the distance from start to N

How good is A*? zMemory usage depends on the heuristic function  If h(N) = constant, A* = breadth-first yIf h(N) is a perfect estimator, A* goes straight to goal ...but if h(N) were perfect, why search?  Quality of solution also depends on h(N)  It can be proved that, if h(N) is optimistic (never overestimates the distance to a goal), then A* will find a best solution (shortest path to a goal)

IDA* zA* may require exponential storage zSolution: Iterative-deepening A* (IDA*) yJust like Iterative Deepening, but... ...instead of using g(N) to cut off searching... ...use f(N) zIDA* gives the same results as A* zSince IDA* is basically a depth-first search, storage requirements are linear in length of path

Conclusion zMany (or most) problems in AI can be represented as state-space searches zThe best searches combine a basic blind search technique with heuristic knowledge about the problem space zA* and its variations, especially IDA*, are the best heuristic search techniques known

The End