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

Similar documents
Informed search algorithms

Informed search algorithms. Chapter 4, Sections 1 2 1

Artificial Intelligence: Search Part 2: Heuristic search

Planning, Execution & Learning 1. Heuristic Search Planning

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

Introduction to Artificial Intelligence. Informed Search

Artificial Intelligence

TDT4136 Logic and Reasoning Systems

Informed search algorithms

CS:4420 Artificial Intelligence

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Informed Search and Exploration

Problem solving and search

Informed Search and Exploration

Informed Search Algorithms. Chapter 4

Informed Search and Exploration for Agents

COSC343: Artificial Intelligence

Informed Search and Exploration

Problem solving and search

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

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

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

Robot Programming with Lisp

Informed search algorithms

Artificial Intelligence

Informed search algorithms. Chapter 4

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

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

Artificial Intelligence. Informed search methods

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

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

Outline. Best-first search

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Informed/Heuristic Search

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

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

Artificial Intelligence

Outline. Best-first search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

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

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

Advanced Artificial Intelligence (DT4019, HT10)

CS 380: Artificial Intelligence Lecture #4

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

ARTIFICIAL INTELLIGENCE. Informed search

Lecture 4: Informed/Heuristic Search

Introduction to Artificial Intelligence (G51IAI)

Solving problems by searching

Artificial Intelligence

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

Artificial Intelligence CS 6364

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

CS414-Artificial Intelligence

2006/2007 Intelligent Systems 1. Intelligent Systems. Prof. dr. Paul De Bra Technische Universiteit Eindhoven

CS 771 Artificial Intelligence. Informed Search

Problem Solving: Informed Search

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

Problem solving and search

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

Informed search algorithms. Chapter 4

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

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

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

Foundations of Artificial Intelligence

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

Artificial Intelligence

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

Problem-solving agents. Solving Problems by Searching. Outline. Example: Romania. Chapter 3

Informed Search. Topics. Review: Tree Search. What is Informed Search? Best-First Search

Informed Search and Exploration

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel

16.1 Introduction. Foundations of Artificial Intelligence Introduction Greedy Best-first Search 16.3 A Weighted A. 16.

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

Informed search algorithms

Informed search algorithms

Artificial Intelligence Informed search. Peter Antal

Informed Search A* Algorithm

Foundations of Artificial Intelligence

Informed search strategies (Section ) Source: Fotolia

Solving Problems using Search

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

Informed search algorithms

CS 331: Artificial Intelligence Informed Search. Informed 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,

CS 331: Artificial Intelligence Informed Search. Informed Search

Artificial Intelligence. 2. Informed Search

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Foundations of Artificial Intelligence

Problem solving and search

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

Artificial Intelligence

Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

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

Searching and NetLogo

Informed search methods

Problem Solving and Search

Informatics 2D: Tutorial 2 (Solutions)

Solving Problems: Intelligent Search

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

Transcription:

Outline Best-first search Informed search algorithms A search Heuristics Chapter 4, Sections 1 2 Chapter 4, Sections 1 2 1 Chapter 4, Sections 1 2 2 Review: Tree search function Tree-Search( problem, fringe) returns a solution, or failure fringe Insert(Make-Node(Initial-State[problem]), fringe) loop do if fringe is empty then return failure node Remove-Front(fringe) if Goal-Test[problem] applied to State(node) succeeds return node fringe InsertAll(Expand(node, problem), fringe) A strategy is defined by picking the order of node expansion Best-first search Idea: use an evaluation function for each node estimate of desirability Expand most desirable unexpanded node Implementation: fringe is a queue sorted in decreasing order of desirability Special cases: greedy search A search Chapter 4, Sections 1 2 3 Chapter 4, Sections 1 2 4

