DOC PREVIEW
Berkeley COMPSCI 188 - Lecture 4

This preview shows page 1-2-3-4-24-25-26-50-51-52-53 out of 53 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 53 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 188: Artificial IntelligenceSpring 2007Lecture 4: A* SearchSriniNarayanan –ICSI and UC BerkeleyMany slides over the course adapted from Dan Klein, Stuart Russell and Andrew Moore PDF created with pdfFactory Pro trial version www.pdffactory.comAnnouncements§ Submission of Assignment 1§ Submit program should be updated by today§ Use submit hw1 for this assignment§ Enrollment issuesPDF created with pdfFactory Pro trial version www.pdffactory.comToday§ A* Search§ Heuristic Design§ Local SearchPDF created with pdfFactory Pro trial version www.pdffactory.comRecap: Search§ Search problems:§ States, successors, costs, start and goal tests§ Search trees:§ Nodes: represent paths, have costs§ Strategies differing fringe management§ Tree vs. graph searchPDF created with pdfFactory Pro trial version www.pdffactory.comUniform Cost: Problems§ Remember: explores increasing cost contours§ The good: UCS is complete and optimal!§ The bad:§ Explores options in every “direction”§ No information about goal locationStartGoal…c ≤ 3c ≤ 2c ≤ 1PDF created with pdfFactory Pro trial version www.pdffactory.comBest-First / Greedy SearchPDF created with pdfFactory Pro trial version www.pdffactory.comBest-First / Greedy Search§ Expand the node that seems closest…§ What can go wrong?PDF created with pdfFactory Pro trial version www.pdffactory.comBest-First / Greedy SearchSTARTGOALdbpqcehafr299811235344151252h=12h=11h=8h=8h=5h=4h=6h=9h=0h=4h=6h=11PDF created with pdfFactory Pro trial version www.pdffactory.comBest-First / Greedy Search§ A common case:§ Best-first takes you straight to the goal on a wrong path§ Worst-case: like a badly-guided DFS in the worst case§ Can explore everything§ Can get stuck in loops if no cycle checking§ Like DFS in completeness (finite states w/ cycle checking)…b…bPDF created with pdfFactory Pro trial version www.pdffactory.comBest First Greedy SearchSpaceTimeOptimalCompleteAlgorithmGreedy Best-First Search§ What do we need to do to make it complete?§ Can we make it optimal? Y* NO(bm) O(bm)…bmPDF created with pdfFactory Pro trial version www.pdffactory.comCombining UCS and Greedy§ Uniform-cost orders by path cost, or backward cost g(n)§ Best-first orders by goal proximity, or forward cost h(n)§ A* Search orders by the sum: f(n) = g(n) + h(n)S a dbGh=5h=5h=215112h=6 h=0ch=423eh=11Example: TegGrenagerPDF created with pdfFactory Pro trial version www.pdffactory.comWhen should A* terminate?SBAG2212h = 1h = 2h = 0h = 3§ Should we stop when we enqueuea goal?§ No: only stop when we dequeuea goalPDF created with pdfFactory Pro trial version www.pdffactory.comIs A* Optimal?AGS13h = 6h = 05h = 7§ What went wrong?§ Estimated goal cost > actual good goal cost§ We need estimates to be less than actual costs!PDF created with pdfFactory Pro trial version www.pdffactory.comAdmissible Heuristics§ A heuristic is admissible (optimistic) if:where is the true cost to a nearest goal§ E.g. Euclidean distance on a map problem§ Coming up with admissible heuristics is most of what’s involved in using A* in practice.PDF created with pdfFactory Pro trial version www.pdffactory.comOptimality of A*: Blocking§ Proof:§ What could go wrong?§ We’d have to have to pop a suboptimal goal off the fringe queue§ This can’t happen:§ Imagine a suboptimal goal G’is on the queue§ Consider any unexpanded (fringe) node n on a shortest path to optimal G§ n will be popped before G…This proof assumed tree search! Where?PDF created with pdfFactory Pro trial version www.pdffactory.comWhat to do with revisited states?c = 1100212h = 1000901The heuristic h is clearly admissiblePDF created with pdfFactory Pro trial version www.pdffactory.comWhat to do with revisited states?c = 1100212h = 10009011044+90f = 1+1002+1?If we discard this new node, then the searchalgorithm expands the goal node next andreturns a non-optimal solutionPDF created with pdfFactory Pro trial version www.pdffactory.com110021210009011044+901+1002+12+90102Instead, if we do not discard nodes revisiting states, the search terminates with an optimal solutionWhat to do with revisited states?PDF created with pdfFactory Pro trial version www.pdffactory.comOptimality of A*: Contours§ Consider what A* does:§ Expands nodes in increasing total f value (f-contours)§ Proof idea: optimal goals have lower f value, so get expanded firstHolds for graph search as well, but we made a different assumption. What?PDF created with pdfFactory Pro trial version www.pdffactory.comConsistency§ Wait, how do we know we expand in increasing f value?§ Couldn’t we pop some node n, and find its child n’ to have lower f value?§ YES:§ What do we need to do to fix this?§ Consistency:§ Real cost always exceeds reduction in heuristicABG3h = 0h = 10g = 10h = 8PDF created with pdfFactory Pro trial version www.pdffactory.com§ A consistent heuristic is also admissible[Left as an exercise]§ An admissible heuristic may not be consistent, but many admissible heuristics are consistentAdmissibility and ConsistencyPDF created with pdfFactory Pro trial version www.pdffactory.comUCS vsA* Contours§ Uniform-cost expanded in all directions§ A* expands mainly toward the goal, but does hedge its bets to ensure optimalityStartGoalStartGoalPDF created with pdfFactory Pro trial version www.pdffactory.comProperties of A*…b…bUniform-Cost A*PDF created with pdfFactory Pro trial version www.pdffactory.comAdmissible Heuristics§ Most of the work is in coming up with admissible heuristics§ Good news: usually admissible heuristics are also consistent§ More good news: inadmissible heuristics are often quite effective (especially when you have no choice)§ Very common hack: use α x h(n) for admissible h, α > 1 to generate a faster but less optimal inadmissible h’PDF created with pdfFactory Pro trial version www.pdffactory.comExample: 8-Puzzle§ What are the states?§ What are the actions?§ What states can I reach from the start state?§ What should the costs be?PDF created with pdfFactory Pro trial version www.pdffactory.com8-Puzzle I§ Number of tiles misplaced?§ Why is it admissible?§ h(start) =§ This is a relaxed-problem heuristic8TILESIDAverage nodes expanded when optimal path has length…22739133.6 x 1066,300112…12 steps…8 steps…4 stepsPDF created with pdfFactory Pro trial version www.pdffactory.com8-Puzzle II§ What if we had an easier 8-puzzle where any tile could slide any one direction at any


View Full Document

Berkeley COMPSCI 188 - Lecture 4

Documents in this Course
CSP

CSP

42 pages

Metrics

Metrics

4 pages

HMMs II

HMMs II

19 pages

NLP

NLP

23 pages

Midterm

Midterm

9 pages

Agents

Agents

8 pages

CSPs

CSPs

16 pages

Midterm

Midterm

6 pages

MDPs

MDPs

20 pages

mdps

mdps

2 pages

Games II

Games II

18 pages

Load more
Download Lecture 4
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 4 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?