Search CSC 358/4578 5.27.2003. Outline  Homework #7  GPS States and operators Issues  Search techniques DFS, BFS Beam search A* search Alpha-beta search.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

PROBLEM SOLVING AND SEARCH
Solving Problem by Searching
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*
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.
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.
Chapter 4 Search Methodologies.
Artificial Intelligence (CS 461D)
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Project 1: Background Informed search : 8- puzzle world BFS, DFS and A* algorithms Heuristics : Manhattan distance, Number of misplaced tiles Lisp programming.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Artificial Intelligence Chapter 3: Solving Problems by Searching
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
שיעור Lisp General Problem Solver בינה מלאכותית יעל נצר.
Introduction to AI & AI Principles (Semester 1) WEEK 10 (07/08) [John Barnden’s slides only] School of Computer Science University of Birmingham, UK.
Intelligent Agents What is the basic framework we use to construct intelligent programs?
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?
CSC344: AI for Games Lecture 4: Informed search
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.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2002.
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Informed Search Strategies
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.
Problem Solving and Search Andrea Danyluk September 11, 2013.
Functional Programming 02 Lists
Artificial Intelligence: Planning Lecture 6 Problems with state space search Planning Operators A Simple Planning Algorithm (Game Playing)
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.
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,
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
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.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Vilalta&Eick:Uninformed Search Problem Solving By Searching Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States/Looping.
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.
For Friday No reading Homework: –Chapter 11, exercise 4.
Lecture 3: Uninformed Search
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Advanced Artificial Intelligence Lecture 2: Search.
CSC3203: AI for Games Informed search (1) Patrick Olivier
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.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Search as a problem solving technique. Consider an AI program that is capable of formulating a desired goal based on the analysis of the current world.
CHAPTER 2 SEARCH HEURISTIC. QUESTION ???? What is Artificial Intelligence? The study of systems that act rationally What does rational mean? Given its.
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.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Search CSC 358/ Outline Homework #6 Game search States and operators Issues Search techniques DFS, BFS Beam search A* search Alpha-beta.
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.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Last time: Problem-Solving
Artificial Intelligence Problem solving by searching CSC 361
Search.
Search.
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Presentation transcript:

Search CSC 358/

Outline  Homework #7  GPS States and operators Issues  Search techniques DFS, BFS Beam search A* search Alpha-beta search

Homework #7  #I  with-list-iterator  doiter

GPS  General Problem Solver (GPS) Developed By Alan Newell And Herbert Simon 1957  Simon “It is not my aim to surprise or shock you. But the simplest way I can summarize is to say that there are now in the world machines that think, that learn, and create. Moreover, their ability to do these things is going to increase rapidly…”

GPS Cont’d  GPS Never Lived Up To Its Expectations  But: First Program To Focus On Knowledge Representation First Program To Separate Problem-Solving Strategy From Its Knowledge Of Particular Problems

GPS Cont’d  GPS Is Based On Means-Ends Analysis The Agent Determines What It Wants The Agent Determines What It Has The Agent Reduces The Differences Between What It Wants And What It Has

States  The World Is Described In Terms Of States  State Changes Are Caused By Operators That Apply To States To Produce New States

Operators  Preconditions must be true to be applicable  Post conditions Add list Delete list

Problem Solving  Problem-Solving Boils Down To Three Steps Select A Domain Discover A Way To Describe The Domain In Terms Of States Discover A Good Set Of Operators

Implementation  States States are symbols (predicate expressions)  GPS Represents Operators As Structures: Preconditions Add Lists Delete Lists

Basic Rules  Applicability The Operator Is Applicable When All Of Its Preconditions Are Satisfied. A Precondition Is Satisfied When It Is Found In The Current State  When The Operator Is Applied All Members Of The Delete List Are Removed All Members Of The Add List Are Added

Example  Initial State: (son-at-home car-needs-battery have-money have-phone-book)  Goal State: (son-at-school)  (GPS )

An Operator (make-op :action 'drive-son-to-school :preconds '(son-at-home car-works) :add-list '(son-at-school) :del-list '(son-at-home))

GPS Algorithm  Iterate Over A List Of Goals Attempt To Achieve Them One By One  A Goal Is Achieved If It Is A Member Of The Current State  A Goal Can Be Achieved If There Is An Operator That Can Achieve It