Romania with step costs in km 71 Neamt 87 75 151 Iasi 140 92 99 Fagaras 118 80 Vaslui 111 142 211 Lugoj 97 Pitesti 70 98 146 Hirsova Mehadia 101 85 Urziceni 75 138 86 Bucharest 120 Dobreta 90 Craiova Eforie Giurgiu Straight line distance to Bucharest 366 Bucharest 0 Craiova 160 Dobreta 242 Eforie 161 Fagaras 178 Giurgiu 77 Hirsova 151 Iasi 226 Lugoj 244 Mehadia 241 Neamt 234 380 Pitesti 98 193 253 329 Urziceni 80 Vaslui 199 374 Greedy search Evaluation function h(n) (heuristic) = estimate of cost from n to the closest goal E.g., h SLD (n) = straight-line distance from n to Bucharest Greedy search expands the node that appears to be closest to goal Chapter 4, Sections 1 2 5 Chapter 4, Sections 1 2 6 Greedy search example Greedy search example 366 253 329 374 Chapter 4, Sections 1 2 7 Chapter 4, Sections 1 2 8

Greedy search example Greedy search example 329 374 329 374 Fagaras 366 176 380 193 Fagaras 366 380 193 Bucharest 253 0 Chapter 4, Sections 1 2 9 Chapter 4, Sections 1 2 10 Properties of greedy search Properties of greedy search Complete?? Complete?? No can get stuck in loops, e.g., with as goal, Iasi Neamt Iasi Neamt Complete in finite space with repeated-state checking Time?? Chapter 4, Sections 1 2 11 Chapter 4, Sections 1 2 12

Properties of greedy search Complete?? No can get stuck in loops, e.g., Iasi Neamt Iasi Neamt Complete in finite space with repeated-state checking Time?? O(b m ), but a good heuristic can give dramatic improvement Space?? Properties of greedy search Complete?? No can get stuck in loops, e.g., Iasi Neamt Iasi Neamt Complete in finite space with repeated-state checking Time?? O(b m ), but a good heuristic can give dramatic improvement Space?? O(b m ) keeps all nodes in memory Optimal?? Chapter 4, Sections 1 2 13 Chapter 4, Sections 1 2 14 Properties of greedy search Complete?? No can get stuck in loops, e.g., Iasi Neamt Iasi Neamt Complete in finite space with repeated-state checking Time?? O(b m ), but a good heuristic can give dramatic improvement Space?? O(b m ) keeps all nodes in memory Optimal?? No A search Idea: avoid expanding paths that are already expensive Evaluation function f(n) = g(n) + h(n) g(n) = cost so far to reach n h(n) = estimated cost to goal from n f(n) = estimated total cost of path through n to goal A search uses an admissible heuristic i.e., h(n) h (n) where h (n) is the true cost from n. (Also require h(n) 0, so h(g) = 0 for any goal G.) E.g., h SLD (n) never overestimates the actual road distance Theorem: A search is optimal Chapter 4, Sections 1 2 15 Chapter 4, Sections 1 2 16

A search example A search example 366=0+366 393=140+253 Chapter 4, Sections 1 2 17 Chapter 4, Sections 1 2 18 A search example A search example Fagaras 646=280+366 415=239+176 671=291+380 413=220+193 Fagaras 646=280+366 415=239+176 671=291+380 Craiova Pitesti 526=366+160 417=317+100 553=300+253 Chapter 4, Sections 1 2 19 Chapter 4, Sections 1 2 20

A search example A search example 646=280+366 Fagaras 671=291+380 646=280+366 Fagaras 671=291+380 Bucharest Craiova Pitesti 591=338+253 450=450+0 526=366+160 417=317+100 553=300+253 Bucharest Craiova Pitesti 591=338+253 450=450+0 526=366+160 553=300+253 Bucharest Craiova 418=418+0 615=455+160 607=414+193 Chapter 4, Sections 1 2 21 Chapter 4, Sections 1 2 22 Optimality of A (standard proof) Suppose some suboptimal goal G 2 has been generated and is in the queue. Let n be an unexpanded node on a shortest path to an optimal goal G 1. n Start Optimality of A (more useful) Lemma: A expands nodes in order of increasing f value Gradually adds f-contours of nodes (cf. breadth-first adds layers) Contour i has all nodes with f = f i, where f i < f i+1 O Z N G f(g 2 ) = g(g 2 ) since h(g 2 ) = 0 > g(g 1 ) since G 2 is suboptimal f(n) since h is admissible Since f(g 2 ) > f(n), A will never select G 2 for expansion G 2 A T 380 D L M 400 S R C F P 420 G B I U V H E Chapter 4, Sections 1 2 23 Chapter 4, Sections 1 2 24

