Heuristic Search Jim Little UBC CS 322 – Search 4 September 17, 2014 Textbook § 3.6 1.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Chapter 1 The Study of Body Function Image PowerPoint
and 6.855J Cycle Canceling Algorithm. 2 A minimum cost flow problem , $4 20, $1 20, $2 25, $2 25, $5 20, $6 30, $
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Reductions Complexity ©D.Moshkovitz.
Heuristic Search Russell and Norvig: Chapter 4 Slides adapted from:
Chapter 4: Informed Heuristic Search
Heuristic Search The search techniques we have seen so far...
Lights Out Issues Questions? Comment from me.
Informed Search CS 171/271 (Chapter 4)
Heuristic Functions By Peter Lane
Informed search algorithms
CPSC 322, Lecture 7Slide 1 Heuristic Search Computer Science cpsc322, Lecture 7 (Textbook Chpt 3.5) January, 19, 2009.
Review: Search problem formulation
Informed Search Algorithms
Heuristic Search Ref: Chapter 4.
1 Column Generation. 2 Outline trim loss problem different formulations column generation the trim loss problem master problem and subproblem in column.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
Announcements Course TA: Danny Kumar
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Lecture 4: Informed/Heuristic Search
Informed search strategies
Informed Search Problems
Informed search algorithms
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
An Introduction to Artificial Intelligence
25 seconds left…...
Januar MDMDFSSMDMDFSSS
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Week 1.
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
PSSA Preparation.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 14, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 11, 2013.
Solving Problem by Searching
Slide 1 Heuristic Search: BestFS and A * Jim Little UBC CS 322 – Search 5 September 19, 2014 Textbook § 3.6.
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.5) January, 21, 2009.
Uninformed Search (cont.)
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.6) Sept, 23, 2013.
Computer Science CPSC 322 Lecture Heuristic Search (Ch: 3.6, 3.6.1) Slide 1.
Computer Science CPSC 322 Lecture A* and Search Refinements (Ch 3.6.1, 3.7.1, 3.7.2) Slide 1.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Heuristic Search: A* 1 CPSC 322 – Search 4 January 19, 2011 Textbook §3.6 Taught by: Vasanth.
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.6) Sept, 21, 2010.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Heuristic Functions.
CPSC 322, Lecture 7Slide 1 Heuristic Search Computer Science cpsc322, Lecture 7 (Textbook Chpt 3.6) Sept, 20, 2013.
Computer Science CPSC 322 Lecture 5 Heuristic Search and A* (Ch: 3.6, 3.6.1) Slide 1.
Computer Science cpsc322, Lecture 7
Informed search algorithms
Informed search algorithms
Iterative Deepening CPSC 322 – Search 6 Textbook § 3.7.3
Informed Search.
Presentation transcript:

Heuristic Search Jim Little UBC CS 322 – Search 4 September 17, 2014 Textbook § 3.6 1

Slide 2 Course Announcements Marks for Assignment0: will be posted on Connect next week If you are confused on basic search algorithm, different search strategies….. Check learning goals at the end of lectures. Work on the Practice Exercises and Please do come to office hours Jim Little: Tues 11-12, my office CICSR 117 Glen Beserth: Thursday (Learning Center) Issam Laradji: Tuesday 1pm-230pm (Learning Center) Julieta Martinez: Thursday (Learning Center) Sharan Viswani: Monday 10-11(Learning Center) Assignment1: will also be posted on Fri?/Mon?

Slide 3 Lecture Overview Recap Search with Costs Summary Uninformed Search Heuristic Search

Slide 4 Recap: Search with Costs Sometimes there are costs associated with arcs. The cost of a path is the sum of the costs of its arcs. Optimal solution: not the one that minimizes the number of links, but the one that minimizes cost Lowest-Cost-First Search: expand paths from the frontier in order of their costs.

Slide 5 Recap Uninformed Search CompleteOptimalTimeSpace DFSN Y if no cycles, finite NO(b m )O(mb) BFSYYO(b m ) IDSYYO(b m )O(mb) LCFSY Costs > 0 Y Costs >=0 O(b m )

Slide 6 Recap Uninformed Search Why are all these strategies called uninformed? Because they do not consider any information about the states (end nodes) to decide which path to expand first on the frontier eg (  n0, n2, n3  12), (  n0, n3  8), (  n0, n1, n4  13) In other words, they are general they do not take into account the specific nature of the problem.

