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

Similar documents
Uninformed Search Strategies AIMA 3.4

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

Introduction to Artificial Intelligence. Informed Search

Artificial Intelligence. Informed search methods

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

Informed search algorithms

Informed Search and Exploration

Overview. Path Cost Function. Real Life Problems. 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

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Artificial Intelligence

Informed search algorithms. Chapter 4, Sections 1 2 1

Informed Search and Exploration

CS:4420 Artificial Intelligence

Informed search methods

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Artificial Intelligence Informed search. Peter Antal

Artificial Intelligence: Search Part 2: Heuristic search

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

CS 771 Artificial Intelligence. Informed Search

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 3: Search 2.

Informed search algorithms

CS 380: Artificial Intelligence Lecture #4

Artificial Intelligence

Planning, Execution & Learning 1. Heuristic Search Planning

Introduction to Artificial Intelligence (G51IAI)

Artificial Intelligence

Outline. Best-first search

Artificial Intelligence

COSC343: Artificial Intelligence

Problem solving and search

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,

Informed Search and Exploration

Solving problems by searching

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

Outline. Best-first search

Informed Search A* Algorithm

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

Informed search algorithms

Informed Search Algorithms. Chapter 4

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies

CS414-Artificial Intelligence

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

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

Problem solving and search

Informed search algorithms

Informed search algorithms

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Solving Problems using Search

Problem solving and search

CSE 40171: Artificial Intelligence. Informed Search: A* Search

Robot Programming with Lisp

CAP 4630 Artificial Intelligence

Artificial Intelligence CS 6364

AGENTS AND ENVIRONMENTS. What is AI in reality?

Informed Search. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli Page 1

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

Artificial Intelligence

AGENTS AND ENVIRONMENTS. What is AI in reality?

Route planning / Search Movement Group behavior Decision making

Solving Problems by Searching

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal!

CS486/686 Lecture Slides (c) 2015 P.Poupart

4. Solving Problems by Searching

Artificial Intelligence Informed search. Peter Antal

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

Informed Search and Exploration

TDT4136 Logic and Reasoning Systems

CS486/686 Lecture Slides (c) 2014 P.Poupart

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

Informed Search and Exploration for Agents

CS 4700: Foundations of Artificial Intelligence

Artificial Intelligence

Solving Problems by Searching

Solving Problems by Searching

Informed Search Lecture 5

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

Chapter 3 Solving Problems by Searching Informed (heuristic) search strategies More on heuristics

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

Lecture 4: Informed/Heuristic Search

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

Lecture Plan. Best-first search Greedy search A* search Designing heuristics. Hill-climbing. 1 Informed search strategies. Informed strategies

Solving problems by searching

ARTIFICIAL INTELLIGENCE. Informed search

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

Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

Algorithm. December 7, Shortest path using A Algorithm. Phaneendhar Reddy Vanam. Introduction. History. Components of A.

Informed search algorithms

Solving problems by searching

DFS. Depth-limited Search

CS-E4800 Artificial Intelligence

Foundations of Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

Informatics 2D: Tutorial 2 (Solutions)

Solving Problems by Searching

Solving Problems by Searching

Informed/Heuristic Search

Informed search algorithms. Chapter 4

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria

Transcription:

Outline for today s lecture Informed Search I Uninformed Search Briefly: Bidirectional Search (AIMA 3.4.6) Uniform Cost Search (UCS) Informed Search Introduction to Informed search Heuristics 1 st attempt: Greedy Best-first search 2 Very briefly: Bidirectional search One issue: How to search backwards? Two simultaneous searches from start an goal. Motivation: In general, d / 2 d / 2 d b b Check whether the node belongs to the other frontier before expansion. Complete and optimal if both searches are Breadth-First. Most significant weakness: Space complexity b The predecessor of each node must be efficiently computable. Works well when actions are easily reversible. 3 4 Outline for today s lecture Uninformed Search Briefly: Bidirectional Search Uniform Cost Search (UCS) (AIMA 3.4.2) Informed Search Introduction to Informed search Heuristics 1 st attempt: Greedy Best-first search Uniform Cost Search In computer science, uniform-cost search (UCS) is a tree search algorithm used for traversing or searching a weighted tree, tree structure, or graph. - Wikipedia 5 6 1