Properties of A Properties of A Complete?? Complete?? Yes, unless there are infinitely many nodes with f f(g) Time?? Chapter 4, Sections 1 2 25 Chapter 4, Sections 1 2 26 Properties of A Complete?? Yes, unless there are infinitely many nodes with f f(g) Time?? Exponential in [relative error in h length of soln.] Space?? Properties of A Complete?? Yes, unless there are infinitely many nodes with f f(g) Time?? Exponential in [relative error in h length of soln.] Space?? Keeps all nodes in memory Optimal?? Chapter 4, Sections 1 2 27 Chapter 4, Sections 1 2 28

Properties of A Complete?? Yes, unless there are infinitely many nodes with f f(g) A heuristic is consistent if Proof of lemma: Consistency Time?? Exponential in [relative error in h length of soln.] h(n) c(n, a, n ) + h(n ) n Space?? Keeps all nodes in memory Optimal?? Yes cannot expand f i+1 until f i is finished A expands all nodes with f(n) < C A expands some nodes with f(n) = C A expands no nodes with f(n) > C If h is consistent, we have f(n ) = g(n ) + h(n ) = g(n) + c(n, a, n ) + h(n ) g(n) + h(n) = f(n) c(n,a,n ) n h(n ) h(n) G I.e., f(n) is nondecreasing along any path. Chapter 4, Sections 1 2 29 Chapter 4, Sections 1 2 30 E.g., for the 8-puzzle: Admissible heuristics h 1 (n) = number of misplaced tiles h 2 (n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) E.g., for the 8-puzzle: Admissible heuristics h 1 (n) = number of misplaced tiles h 2 (n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) 7 2 4 51 2 3 7 2 4 51 2 3 5 6 4 5 6 5 6 4 5 6 8 3 1 7 8 8 3 1 7 8 Start State Goal State Start State Goal State h 1 (S) =?? h 2 (S) =?? h 1 (S) =?? 6 h 2 (S) =?? 4+0+3+3+1+0+2+1 = 14 Chapter 4, Sections 1 2 31 Chapter 4, Sections 1 2 32

Dominance If h 2 (n) h 1 (n) for all n (both admissible) then h 2 dominates h 1 and is better for search Typical search costs: d = 14 IDS = 3,473,941 nodes A (h 1 ) = 539 nodes A (h 2 ) = 113 nodes d = 24 IDS 54,000,000,000 nodes A (h 1 ) = 39,135 nodes A (h 2 ) = 1,641 nodes Given any admissible heuristics h a, h b, h(n) = max(h a (n), h b (n)) Relaxed problems Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem If the rules of the 8-puzzle are relaxed so that a tile can move anywhere, then h 1 (n) gives the shortest solution If the rules are relaxed so that a tile can move to any adjacent square, then h 2 (n) gives the shortest solution Key point: the optimal solution cost of a relaxed problem is no greater than the optimal solution cost of the real problem is also admissible and dominates h a, h b Chapter 4, Sections 1 2 33 Chapter 4, Sections 1 2 34 Relaxed problems contd. Well-known example: travelling salesperson problem (TSP) Find the shortest tour visiting all cities exactly once Minimum spanning tree can be computed in O(n 2 ) and is a lower bound on the shortest (open) tour Summary Heuristic functions estimate costs of shortest paths Good heuristics can dramatically reduce search cost Greedy best-first search expands lowest h incomplete and not always optimal A search expands lowest g + h complete and optimal also optimally efficient (up to tie-breaks, for forward search) Admissible heuristics can be derived from exact solution of relaxed problems Chapter 4, Sections 1 2 35 Chapter 4, Sections 1 2 36