GPS Algorithm Cont’d (defun appropriate-p (goal op) (member goal (op-add-list op))) (defun achieve (goal) (or (member goal *state*) (some #’apply-op (find-all goal *ops* :test #’appropriate-p)))

GPS Algorithm Cont’d (defun apply-op (op) (when (every #’achieve (op-preconds op)) (push (op-action op) *ops*) (setf *state* (set-difference *state* (op-del-list op))) (setf *state* (union *state* (op-add-list op))) t))

GPS Algorithm Cont’d (defvar *state* nil) (defvar *ops* nil) (defun gps (state goals ops) (if (every #’achieve goals) *ops* nil))

GPS Problems  The Clobbered Sibling Goal  Running Around The Block  Leaping Before You Look  Recursive Subgoal  Sussman anomaly  Perfect information  Perfect action

Planning  States are combinations of predicates  Operators may have conditional effects  Interleaving of planning and execution replanning

Generalizing GPS: Search Tools  Start State  Goal State  Successors  Search Strategy

Tree Search

Tree Search, cont'd  Main question How to order the states?

Tree Search Cont’d (defun tree-search (states goal-p successors combiner) (cond ((null states) fail) ((funcall goal-p (first states)) (first states)) (t (tree-search (funcall combiner (funcall successors (first states)) (rest states)) goal-p successors combiner))))

Tree Search: Depth First Search  Work On The Longest Paths First  Backtrack Only When The Current State Has No More Successors (defun depth-first-search (start goal-p successors) (tree-search (list start) goal-p successors #’append))

Tree Search: DFS Summary  Depth-First Search Is OK In Finite Search Spaces  In Infinite Search Spaces, Depth-First Search May Never Terminate

Tree Search: Breadth-First Search  Search The Tree Layer By Layer (defun prepend (x y) (append y x)) (defun breadth-first-search (start goal-p successors) (tree-search (list start) goal-p successors #’prepend))

Tree Search: BFS Summary  In Finite Search Spaces, BFS Is Identical To DFS  In Infinite Search Spaces, BFS Will Always Find A Solution If It Exists  BFS Requires More Space Than DFS

Iterative Deepening  Search depth first to level n then increase n  Seems wasteful but actually is the best method for large spaces of unknown charcteristics

Bi-Directional Search  Work forwards from start  Work backwards from goal  Until the two points meet

Controlling Search  Neither DFS Nor BFS Take Advantage Of Any Knowledge Of The Domain  In Many Domains, One Can Estimate How Far The Current State Is From The Goal State  If One Can Estimate The Distance, One Can Always Choose The Successor State That Is Closest

Best First Search (defun sorter (cost-fn) #’(lambda (new old) (sort (append new old) #’< :key cost- fn))) (defun best-first-search (start goal-p successors cost-fn) (tree-search (list start) goal-p successors (sorter cost-fn)))

Greedy Search  Best = closest to goal  Problem Isn't guaranteed to find a solution  not complete Isn't guaranteed to find the best solution  not optimal

A* Search  Best = min (path so far + estimated cost to goal)  Restriction estimate must never overestimate the cost  If so complete optimal

Beam Search  All Search Strategies So Far Keep An Ever Increasing List Of States  DFS, BFS, And Best-First Search Are Designed To Search For A Unique Solution  If There Are Many Solutions, One Does Not Need To Keep As Many States  Beam Search Keeps Only A Limited Number Of States

Beam Search Cont’d (defun beam-search (start goal-p sucessors cost-fn beam-width) (tree-search (list start) goal-p succecssors #’(lambda (old new) (let ((sorted (funcall (sorter cost-fn) old new))) (if (> beam-width (length sorted)) sorted (subseq sorted 0 beam-width))))))

Improving Beam Search  The Width Of The Beam May Not Be Sufficient To Find A Solution  One Can Try Different Beam Widths (defun iter-wide-search (start goal-p successors &key (width 1) (max 100)) (unless (> width max) (or (beam-search start goal-p successors cost-fn width) (iter-wide-search start goal-p successors cost-fn :width (+ width 1) :max max))))

Homework #8  GPS problems