Heuristic Search: A* CPSC 322 Search 4 January 19, Textbook 3.6 Taught by: Vasanth

Similar documents
Search with Costs and Heuristic Search

A* optimality proof, cycle checking

Recap A Search Optimality of A. Search: A. CPSC 322 Search 5. Textbook 3.6. Search: A CPSC 322 Search 5, Slide 1

A and Branch-and-Bound Search

Heuristic Search and Advanced Methods

Search. (Textbook Chpt ) Computer Science cpsc322, Lecture 2. May, 10, CPSC 322, Lecture 2 Slide 1

Lecture 6 Analysis of A*, B&B Search Refinements

Uniformed Search (cont.)

Uninformed Search. (Textbook Chpt 3.5) Computer Science cpsc322, Lecture 5. May 18, CPSC 322, Lecture 5 Slide 1

Informed Search and Exploration for Agents

Heuristic Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1

Informed Search Methods

Uninformed Search Strategies

mywbut.com Informed Search Strategies-I

Chapter 3: Informed Search and Exploration. Dr. Daisy Tang

Heuristic Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

Search. CS 3793/5233 Artificial Intelligence Search 1

Informed search methods

Problem Solving and Search

Announcements. Solution to Assignment 1 is posted Assignment 2 is available Video automatically uploaded (see web page)

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016

Informed search strategies (Section ) Source: Fotolia

Informed Search A* Algorithm

Search: Advanced Topics and Conclusion

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018

Search: Advanced Topics and Conclusion

Lecture 3 - States and Searching

Announcements. CS 188: Artificial Intelligence

Informed/Heuristic Search

A.I.: Informed Search Algorithms. Chapter III: Part Deux

Uninformed Search. CPSC 322 Lecture 5. January 17, 2007 Textbook 2.4. Uninformed Search CPSC 322 Lecture 5, Slide 1

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics,

Uninformed Search. CPSC 322 Lecture 5. September 14, 2007 Textbook 2.4. Graph Search Searching Depth-First Search

Today. Informed Search. Graph Search. Heuristics Greedy Search A* Search

Heuristic (Informed) Search

Artificial Intelligence

CS 771 Artificial Intelligence. Informed Search

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

Solving problems by searching

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

3 SOLVING PROBLEMS BY SEARCHING

Informed Search CS457 David Kauchak Fall 2011

Informed Search Algorithms

Informed Search and Exploration

Artificial Intelligence

S A E RC R H C I H NG N G IN N S T S A T T A E E G R G A R PH P S

Lecture 5 Heuristics. Last Time: A* Search

Class Overview. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 2. Problem Solving Agents. Problem Solving Agents: Assumptions

Informed (Heuristic) Search. Idea: be smart about what paths to try.

CS 5522: Artificial Intelligence II

CS 188: Artificial Intelligence. Recap Search I

Branch & Bound (B&B) and Constraint Satisfaction Problems (CSPs)

CS 331: Artificial Intelligence Informed Search. Informed Search

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.2, Page 1

CS 331: Artificial Intelligence Informed Search. Informed Search

Searching. Assume goal- or utilitybased. Next task to achieve is to determine the best path to the goal

INTRODUCTION TO HEURISTIC SEARCH

521495A: Artificial Intelligence

Search : Lecture 2. September 9, 2003

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

CS 188: Artificial Intelligence Fall Search Gone Wrong?

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Informed Search and Exploration

CS 343H: Artificial Intelligence

CS:4420 Artificial Intelligence

Informed (heuristic) search (cont). Constraint-satisfaction search.

Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Informed Search Lecture 5

CS 520: Introduction to Artificial Intelligence. Lectures on Search

Outline. Best-first search

Outline. Best-first search

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4

Route planning / Search Movement Group behavior Decision making

CS 343: Artificial Intelligence

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

CPSC 436D Video Game Programming

Heuris'c Search. Reading note: Chapter 4 covers heuristic search.

CSCI 446: Artificial Intelligence

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km

CS 188: Artificial Intelligence

CPS 170: Artificial Intelligence Search

A* Optimality CS4804

ARTIFICIAL INTELLIGENCE. Informed search

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 23 January, 2018

DFS. Depth-limited Search

Solving Problems by Searching

Heuristic (Informed) Search

Outline for today s lecture. Informed Search I. One issue: How to search backwards? Very briefly: Bidirectional search. Outline for today s lecture

Informed search algorithms

Today s s lecture. Lecture 3: Search - 2. Problem Solving by Search. Agent vs. Conventional AI View. Victor R. Lesser. CMPSCI 683 Fall 2004

Lecture 2: Fun with Search. Rachel Greenstadt CS 510, October 5, 2017

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

Informed Search. CMU Snake Robot. Administrative. Uninformed search strategies. Assignment 1 was due before class how d it go?

CS 460/560 Introduction to Computational Robotics Fall 2017, Rutgers University. Lecture 08 Extras. A* In More Detail. Instructor: Jingjin Yu

Solving Problems by Searching

Solving problems by searching

Transcription:

Heuristic Search: A* CPSC 322 Search 4 January 19, 2011 Textbook 3.6 Taught by: Vasanth 1

Lecture Overview Recap Search heuristics: admissibility and examples Recap of BestFS Heuristic search: A* 2

Example for search with costs: finding routes 3

Lowest-Cost First Search (LCFS) Expand the path with the lowest cost Generalization of Breadth-First Search Implemented as priority queue of cost values Only complete for strictly positive arc costs - Otherwise: a cycle with zero cost <= 0 could be followed forever Only optimal for non-negative arc costs - Otherwise: a path that initially looks high-cost could end up getting a ``refund Time and space complexity: O(b m ) - E.g., uniform arc costs: identical to Breadth-First Search Slide 4

Search heuristics Def.: A search heuristic h(n) is an estimate of the cost of the optimal (cheapest) path from node n to a goal node. n1 Estimate: h(n1) n2 Estimate: h(n2) n3 Estimate: h(n3) Slide 5

Last lecture s example: finding routes What could we use as h(n)? E.g., the straight-line distance between source and goal node 7

Admissibility of a heuristic Def.: Let c(n) denote the cost of the optimal path from node n to any goal node. A search heuristic h(n) is called admissible if h(n) c(n) for all nodes n, i.e. if for all nodes it is an underestimate of the cost to any goal. Example: is the straight-line distance admissible? YES NO - Yes! The shortest distance between two points is a line. 8

Admissibility of a heuristic Def.: Let c(n) denote the cost of the optimal path from node n to any goal node. A search heuristic h(n) is called admissible if h(n) c(n) for all nodes n, i.e. if for all nodes it is an underestimate of the cost to any goal. Another example: the goal is Urzizeni (red box), but all we know is the straight-linedistances to Bucharest (green box) Possible h(n) = sld(n, Bucharest) + cost(bucharest, Urzineni) Admissible? YES NO 9

Example 2: grid world Search problem: robot has to find a route from start to goal location G on a grid with obstacles Actions: move up, down, left, right from tile to tile Cost : number of moves Possible h(n)? - Manhattan distance (L 1 distance) to the goal G: sum of the (absolute) difference of their coordinates - Admissible? 4 3 YES NO 2 G 1 1 2 3 4 5 6 10

Example 3: Eight Puzzle One possible h(n): Number of Misplaced Tiles Is this heuristic admissible? YES NO 11

Example 3: Eight Puzzle Another possible h(n): Sum of number of moves between each tile's current position and its goal position Is this heuristic admissible? YES NO 12

How to Construct an Admissible Heuristic Identify relaxed version of the problem: - where one or more constraints have been dropped - problem with fewer restrictions on the actions Grid world: the agent can move through walls Driver: the agent can move straight 8 puzzle: - number of misplaced tiles : tiles can move everywhere and occupy same spot as others - sum of moves between current and goal position : tiles can occupy same spot as others Why does this lead to an admissible heuristic? - The problem only gets easier! 13

Lecture Overview Recap Search heuristics: admissibility and examples Recap of BestFS Heuristic search: A* 14

Best First Search (BestFS) Idea: always choose the path on the frontier with the smallest h value. BestFS treats the frontier as a priority queue ordered by h. Greedy approach: expand path whose last node seems closest to the goal Let s look at this in action: Optimal? AISPACE example, load from URL http://www.cs.ubc.ca/~hutter/teaching/cpsc322/ex-best-first-search.txt 15

Lecture Overview Recap Search heuristics: admissibility and examples Recap of BestFS Heuristic search: A* 17

A* search takes into account both - the cost of the path to a node c(p) - the heuristic value of that path h(p). Let f(p) = c(p) + h(p). A* Search - f(p) is an estimate of the cost of a path from the start to a goal via p. c(p) h(p) f(p) 18

A* combines elements of which two search algorithms? Breadth-first A* Search Algorithm Depth-first Best-first Least cost first It treats the frontier as a priority queue ordered by f(n) It always chooses the path on the frontier with the lowest estimated distance from the start to a goal node constrained to go via that path. Let s see it in action: 19

A* in Infinite Mario Bros http://www.youtube.com/watch?v=dlkms4zhhr8 20

Analysis of A* Def.: The time complexity of a search algorithm is the worst-case amount of time it will take to run, expressed in terms of - maximum path length m - maximum forward branching factor b. What is A* s time complexity, in terms of m and b? O(b m ) O(m b ) O(bm) O(b+m) E.g., uniform costs and constant heuristic h(n) = 0 - Behaves exactly like LCFS 21

A* completeness and optimality A* is complete (finds a solution, if one exists) and optimal (finds the optimal path to a goal) if: - the branching factor is finite - arc costs are > 0 - h(n) is admissible -> an underestimate of the length of the shortest path from n to a goal node. This property of A* is called admissibility of A* 23

Learning Goals for today s class Construct heuristic functions for specific search problems Define/read/write/trace/debug different search algorithms - With/without cost - Informed/Uninformed Formally prove A* optimality (continued next class) 24