Search: Advanced Topics and Conclusion

Similar documents
Search: Advanced Topics and Conclusion

A and Branch-and-Bound Search

Heuristic Search and Advanced Methods

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

Künstliche Intelligenz

Uniformed Search (cont.)

Lecture 3 - States and Searching

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

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

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

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

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

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

Uninformed Search Strategies

A* optimality proof, cycle checking

Chapter 3: Search. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 3, Page 1

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

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

Search. CS 3793/5233 Artificial Intelligence Search 1

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

Uninformed Search Methods

Search with Costs and Heuristic Search

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

Search Algorithms. Uninformed Blind search. Informed Heuristic search. Important concepts:

mywbut.com Informed Search Strategies-I

CIS 192: Artificial Intelligence. Search and Constraint Satisfaction Alex Frias Nov. 30 th

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

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

Downloaded from ioenotes.edu.np

Problem Solving & Heuristic Search

CAP 4630 Artificial Intelligence

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

CMU-Q Lecture 2: Search problems Uninformed search. Teacher: Gianni A. Di Caro

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

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.2, 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

Search EECS 395/495 Intro to Artificial Intelligence

Search EECS 348 Intro to Artificial Intelligence

DFS. Depth-limited Search

Uninformed search strategies (Section 3.4) Source: Fotolia

search, DFS & BrFS; cycle checking & MPC arc costs; heuristics; LCFS, BeFS, A* misc: iterative deepening, etc.

Route planning / Search Movement Group behavior Decision making

Informed search strategies (Section ) Source: Fotolia

Artificial Intelligence (part 4c) Strategies for State Space Search. (Informed..Heuristic search)

Lecture 3. Uninformed Search

3 SOLVING PROBLEMS BY SEARCHING

Uninformed (also called blind) search algorithms

Artificial Intelligence

CS 331: Artificial Intelligence Informed Search. Informed Search

Informed Search CS457 David Kauchak Fall 2011

Chapter 4. Uninformed Search Strategies

CSPs: Search and Arc Consistency

CSC 2114: Artificial Intelligence Search

ARTIFICIAL INTELLIGENCE. Pathfinding and search

CPS 170: Artificial Intelligence Search

Artificial Intelligence

Topic 1 Uninformed Search

Announcements. Project 0: Python Tutorial Due last night

Blind (Uninformed) Search (Where we systematically explore alternatives)

CS 4100 // artificial intelligence

CS 331: Artificial Intelligence Informed Search. Informed Search

Problem Solving as Search. CMPSCI 383 September 15, 2011

Informed/Heuristic Search

UNINFORMED SEARCH. What to do if teammates drop? Still have 3 or more? No problem keep going. Have two or fewer and want to be merged?

INTRODUCTION TO HEURISTIC SEARCH

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

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

Lecture 5 Heuristics. Last Time: A* Search

Uninformed Search Strategies AIMA

Artificial Intelligence

CS 188: Artificial Intelligence. Recap Search I

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday

Search I. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig

Week 4 Lecture Notes Part 1 Blind Search cont. and Informed Search

An Appropriate Search Algorithm for Finding Grid Resources

Lecture 3 of 42. Lecture 3 of 42

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

Uninformed Search. Chapter 3

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

Uninformed Search Strategies AIMA 3.4

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

The wolf sheep cabbage problem. Search. Terminology. Solution. Finite state acceptor / state space

Set 2: State-spaces and Uninformed Search. ICS 271 Fall 2015 Kalev Kask

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,

Introduction to Intelligent Systems

ARTIFICIAL INTELLIGENCE. Informed search

Solving Problems by Searching (Blindly)

Computer Science and Software Engineering University of Wisconsin - Platteville. 3. Search (Part 1) CS 3030 Lecture Notes Yan Shi UW-Platteville

COMP3702/7702 Artificial Intelligence Week2: Search (Russell & Norvig ch. 3)" Hanna Kurniawati"

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

Chapter 3: Solving Problems by Searching

Uninformed Search. CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop. Reading: R&N

Why Search. Things to consider. Example, a holiday in Jamaica. CSE 3401: Intro to Artificial Intelligence Uninformed Search

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

Problem Solving and Search

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

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

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

Search : Lecture 2. September 9, 2003

Transcription:

Search: Advanced Topics and Conclusion CPSC 322 Lecture 8 January 24, 2007 Textbook 2.6 Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 1

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 2

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 3

A Search Algorithm A is a mix of lowest-cost-first and Best-First search. It treats the frontier as a priority queue ordered by f(p). It always selects the node on the frontier with the lowest estimated total distance. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 4

Analysis of A Let s assume that arc costs are strictly positive. Completeness: yes. Time complexity: O(b m ) the heuristic could be completely uninformative and the edge costs could all be the same, meaning that A does the same thing as BFS Space complexity: O(b m ) like BFS, A maintains a frontier which grows with the size of the tree Optimality: yes. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 5

Optimal Efficiency of A In fact, we can prove something even stronger about A : in a sense (given the particular heuristic that is available) no search algorithm could do better! Optimal Efficiency: Among all optimal algorithms that start from the same start node and use the same heuristic h, A expands the minimal number of nodes. problem: A could be unlucky about how it breaks ties. So let s define optimal efficiency as expanding the minimal number of nodes n for which f(n) f, where f is the cost of the shortest path. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 6

