Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem

Similar documents
Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. General Tree Search. Uniform Cost. Lecture 3: A* Search 9/4/2007

CS 221: Artificial Intelligence Fall 2011

Search Gone Wrong? CS 188: Artificial Intelligence Fall Today. Announcements. General Tree Search. Recap: Search. Lecture 3: A* Search 9/3/2009

CS 188: Artificial Intelligence Fall Search Gone Wrong?

CSEP 573 Artificial Intelligence Winter 2016

CS 188: Artificial Intelligence

CS 343H: Artificial Intelligence

Today. Informed Search. Graph Search. Heuristics Greedy Search A* Search

Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search

CSCI 446: Artificial Intelligence

CSCI 446: Artificial Intelligence

CE 473: Artificial Intelligence. Autumn 2011

CS 343: Artificial Intelligence

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

AI Adjacent Fields. This slide deck courtesy of Dan Klein at UC Berkeley

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence

Uninformed Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 31 Jan 2012

Announcements. CS 188: Artificial Intelligence

Artificial Intelligence Informed Search

Informed Search A* Algorithm

521495A: Artificial Intelligence

COMP 423 lecture 11 Jan. 28, 2008

Ma/CS 6b Class 1: Graph Recap

CS 5522: Artificial Intelligence II

Heuristic Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

2 Computing all Intersections of a Set of Segments Line Segment Intersection

EXPONENTIAL & POWER GRAPHS

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

What are suffix trees?

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

10.5 Graphing Quadratic Functions

Ma/CS 6b Class 1: Graph Recap

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,

Fig.25: the Role of LEX

CS 188: Artificial Intelligence Fall 2008

Lexical Analysis: Constructing a Scanner from Regular Expressions

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

Dr. D.M. Akbar Hussain

Heuristic Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

Midterm 2 Sample solution

Information Retrieval and Organisation

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis

Languages. L((a (b)(c))*) = { ε,a,bc,aa,abc,bca,... } εw = wε = w. εabba = abbaε = abba. (a (b)(c)) *

Hyperbolas. Definition of Hyperbola

Intermediate Information Structures

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

CS481: Bioinformatics Algorithms

Section 10.4 Hyperbolas

MTH 146 Conics Supplement

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Presentation Martin Randers

The Greedy Method. The Greedy Method

COMBINATORIAL PATTERN MATCHING

Context-Free Grammars

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών. Lecture 3b Lexical Analysis Elias Athanasopoulos

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

Suffix trees, suffix arrays, BWT

Greedy Algorithm. Algorithm Fall Semester

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011

Context-Free Grammars

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

ITEC2620 Introduction to Data Structures

ZZ - Advanced Math Review 2017

Slides for Data Mining by I. H. Witten and E. Frank

Network Interconnection: Bridging CS 571 Fall Kenneth L. Calvert All rights reserved

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

Premaster Course Algorithms 1 Chapter 6: Shortest Paths. Christian Scheideler SS 2018

Applied Databases. Sebastian Maneth. Lecture 13 Online Pattern Matching on Strings. University of Edinburgh - February 29th, 2016

Implementing Automata. CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

Algorithm Design (5) Text Search

LR Parsing, Part 2. Constructing Parse Tables. Need to Automatically Construct LR Parse Tables: Action and GOTO Table

Suffix Tries. Slides adapted from the course by Ben Langmead

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe

Knowledge States: A Tool in Randomized Online Algorithms

Compression Outline :Algorithms in the Real World. Lempel-Ziv Algorithms. LZ77: Sliding Window Lempel-Ziv

1.5 Extrema and the Mean Value Theorem

CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Regular Expression Matching with Multi-Strings and Intervals. Philip Bille Mikkel Thorup

Definition of Regular Expression

