State-Space Searches. The states of Pac-Man The ghosts in Pac-Man.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Knowledge Representation
Advertisements

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.
Tree Searching. Tree searches A tree search starts at the root and explores nodes from there, looking for a goal node (a node that satisfies certain conditions,
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
Abstract Data Types and Subprograms
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Search in AI.
Artificial Intelligence Lecture
Mahgul Gulzai Moomal Umer Rabail Hafeez
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.
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Toy Problem: Missionaries and Cannibals
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
17-Jun-15 Searching in BeeperHunt (Mostly minor variations on old slides)
Using Search in Problem Solving
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?
Robotics Versus Artificial Intelligence. Search. SearchSearch “All AI is search” “All AI is search”  Game theory  Problem spaces Every problem is a.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Problem Spaces and Search Fall 2008 Jingsong.
Using Search in Problem Solving
Artificial Intelligence Methods Rao Vemuri Searching - 2.
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.
On Search Search is one of the most common CS problems. There are lots of different algorithms for searching through a set of alternatives. They can be.
Chapter 5.4 Artificial Intelligence: Pathfinding.
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.
Heuristic searching. State spaces zA state space consists of yA (possibly infinite) set of states xThe start state represents the initial problem xEach.
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.
State-Space Searches.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Tree Searching Breadth First Search Dept First Search.
GRAPHS
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Alpha-beta Search. Two-player games zThe object of a search is to find a path from the starting position to a goal position zIn a puzzle-type problem,
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.
Trees – Part 2 CS 367 – Introduction to Data Structures.
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.
A RTIFICIAL I NTELLIGENCE UNIT : 2 Search Techniques.
Lecture 7: Uninformed Search Dr John Levine Algorithms and Complexity February 13th 2006.
Search exploring the consequences of possible actions.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search exploring the consequences of possible actions.
Lecture 3: Uninformed Search
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
G5BAIM Artificial Intelligence Methods Graham Kendall Searching.
Advanced Artificial Intelligence Lecture 2: Search.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
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.
Source: David Lee Matuszek
Artificial Intelligence Solving problems by searching.
Tree Searching.
Artificial Intelligence
Tree Searching.
Tree Searching.
Tree Searching.
State-Space Searches.
State-Space Searches.
State-Space Searches.
Presentation transcript:

State-Space Searches

The states of Pac-Man

The ghosts in Pac-Man

Other uses of states zThe Pac-Man game as a whole can be described by a state machine zStates are: Title screen, instructions screen, various game levels, high scores screen zDesigning "by states" is a useful techinque for all kinds of programs, not just games

State-space searches zMany problems in Artificial Intelligence can be describes as a search through a space of states zThere is a start state and one or more goal states; the object is to navigate a path from the start state to some goal state zIf you have an opponent, this isn't just a matter of finding a path zRules control the transition from one state to the next

Tic-Tac-Toe (Naughts and Crosses)

Basic searches zThere are two fundamental kinds of search: yBreadth-first search yDepth-first search zThere are many variations on search methods yThe most important in AI is the A* search zWhen alternating moves with an opponent, a different kind of search is needed yThe most important kind is the alpha-beta search

Breadth-first search

Depth-first search

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 zIf OPEN is a stack, this is a depth-first search zIf OPEN is a queue, this is a breadth-first search zOPEN may be a fancier structure

Breadth-first searching zPut 1 on queue zTake 1 off queue; not a goal zPut 2, 3, 4 on queue zTake 2 off queue; not a goal zPut 5, 6, 7 on queue zTake 3 off queue... queue: 1 2, 3, 4 3, 4, 5, 6, 7,... search order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

Depth-first searching zPut 1 on stack zTake 1 off stack; not a goal zPut 2, 3, 4 on stack zTake 4 off stack; not a goal zPut 11, 12, 13 on stack zTake 13 off stack... stack: 1 4, 3, 2 13, 12, 11, 3, 2,... search order: 1, 4, 13, 12, 11, 3, 10, 9, 8, 2, 7, 6, 5

Depth-first searches and stacks zA breadth-first search uses a queue; a depth-first search uses a stack zRecursive routines automatically use a stack zIt is possible (and easy) to write a depth-first search using the automatic stack zIf you do a breadth-first search, you have to implement the queue yourself

Recursive depth-first search zboolean search (node N) yif N is a goal node, return true yfor each child C of N xif search(C) succeeds, return true yreturn false

Advantages/disadvantages zIf a breadth-first search succeeds, it finds the nearest possible goal zIf a depth-first search succeeds, it may find an arbitrarily bad path to a goal zA depth-first search requires an amount of memory that is linear in the search depth zA breadth-first search requires an amount of memory that is exponential in the search depth

Best-first searches zIf OPEN is neither a stack nor a queue, but is sorted according to most promising, we have a best-first search Initialize: put the start node into OPEN while OPEN is not empty take a node N from OPEN if N is a goal node, report success put the children of N onto OPEN Report failure

Heuristic searches zHow do we know which nodes are most promising? yAnswer 1: it depends on the problem yAnswer 2: we don't; we have to guess zA heuristic is a "rule of thumb" yIt uses incomplete information to evaluate our possible choices yAlgorithms guarantee a solution; heuristics don't yIt's (almost) always better to have an algorithm

The A* search zThe A* search combines the advantages of breadth-first search (good solutions) with the advantages of depth-first search (low memory requirements) zA* is a kind of heuristic search zWe won't get to it today

The End