Motivation: Romanian Map Problem All our search methods so far assume step-cost = 1 This is only true for some problems 7 g(n): the path cost function Our assumption so far: All moves equal in cost Cost = # of nodes in path-1 g(n) = depth(n) in the search tree More general: Assigning a (potentially) unique cost to each step N 0, N 1, N 2, N 3 = nodes visited on path p from N 0 to N 3 C(i,j): Cost of going from N i to N j If N 0 the root of the search tree, g(n3)=c(0,1)+c(1,2)+c(2,3) 8 Uniform-cost search (UCS) Uniform Cost Search Slide from Stanford CS 221 (from slide by Dan Klein (UCB) and many others) Extension of BF-search: Expand node with lowest path cost Implementation: frontier = priority queue ordered by g(n) Subtle but significant difference from BFS: Tests if a node is a goal state when it is selected for expansion, not when it is added to the frontier. Updates a node on the frontier if a better path to the same state is found. So always enqueues a node before checking whether it is a goal. WHY??? 9 Expand cheapest node first: Frontier is a priority queue No longer ply at a time, but follows cost contours Therefore: Must be optimal Cost contours d b 4 c 11 a 6 a S 3 e 9 p 1 p q e 5 h 13 r 7 f 8 q 11 c G 10 a p 2 a G b c 1 8 2 2 e 3 d 9 f S h 8 1 1 1 p r q 15 h 17 r 11 q 0 q c G a f 10 q 16 Complexity of UCS Complete! Optimal! if the cost of each step exceeds some positive bound ε. Time complexity: O(b C*/ε + 1 ) Space complexity: O(b C*/ε + 1 ) where C* is the cost of an optimal solution, and ε is min(c(i,j)) (if all step costs are equal, this becomes O(b d+1 ) NOTE: Dijkstra s algorithm just UCS without goal Summary of algorithms (for notes) Criterion Complete? Breadth- First Uniformcost Depth- First Depthlimited Iterative deepening Bidirectional search YES YES NO NO YES YES Time b d b (C*/e)+1 b m b l b d b d/2 Space b d b (C*/e)+1 bm bl bd b d/2 Optimal? YES YES NO NO YES YES Assumes b is finite 11 12 2