Why is A optimally efficient? Theorem A is optimally efficient. Let f be the cost of the shortest path to a goal. Consider any algorithm A which has the same start node as A, uses the same heuristic and fails to expand some node n expanded by A for which cost(n ) + h(n ) < f. Assume that A is optimal. Consider a different search problem which is identical to the original and on which h returns the same estimate for each node, except that n has a child node n which is a goal node, and the true cost of the path to n is f(n ). that is, the edge from n to n has a cost of h(n ): the heuristic is exactly right about the cost of getting from n to a goal. A would behave identically on this new problem. The only difference between the new problem and the original problem is beyond node n, which A does not expand. Cost of the path to n is lower than cost of the path found by A. This violates our assumption that A is optimal. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 7

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 8

Branch-and-Bound Search A search strategy often not covered in AI, but widely used in practice Uses a heuristic function: like A, can avoid expanding some unnecessary nodes Depth-first: modest memory demands in fact, some people see branch and bound as a broad family that includes A these people would use the term depth-first branch and bound Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 9

Branch-and-Bound Search Algorithm Follow exactly the same search path as depth-first search treat the frontier as a stack: expand the most-recently added node first the order in which neighbors are expanded can be governed by some arbitrary node-ordering heuristic Keep track of a lower bound and upper bound on solution cost at each node lower bound: LB(n) = cost(n) + h(n) upper bound: UB = cost(n ), where n is the best solution found so far. if no solution has been found yet, set the upper bound to. When a node n is selected for expansion: if LB(n) UB, remove n from frontier without expanding it this is called pruning the search tree (really!) else expand n, adding all of its neighbours to the frontier Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 10

Branch-and-Bound Analysis Completeness: no, for the same reasons that DFS isn t complete however, for many problems of interest there are no infinite paths and no cycles hence, for many problems B&B is complete Time complexity: O(b m ) Space complexity: O(bm) Branch & Bound has the same space complexity as DFS this is a big improvement over A! Optimality: yes. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 11

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 12

Other A Enhancements The main problem with A is that it uses exponential space. Branch and bound was one way around this problem. Are there others? Iterative deepening Memory-bounded A Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 13

Iterative Deepening B & B can still get stuck in cycles Search depth-first, but to a fixed depth if you don t find a solution, increase the depth tolerance and try again of course, depth is measured in f value Counter-intuitively, the asymptotic complexity is not changed, even though we visit nodes multiple times Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 14

Memory-bounded A Iterative deepening and B & B use a tiny amount of memory what if we ve got more memory to use? keep as much of the fringe in memory as we can if we have to delete something: delete the oldest paths back them up to a common ancestor Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 15

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 16

Non-heuristic pruning What can we prune besides nodes that are ruled out by our heuristic? Cycles Multiple paths to the same node Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 17

Cycle Checking s You can prune a path that ends in a node already on the path. This pruning cannot remove an optimal solution. Using depth-first methods, with the graph explicitly stored, this can be done in constant time. For other methods, the cost is linear in path length. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 18

Multiple-Path Pruning s You can prune a path to node n that you have already found a path to. Multiple-path pruning subsumes a cycle check. This entails storing all nodes you have found paths to. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 19

Multiple-Path Pruning & Optimal Solutions Problem: what if a subsequent path to n is shorter than the first path to n? You can remove all paths from the frontier that use the longer path. You can change the initial segment of the paths on the frontier to use the shorter path. You can ensure this doesn t happen. You make sure that the shortest path to a node is found first. Heuristic function h satisfies the monotone restriction if h(m) h(n) d(m, n) for every arc m, n. If h satisfies the monotone restriction, A with multiple path pruning always finds the shortest path to every node otherwise, we have this guarantee only for goals Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 20

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 21

Direction of Search The definition of searching is symmetric: find path from start nodes to goal node or from goal node to start nodes. Of course, this presumes an explicit goal node, not a goal test. Also, when the graph is dynamically constructed, it can sometimes be impossible to construct the backwards graph Forward branching factor: number of arcs out of a node. Backward branching factor: number of arcs into a node. Search complexity is b n. Should use forward search if forward branching factor is less than backward branching factor, and vice versa. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 22

Bidirectional Search You can search backward from the goal and forward from the start simultaneously. This wins as 2b k/2 b k. This can result in an exponential saving in time and space. The main problem is making sure the frontiers meet. This is often used with one breadth-first method that builds a set of locations that can lead to the goal. In the other direction another method can be used to find a path to these interesting locations. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 23

Lecture Overview 1 Recap 2 Branch & Bound 3 A Tricks 4 Other Pruning 5 Backwards Search 6 Dynamic Programming Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 24

Dynamic Programming Idea: for statically stored graphs, build a table of dist(n) the actual distance of the shortest path from node n to a goal. This can be built backwards from the goal: { 0 if is goal(n), dist(n) = min n,m A ( n, m + dist(m)) otherwise. This can be used locally to determine what to do. There are two main problems: You need enough space to store the graph. The dist function needs to be recomputed for each goal. Complexity: polynomial in the size of the graph. Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 25