Slide 7 Lecture Overview Recap Search with Costs Summary Uninformed Search Heuristic Search

Slide 8 Beyond uninformed search….

Slide 9 Uninformed/Blind search algorithms do not take into account the goal until they are at a goal node. Often there is extra knowledge that can be used to guide the search: an estimate of the distance from node n to a goal node. This is called a heuristic Heuristic Search

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

Slide 11 More formally (cont.) Definition (admissible heuristic) A search heuristic h(n) is admissible if it is never an overestimate of the cost from n to a goal. There is never a path from n to a goal that has path cost less than h(n). another way of saying this: h(n) is a lower bound on the cost of getting from n to the nearest goal.

Slide 12 Example Admissible Heuristic Functions G Search problem: robot has to find a route from start location to goal location on a grid (discrete space with obstacles) Final cost (quality of the solution) is the number of steps

Example Admissible Heuristic Functions Slide 13 If no obstacles, cost of optimal solution is…

Slide 14 Example Admissible Heuristic Functions If there are obstacles, the optimal solution without obstacles is an admissible heuristic G

Slide 15 Example Admissible Heuristic Functions Example: is the straight-line distance admissible? Yes! The shortest distance between two points is a line.

Admissibility of a heuristic 16 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-line distances to Bucharest (green box) Possible h(n) = sld(n, Bucharest) + cost(Bucharest, Urzineni) Admissible?

Slide 17 Heuristic Function for 8-puzzle

Slide 18 Example Heuristic Functions (1) In the 8-puzzle, we can use the number of misplaced tiles

Slide 19 Example Heuristic Functions (2) Another one we can use the number of moves between each tile's current position and its position in the solution

Slide 20 How to Construct a Heuristic You identify relaxed version of the problem: where one or more constraints have been dropped problem with fewer restrictions on the actions Robot: the agent can move through walls Driver: the agent can move straight 8puzzle: (1) tiles can move anywhere (2) tiles can move to any adjacent square Result: The cost of an optimal solution to the relaxed problem is an admissible heuristic for the original problem (because it is always weakly less costly to solve a less constrained problem!)

Slide 21 How to Construct a Heuristic (cont.) You should identify constraints which, when dropped, make the problem extremely easy to solve this is important because heuristics are not useful if they're as hard to solve as the original problem! This was the case in our examples Robot: allowing the agent to move through walls. Optimal solution to this relaxed problem is Manhattan distance Driver: allowing the agent to move straight. Optimal solution to this relaxed problem is straight-line distance 8puzzle: (1) tiles can move anywhere Optimal solution to this relaxed problem is number of misplaced tiles (2) tiles can move to any adjacent square….

Slide 22 Another approach to construct heuristics Solution cost for a subproblem Current node Goal node Original Problem SubProblem

Heuristics: Dominance If h 2 (n) ≥ h 1 (n) for every state n (both admissible) then h 2 dominates h 1 Slide 23

Heuristics: Dominance Slide 24 8puzzle: (1) tiles can move anywhere (2) tiles can move to any adjacent square (Original problem: tiles can move to an adjacent square if it is empty) search costs for the 8-puzzle (average number of paths expanded): d=12IDS = 3,644,035 paths A * (h 1 ) = 227 paths A * (h 2 ) = 73 paths d=24 IDS = too many paths A * (h 1 ) = 39,135 paths A * (h 2 ) = 1,641 paths

Slide 25 Combining Heuristics How to combine heuristics when there is no dominance? If h 1 (n) is admissible and h 2 (n) is also admissible then h(n)= max(h 1 (n), h 2 (n)) is also admissible … and dominates all its components

Slide 26 Combining Heuristics: Example In 8-puzzle, solution cost for the 1,2,3,4 subproblem is substantially more accurate than Manhattan distance in some cases So…..

Combining Heuristics: Example Slide 27 In 8-puzzle, solution cost for the 1,2,3,4 subproblem is substantially more accurate than Manhattan distance in some cases So…..

Admissible heuristic for Vacuum world? Slide 28 states? Where it is dirty and robot location actions? Left, Right, Suck Possible goal test? no dirt at all locations

Slide 29 Learning Goals for today’s class Construct admissible heuristics for a given problem. Verify Heuristic Dominance. Combine admissible heuristics From previous classes Define/read/write/trace/debug different search algorithms With / Without cost Informed / Uninformed

Next Class Best-First Search Combining LCFS and BFS: A* (finish 3.6) A* Optimality Slide 30