Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013

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

CS 331: Artificial Intelligence Informed Search. Informed Search

CS 331: Artificial Intelligence Informed Search. Informed Search

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

Informed/Heuristic Search

Artificial Intelligence

Informed Search and Exploration for Agents

Informed Search. Xiaojin Zhu Computer Sciences Department University of Wisconsin, Madison

Informed search strategies (Section ) Source: Fotolia

CS 380: Artificial Intelligence Lecture #4

Problem Solving and Search

Artificial Intelligence

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

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

Informed Search and Exploration

CPS 170: Artificial Intelligence Search

CS 771 Artificial Intelligence. Informed Search

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

Problem Solving & Heuristic Search

Lecture 4: Informed/Heuristic Search

Lecture 5 Heuristics. Last Time: A* Search

Informed Search Algorithms

Solving problems by searching

Outline. Best-first search

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

Informed search methods

Outline. Best-first search

Informed search algorithms. Chapter 4

Informed search algorithms. Chapter 4, Sections 1 2 1

Heuristic Search. Heuristic Search. Heuristic Search. CSE 3401: Intro to AI & LP Informed Search

DFS. Depth-limited Search

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

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

Last time: Problem-Solving

Informed Search CS457 David Kauchak Fall 2011

Ar#ficial)Intelligence!!

ARTIFICIAL INTELLIGENCE. Informed search

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

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

Artificial Intelligence Informed search. Peter Antal

Informed Search and Exploration

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

Informed Search A* Algorithm

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

Informed Search Methods

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Artificial Intelligence. Sina Institute, University of Birzeit

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

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

ITCS 6150 Intelligent Systems. Lecture 5 Informed Searches

Informed search algorithms

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

mywbut.com Informed Search Strategies-I

CS:4420 Artificial Intelligence

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Search : Lecture 2. September 9, 2003

Outline for today s lecture. Informed Search. Informed Search II. Review: Properties of greedy best-first search. Review: Greedy best-first search:

Announcements. CS 188: Artificial Intelligence

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Sina Institute, University of Birzeit

CSC384: Intro to Artificial Intelligence Search III

521495A: Artificial Intelligence

COMP9414: Artificial Intelligence Informed Search

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

COMP9414: Artificial Intelligence Informed Search

Solving problems by searching

3 SOLVING PROBLEMS BY SEARCHING

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

CS 188: Artificial Intelligence

Solving problems by searching

Searching with Partial Information

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,

Artificial Intelligence

Informed search methods

CS 343: Artificial Intelligence

Vorlesung Grundlagen der Künstlichen Intelligenz

Chapters 3-5 Problem Solving using Search

Informed search algorithms. Chapter 4

Introduction to Artificial Intelligence. Informed Search

Artificial Intelligence p.1/49. n-queens. Artificial Intelligence p.2/49. Initial state: the empty board or a board with n random

CS 188: Artificial Intelligence Fall Search Gone Wrong?

Artificial Intelligence

Artificial Intelligence

Problem solving and search

Artificial Intelligence Informed Search

Informed search algorithms

Outline. Informed Search. Recall: Uninformed Search. An Idea. Heuristics Informed search techniques More on heuristics Iterative improvement

Introduction to Computer Science and Programming for Astronomers

CSCI 446: Artificial Intelligence

Artificial Intelligence

Efficient memory-bounded search methods

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Dan Klein, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

Artificial Intelligence

Informed search algorithms

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

Informed Search. Notes about the assignment. Outline. Tree search: Reminder. Heuristics. Best-first search. Russell and Norvig chap.

CAP 4630 Artificial Intelligence

Problem solving and search

Informed Search (Ch )

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

Artificial Intelligence. Informed search methods

Transcription:

Informed Search CS 486/686: Introduction to Artificial Intelligence Fall 2013 1

Outline Using knowledge Heuristics Bestfirst search Greedy bestfirst search A* search Variations of A* Back to heuristics 2

Last lecture Uninformed search uses no knowledge about the problem Expands nodes based on distance from start node (never looks ahead to goal) Pros Very general Cons Very expensive Nonjudgemental Some are complete, some are not 3

Informed Search We often have additional knowledge about the problem Knowledge is often merit of a node (value of a node) Example: Romania travel problem? Different notions of merit Cost of solution Minimizing computation 4

Informed Search Uninformed search expands nodes based on distance from start node, d(nstart, n) Why not expand on distance to goal, d(n,ngoal)? What if we do not know d(n,n goal) exactly? Heuristic function, h(n) 5

Example: Path Planning Romania example What is a reasonable heuristic? Is it always right? 6