Outline for today s lecture Is Uniform Cost Search the best we can do? Consider finding a route from Bucharest to.. Uninformed Search Briefly: Bidirectional Search Uniform Cost Search (UCS) Informed Search Introduction to Informed search Heuristics 1 st attempt: Greedy Best-first search g(n)<300 g(n)<200 g(n)<100 13 14 Is Uniform Cost Search the best we can do? Consider finding a route from Bucharest to.. A Better Idea g(n)<300 g(n)<200 g(n)<100 Node expansion based on an estimate which includes distance to the goal General approach of informed search: Best-first search: node selected for expansion based on an evaluation function f(n) f(n) includes estimate of distance to goal (new idea!) WRONG WAY!!!! Implementation: Sort frontier queue by this new f(n). Special cases: greedy search, A* search 15 16 Simple, useful estimate heuristic: straight-line distances Heuristic (estimate) functions Heureka! ---Archimedes [dictionary] A rule of thumb, simplification, or educated guess that reduces or limits the search for solutions in domains that are difficult and poorly understood. 17 Heuristic knowledge is useful, but not necessarily correct. Heuristic algorithms use heuristic knowledge to solve a problem. A heuristic function h(n) takes a state n and returns an estimate of the distance from n to the goal. (graphic: http://hyperbolegames.com/2014/10/20/eureka-moments/) 18 3

Breadth First for Games, Robots, vs. an optimal informed search algorithm (A*) Pink: Starting Point Blue: Goal Teal: Scanned squares Darker: Closer to starting point We add a heuristic estimate of distance to the goal Graphics from http://theory.stanford.edu/~amitp/gameprogramming/ (A great site for practical AI & game Programming Yellow: Blue: examined nodes with high estimated distance examined nodes with low estimated distance 19 20 Breadth first in a world with obstacles Greedy best-first search in a world with obstacles 21 22 Informed search (A*) in a world with obstacles Outline for today s lecture Uninformed Search Briefly: Bidirectional Search Uniform Cost Search (UCS) Informed Search Introduction to Informed search Heuristics 1st attempt: Greedy Best-first search (AIMA 3.5.1) 23 24 4

Review: Best-first search Basic idea: select node for expansion with minimal evaluation function f(n) where f(n) is some function that includes estimate heuristic h(n) of the remaining distance to goal Greedy best-first search: f(n) = h(n) Expands the node that is estimated to be closest to goal Completely ignores g(n): the cost to get to n Here, h(n) = h SLD (n) = straight-line distance from ` to Bucharest Implement using priority queue Exactly UCS with f(n) replacing g(n) 25 26 Frontier queue: 366 Greedy best-first search example Greedy best-first search example Sibiu 253 Timisoara 329 Zerind 374 Initial State = Goal State = Bucharest 27 28 Greedy best-first search example Fagaras 176 Rimnicu Vilcea 193 Timisoara 329 366 Zerind 374 Oradea 380 Greedy best-first search example Bucharest 0 Rimnicu Vilcea 193 Sibiu 253 Timisoara 329 366 Zerind 374 Oradea 380 Goal reached!! 29 30 5

Properties of greedy best-first search Properties of greedy best-first search Optimal? No! Found: Sibiu Fagaras Bucharest (450km) Shorter: Sibiu Rimnicu Vilcea Pitesti Bucharest (418km) Complete? No can get stuck in loops, e.g., Iasi Neamt Iasi Neamt Goal Initial 31 32 Properties of greedy best-first search Complete? No can get stuck in loops, e.g., Iasi Neamt Iasi Neamt Time? O(b m ) worst case (like Depth First Search) But a good heuristic can give dramatic improvement of average cost Space? O(b m ) priority queue, so worst case: keeps all (unexpanded) nodes in memory Optimal? No Next time: A* search Best-known form of best-first search. Key Idea: avoid expanding paths that are already expensive, but expand most promising first. Simple idea: f(n)=g(n) + h(n) g(n) the cost (so far) to reach the node h(n) estimated cost to get from the node to the goal f(n) estimated total cost of path through n to goal Implementation: Frontier queue as priority queue by increasing f(n) (as expected ) 33 34 IF TIME Optimal informed search: A* (AIMA 3.5.2) Optimal informed search: A* Best-known informed search method Key Idea: avoid expanding paths that are already expensive, but expand most promising first. Simple idea: f(n)=g(n) + h(n) Implementation: Same as before Frontier queue as priority queue by increasing f(n) 35 36 6

Key concept: Admissible heuristics A heuristic h(n) is admissible if it never overestimates the cost to reach the goal; i.e. it is optimistic Formally: n, n a node: 1. h(n) h*(n) where h*(n) is the true cost from n 2. h(n) 0 so h(g)=0 for any goal G. 366 Example: h SLD (n) never overestimates the actual road distance Theorem: If h(n) is admissible, A * using Tree Search is optimal 37 38 Sibiu 393 Rimricu Vicea 413 Fagaras 415 646 Oradea 671 We add the three nodes we found to the Frontier queue. We sort them according to the g()+h() calculation. When we expand Sibiu, we run into again. Note that we ve already expanded this node once; but we still add it to the Frontier queue again. 39 40 Fagaras 415 Pitesti 417 Pitesti 417 Bucharest 450 Craiova 526 Craiova 526 Sibiu 553 Sibiu 553 646 Sibiu 591 Oradea 671 646 Oradea 671 We expand Rimricu Vicea. When we expand Fagaras, we find Bucharest, but we re not done. The algorithm doesn t end until we expand the goal node it has to be at the top of the Frontier queue. 41 42 7

Bucharest 418 Bucharest 450 Craiova 526 Sibiu 553 Sibiu 591 Rimricu Vicea 607 Craiova 615 646 Oradea 671 Note that we just found a better value for Bucharest! Now we expand this better value for Bucharest since it s at the top of the queue. We re done and we know the value found is optimal! 43 8