9/9/ CSE 7: Artiiil Intelligene Autumn 0 Pizz? Announements Serh: Cost & Heuristis Dn Wel Projet : Serh online tomorrow ue Mony 0/ ue We / Strt! With slies rom Dn Klein, Sturt Russell, Anrew Moore, Luke Zettlemoyer Serh thru Prolem Se / Stte Se Inut: Set o sttes Oertors [n osts] Strt stte Gol stte [test] Outut: Pth: strt stte stisying gol test [My reuire shortest th] [Sometimes just nee stte ssing test] Grution? Getting BS in CSE s serh rolem? (on t think too hr) Se o Sttes Oertors Initil Stte Gol Stte Serh Methos Blin serh Deth irst serh (DFS) Breth irst serh (BFS) Itertive eeening eth-irst serh (IDS) 6 Serh Methos Deth irst serh (DFS) Breth irst serh (BFS) Itertive eeening eth-irst serh (IDS) Best irst serh Uniorm ost serh (UCS) Greey serh A* Itertive Deeening A* (IDA*) Bem serh 7 Hill liming Heuristi serh
9/9/ Deth First Serh Mintin stk o noes to visit Chek th to root to rune ulites Evlution Not or ininite ses O( m ) Se Comlexity? O(m) e g h m Breth First Serh Mintin ueue o noes to visit Evlution Yes O( ) Se Comlexity? O( ) e g h Memory Limittion? Suose: GHz CPU 6 GB min memory 00 instrutions / exnsion 0 ytes / noe 00,000 exnsions / se Memory ille in 00 se < 7 min Itertive Deeening Serh DFS with limit; inrementlly grow limit Evlution Se Comlexity? Dniel S. Wel 0 Itertive Deeening Serh DFS with limit; inrementlly grow limit Evlution Se Comlexity? Itertive Deeening Serh DFS with limit; inrementlly grow limit Evlution Se Comlexity? e i g h l k j
9/9/ Itertive Deeening Serh DFS with limit; inrementlly grow limit Evlution Yes O( ) Se Comlexity? O( ) e Cost o Itertive Deeening rtio ID to DFS 5.5 0. 5.08 00.0 5 See 8 Puzzle xx Ruik s 0 6. se 5 Puzzle xx Ruik s 0 9 68k yrs Puzzle Why the ierene? Assuming 0M noes/se & suiient memory BFS Noes Time 0 5.0 se 0 6 ys 0 5 B yrs Ruik hs higher rnh tor 5 uzzle hs greter eth Mx 8x # o ulites Iter. Dee. Noes Time 0 5.0 se 0 6. se 0 7 0k yrs 0 0 57k yrs 0 7 0 yrs Slie te rom Rihr Kor resenttion START Costs on Ations 8 e 9 8 h 5 r Ojetive: Pth with smllest overll ost GOAL START Costs on Ations 8 e 9 8 h 5 GOAL r Best-First Serh Generliztion o reth-irst serh Fringe = Priority ueue o noes to e exlore Cost untion (n) lie to eh noe Wht will BFS return? ins the shortest th in terms o numer o trnsitions. It oes not in the lest-ost th. 9
9/9/.ush(key, vlue).o() Priority Queue Reresher A riority ueue is t struture in whih you n insert n retrieve (key, vlue) irs with the ollowing oertions: inserts (key, vlue) into the ueue. returns the key with the lowest vlue, n removes it rom the ueue. You n erese key s riority y ushing it gin Unlike regulr ueue, insertions ren t onstnt time, usully O(log n) We ll nee riority ueues or ost-sensitive serh methos Best-First Serh Generliztion o reth-irst serh Fringe = Priority ueue o noes to e exlore Cost untion (n) lie to eh noe A initil stte to riority ueue While ueue not emty Noe = he(ueue) I gol?(noe) then return noe A hilren o noe to ueue exning the noe Breth First = Best First with (n) = eth(n) Ol Friens Dijkstr s Algorithm (Uniorm ost) = Best First with (n) = the sum o ege osts rom strt to n Uniorm Cost Serh Best irst, where (n) = ost rom strt to n START 5 8 9 8 h e GOAL r k Dijkstr s Algorithm Exnsion orer: Uniorm Cost Serh S,,,, e,, r,, e, G S Cost ontours (not ll shown) 6 S 0 e 9 e 5 h r 7 8 G 0 G 8 e 9 h 8 r 5 h 7 r G 6 Uniorm Cost Serh Algorithm Comlete Otiml Time Se DFS BFS UCS w/ Pth Cheking C* = Otiml ost C*/ε tiers ε = Minimum ost o n tion Y i inite N O( m ) O(m) Y Y* O( ) O( ) Y* Y O( C*/ε ) O( C*/ε )
9/9/ Uniorm Cost Issues Uniorm Cost: P-Mn Rememer: exlores inresing ost ontours The goo: UCS is omlete n otiml! Cost o or eh tion Exlores ll o the sttes, ut one The : Exlores otions in every iretion No inormtion out gol lotion Strt Gol Wht is Heuristi? An estimte o how lose stte is to gol Designe or rtiulr serh rolem Wht is Heuristi? An estimte o how lose stte is to gol Designe or rtiulr serh rolem 0 5. 0 Exmles: Mnhttn istne: 0+5 = 5 Eulien istne:. 5 Atul istne to gol: ++++8= Greey Serh Best irst with (n) = heuristi estimte o istne to gol Greey Serh Exn the noe tht seems losest A strt B gol Wht n go wrong? 5
9/9/ A ommon se: Best-irst tkes you stright to (suotiml) gol Worst-se: like lyguie DFS in the worst se Cn exlore everything Cn get stuk in loos i no yle heking Like DFS in omleteness (i inite # sttes w/ yle heking) Greey Serh A* Serh Hrt, Nilsson & Rel 968 Best irst serh with (n) = g(n) + h(n) g(n) = sum o osts rom strt to n h(n) = estimte o lowest ost th n gol h(gol) = 0 I h(n) is missile n monotoni then A* is otiml Unerestimtes ost o rehing gol rom } noe { vlues inrese rom noe to esennts (tringle ineulity) A* Serh Hrt, Nilsson & Rel 968 Best irst serh with (n) = g(n) + h(n) g(n) = sum o osts rom strt to n h(n) = estimte o lowest ost th n gol h(gol) = 0 Cn view s ross-ree: g(n) ~ uniorm ost serh h(n) ~ greey serh Best o oth worls Is Mnhttn istne missile? Unerestimte? S G 6 Is Mnhttn istne monotoni? vlues inrese rom noe to hilren (tringle ineulity) Amissile? Monotoni? Eulien Distne S S G G 7 8 6
9/9/ A* Exmle A* Exmle 9 0 A* Exmle A* Exmle A* Exmle A* Exmle 7
9/9/ strt Euroen Exmle Otimlity o A* 5 en 5 6 Otimlity Continue A* Summry Pros Proues otiml ost solution! Does so uite uikly (ouse) Cons Mintins riority ueue Whih n get exonentilly ig L 7 8 8