Heuristics If h(n 1)<h(n2) We guess it is cheaper to reach the goal from n1 than n2 We require h(n goal)=0 For now, just assume we have some heuristic h(n) 7

(Greedy) BestFirst Search Expand the most promising node according to the heuristic Bestfirst is similar to DFS (how similar depends on the heuristics If h(n)=0 for all n, bestfirst search is the same as BFS 8

Example: Best First search heuristic function h=4 h=3 h=2 h=1 h=0 S A B C 2 1 1 2 G path cost 4 9

Example: Best First Search h=4 h=2 h=2.5 S A B 2 1 2 h=0 G 1 C 1 h=1 10

Judging Best First Search Good news Informed search method Bad news Not optimal Not complete: but OK if we check repeated states Exponential space: might need to keep all nodes in memory Exponential time (O(bm )) but if we choose a good heuristic then we can do much better! (See Good news) 11

A* Search Bestfirst search is too greedy Solution? Let g be the cost of the path so far Let h be a heuristic function Let f(n)=g(n)+h(n) estimate of cost of current path A* search Expand node in fringe with lowest fvalue 12

A* Search Algorithm At every step, expand node n from front of the queue Enqueue the successor nʼ with priorities f(nʼ)=g(nʼ)+h(nʼ) Terminate when goal state is popped from the queue 13

Example: A* search heuristic function h=4 h=3 h=2 h=1 h=0 S A B C 2 1 1 2 G path cost 4 14

When Should A* Terminate? Only when G has been popped from the queue 1 S 1 h=7 A B h=3 7 G C h=2 D 7 h=1 1 1 15

A* and Revisiting States What if we revisit a state that was already expanded? 1 S 1 h=7 A B h=3 1 2 C h=2 G 7 16

Is A* Optimal? S 3 G 1 A 1 1 h=6 17

Admissible Heuristics Let h*(n) be the shortest path from n to any goal state A heuristic is admissible if h(n) h*(n) for all n Admissible heuristics are optimistic Always have h(n goal)=0 for any admissible heuristic 18

Optimality of A* If the heuristic is admissible then A* with treesearch is optimal Proof by contradiction Let goal G 2 be in the queue. Let n be an unexpanded node on the shortest path to optimal goal G. Assume that A* chose G 2 to expand. Thus, it must be that f(n)>f(g 2 ) But f(g 2 )=g(g 2 ) since h(g 2 )=0 >= g(g) since G 2 is suboptimal >= f(n) since h is admissible Contradiction. Therefore, A* will never select G 2 for expansion. 19

Optimality of A* For graphs we require consistency h(n) cost(n,nʼ)+h(nʼ) Almost any admissible heuristic function will also be consistent A* search on graphs with a consistent heuristic is optimal 20

Judging A* Good news Complete Optimal (if heuristic is admissible) Time complexity: Exponential in worst case but a good heuristic helps a lot Bad news A* keeps all generated nodes in memory On many problems A* runs out of memory 21

MemoryBounded Heuristic Search Iterative Deepening A* (IDA*) Basically depthfirst search but using the fvalue to decide which order to consider nodes Use flimit instead of depth limit New flimit is the smallest fvalue of any node that exceeded cutoff on previous iteration Additionally keep track of next limit to consider IDA* has same properties as A* but uses less memory 22

MemoryBounded Heuristic Search Simplified MemoryBounded A* (SMA*) Uses all available memory Proceeds like A* but when it runs out of memory it drops the worst leaf node (one with highest f value) If all leaf nodes have same fvalue, drop oldest and expand newest Optimal and complete if depth of shallowest goal node is less than memory size 23

Heuristic Functions A good heuristic function can make all the difference! How do we get heuristics? 24

8 Puzzle Relax the game 1. Can move from A to B is A is next to B 2. Can move from A to B if B is blank 3. Can move from A to B 25

8 Puzzle 3 leads to misplaced tile heuristic Number of moves = number of misplaced tiles Admissible 1 leads to Manhatten distance heuristic Admissible 26

8 Puzzle h 1=misplaced tiles, h2=manhatten distance Note: h 2 dominates h1 h 2(n) h1(n) for all n Even though both h 1 and h2 are admissible heuristics, h2 is a better heuristic 27

8 Puzzle and Heuristics Depth IDS A*(h 1 ) A*(h 2 ) 2 10 6 6 4 112 13 12 8 6384 39 25 12 3644035 227 73 24 39135 1641 28

Designing Heuristics Relax the problem Precompute solution costs of subproblems and storing them in a pattern database Learning from experience with the... problem class 29

Summary What you should know Thoroughly understand A* Be able to trace simple examples of A* execution Understand admissibility of heuristics Completeness, optimality 30