Lexical Analysis. Amitabha Sanyal. ( as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Orthogonal line segment intersection

Informed search. Lirong Xia

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

9 Graph Cutting Procedures

Lecture T1: Pattern Matching

Notes for Graph Theory

2-3 search trees red-black BSTs B-trees

LECT-10, S-1 FP2P08, Javed I.

Finite Automata. Lecture 4 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 21, 2015

Chapter44. Polygons and solids. Contents: A Polygons B Triangles C Quadrilaterals D Solids E Constructing solids

such that the S i cover S, or equivalently S

The Fundamental Theorem of Calculus

Distributed Systems Principles and Paradigms

Transcription:

Announcements Project : erch It s live! Due 9/. trt erly nd sk questions. It s longer thn most! Need prtner? Come up fter clss or try Pizz ections: cn go to ny, ut hve priority in your own C 88: Artificil Intelligence Fll 0 Lecture : A* erch 9//0 Dn Klein UC Berkeley Multiple slides from turt Russell or Andrew Moore Tody Recp: erch A* erch rph erch Heuristic Design UC A* reedy erch prolem: ttes (configurtions of the world) uccessor function: function from sttes to lists of (stte, ction, cost) triples; drwn s grph trt stte nd gol test erch tree: Nodes: represent plns for reching sttes Plns hve costs (sum of ction costs) erch Algorithm: ystemticlly uilds serch tree Chooses n ordering of the fringe (unexplored nodes) Optiml: finds lest-cost plns Exmple: Pncke Prolem Exmple: Pncke Prolem tte spce grph with costs s weights Cost: Numer of pnckes flipped

enerl Tree erch Uniform Cost erch trtegy: expnd lowest pth cost The good: UC is complete nd optiml! c c c Action: flip top two Cost: Action: Pth flip to ll rech fourgol: Flip Cost: four, flip three Totl cost: 7 The d: Explores options in every direction No informtion out gol loction trt ol [demo: countours UC] Exmple: Heuristic Function Exmple: Heuristic Function Heuristic: the lrgest pncke tht is still out of plce h(x) 0 h(x) Best First (reedy) trtegy: expnd node tht you think is closest to gol stte Heuristic: estimte of distnce to nerest gol for ech stte A common cse: Best-first tkes you stright to the (wrong) gol Worst-cse: like dlyguided DF Comining UC nd reedy Uniform-cost orders y pth cost, or ckwrd cost g(n) reedy orders y gol proximity, or forwrd cost h(n) d h=6 h=5 h= c h=7 h=6 A* erch orders y the sum: f(n) = g(n) + h(n) 5 e h= h=0 [demo: countours greedy] Exmple: Teg renger

When should A* terminte? hould we stop when we enqueue gol? A h = h = B h = No: only stop when we dequeue gol h = 0 h = 7 Is A* Optiml? A h = 6 5 h = 0 Wht went wrong? Actul d gol cost < estimted good gol cost We need estimtes to e less thn ctul costs! Admissile Heuristics Optimlity of A*: Blocking A heuristic h is dmissile (optimistic) if: Nottion: g(n) = cost to node n where is the true cost to nerest gol h(n) = estimted cost from n to the nerest gol (heuristic) Exmples: 5 Coming up with dmissile heuristics is most of wht s involved in using A* in prctice. f(n) = g(n) + h(n) = estimted totl cost vi n *: lowest cost gol node : nother gol node Optimlity of A*: Blocking Properties of A* Proof: Wht could go wrong? We d hve to hve to pop suoptiml gol off the fringe efore * This cn t hppen: Imgine suoptiml gol is on the queue ome node n which is supth of * must lso e on the fringe (why?) n will e popped efore Uniform-Cost A*

UC vs A* Contours Uniform-cost expnded in ll directions trt ol Creting Admissile Heuristics Most of the work in solving hrd serch prolems optimlly is in coming up with dmissile heuristics Often, dmissile heuristics re solutions to relxed prolems, where new ctions re ville A* expnds minly towrd the gol, ut does hedge its ets to ensure optimlity trt ol 66 Indmissile heuristics re often useful too (why?) 5 [demo: countours UC / A*] Exmple: 8 Puzzle 8 Puzzle I Heuristic: Numer of tiles misplced Why is it dmissile? Wht re the sttes? How mny sttes? Wht re the ctions? Wht sttes cn I rech from the strt stte? Wht should the costs e? h(strt) = 8 This is relxedprolem heuristic Averge nodes expnded when optiml pth hs length steps 8 steps steps UC 6,00.6 x 0 6 TILE 9 7 8 Puzzle II 8 Puzzle III Wht if we hd n esier 8-puzzle where ny tile could slide ny direction t ny time, ignoring other tiles? Totl Mnhttn distnce Why dmissile? h(strt) = + + + = 8 Averge nodes expnded when optiml pth hs length steps 8 steps steps TILE 9 7 MANHATTAN 5 7 How out using the ctul cost s heuristic? Would it e dmissile? Would we sve on nodes expnded? Wht s wrong with it? With A*: trde-off etween qulity of estimte nd work per node!

Trivil Heuristics, Dominnce Dominnce: h h c if Heuristics form semi-lttice: Mx of dmissile heuristics is dmissile Trivil heuristics Bottom of lttice is the zero heuristic (wht does this give us?) Top of lttice is the exct heuristic Other A* Applictions Pthing / routing prolems Resource plnning prolems Root motion plnning Lnguge nlysis Mchine trnsltion peech recognition [demo: pln tiny UC / A*] Tree erch: Extr Work! Filure to detect repeted sttes cn cuse exponentilly more work. Why? rph erch In BF, for exmple, we shouldn t other expnding the circled nodes (why?) d e p c e h r q h r p q f p q f q c q c rph erch A* rph erch one Wrong? Ide: never expnd stte twice tte spce grph erch tree How to implement: Tree serch + set of expnded sttes ( closed set ) Expnd the serch tree node-y-node, ut Before expnding node, check to mke sure its stte is new If not new, skip it Importnt: store the closed set s set, not list Cn grph serch wreck completeness? Why/why not? How out optimlity? h= A h= B h= h= C (0+) A (+) B (+) C (+) C (+) (5+0) (6+0) Wrning: e ook hs more complex, ut lso correct, vrint h=0 5

Consistency of Heuristics Optimlity of A* rph erch A h= C h= tronger thn dmissiility Definition: cost(a to C) + h(c) h(a) cost(a to C) h(a) - h(c) rel cost cost implied y heuristic Consequences: The f vlue long pth never decreses Proof: New possile prolem: some n on pth to * isn t in queue when we need it, ecuse some worse n for the sme stte dequeued nd expnded first (disster!) Tke the highest such n in tree Let p e the ncestor of n tht ws on the queue when n ws popped f(p) < f(n) ecuse of consistency f(n) < f(n ) ecuse n is suoptiml p would hve een expnded efore n Contrdiction! A* grph serch is optiml Optimlity Tree serch: A* is optiml if heuristic is dmissile (nd non-negtive) UC is specil cse (h = 0) rph serch: A* optiml if heuristic is consistent UC optiml (h = 0 is consistent) Consistency implies dmissiility In generl, most nturl dmissile heuristics tend to e consistent, especilly if from relxed prolems ummry: A* A* uses oth ckwrd costs nd (estimtes of) forwrd costs A* is optiml with dmissile / consistent heuristics Heuristic design is key: often use relxed prolems Mzeworld Demos 6