C 188: Atiiil Intllign ing 2006 Ltu 2: Quu-Bs 8/31/2006 Dn Klin UC Bkly Mny slis om it tut Russll o Anw Moo Announmnts L Fiy 1-5m in o 275 Ln Pyton tt on Pojt 1.1: Mzwol Com o wtv tims you lik No stions tis Mony Pojt 1.1 ost u 9/8 You n o most o it t toy 1
Agnts tt Pln A Polms Toy Uniom Mtos Dt-Fist Bt-Fist Uniom-Cost Huisti Mtos Gy A* Rlx gnts: Coos tion s on unt t n mmoy My v mmoy o mol o t wol s unt stt Do not onsi t utu onsuns o ti tions Cn n lx gnt tionl? Rlx Agnts 2
Gol-Bs Agnts Gol-s gnts: Pln Disions s on (yotsiz) onsuns o tions Must v mol o ow t wol volvs in sons to tions Polms A s olm onsists o: A stt s A susso untion N, 1.0 A stt stt n gol tst E, 1.0 A solution is sun o tions wi tnsom t stt stt to gol stt 3
Ts E, 1.0 N, 1.0 A s t: Tis is wt i t Cunt stt t t oot no Ciln oson to sussos Nos ll wit stts, oson to PATH to tos stts Fo most olms, n nv tully uil t wol t o, v to in wys o using only t imotnt ts o t t! tt Gs T s som ig g in wi E stt is no E susso is n outgoing Imotnt: Fo most olms w oul nv tully uil tis g G How mny stts in Pmn? Lugly tiny s g o tiny s olm 4
Exml: Romni Anot T : Exn out ossil lns Mintin ing o unxn lns Ty to xn s w t nos s ossil 5
tts vs. Nos Polm gs v olm stts Hv sussos ts v s nos Hv nts, iln, t, t ost, t. Exn uss susso untion to t nw s t nos T sm olm stt my in multil s t nos Gnl T Imotnt is: Fing Exnsion Exlotion sttgy Dtil suoo is in t ook! Min ustion: wi ing nos to xlo? 6
7 Exml: T G tt Gs vs Ts G G G W lmost lwys onstut ot on mn n w onstut s littl s ossil. E NODE in in t s t is n nti PATH in t olm g.
8 Rviw: Dt Fist G G G ttgy: xn st no ist Imlmnttion: Fing is LIFO stk Rviw: Bt Fist G G G Tis ttgy: xn sllowst no ist Imlmnttion: Fing is FIFO uu
Algoitm Potis Comlt? Gunt to in solution i on xists? Otiml? Gunt to in t lst ost t? Tim omlxity? omlxity? Vils: n C* s m Num o stts in t olm T vg ning to B (t vg num o sussos) Cost o lst ost solution Dt o t sllowst solution Mx t o t s t DF Algoitm DF Dt Fist Comlt Otiml Tim N N N N O(B Ininit LMAX ) O(LMAX) Ininit TART GOAL Ininit ts mk DF inomlt How n w ix tis? 9
DF Wit yl king, DF is omlt. 1 no nos 2 nos m tis m nos Algoitm DF w/ Pt Cking Comlt Otiml Tim Y N O( m+1 ) O(m) Wn is DF otiml? BF Algoitm DF BF w/ Pt Cking Comlt Otiml Tim Y N O( m+1 ) O(m) Y N* O( s+1 ) O( s ) s tis 1 no nos 2 nos s nos m nos Wn is BF otiml? 10
Comisons Wn will BF outom DF? Wn will DF outom BF? Costs on Ations TART 2 3 1 1 2 3 8 2 9 8 2 4 4 15 GOAL 2 1 Noti tt BF ins t sotst t in tms o num o tnsitions. It os not in t lst-ost t. W will uikly ov n lgoitm wi os in t lst-ost t. 11
Uniom Cost Exn st no ist: Fing is ioity uu Cost ontous 4 6 11 3 9 1 13 5 7 8 11 G 10 2 G 1 8 2 2 3 9 8 1 1 1 15 17 11 0 G 16 Pioity Quu Rs A ioity uu is t stutu in wi you n inst n tiv (ky, vlu) is wit t ollowing otions:.us(ky, vlu).o() insts (ky, vlu) into t uu. tuns t ky wit t lowst vlu, n movs it om t uu. You n omot o mot kys y stting ti ioitis Unlik gul uu, instions into ioity uu not onstnt tim, usully O(log n) W ll n ioity uus o most ost-snsitiv s mtos. 12
Uniom Cost Wt will UC o o tis g? TART 1 0 0 1 GOAL Wt os tis mn o omltnss? Uniom Cost Algoitm DF BF UC w/ Pt Cking Comlt Otiml Tim Y N O( m+1 ) O(m) Y N O( s+1 ) O( s ) Y* Y O(C* C*/ε ) O( C*/ε ) C*/ε tis W ll tlk mo out uniom ost s s ilu ss lt 13
Uniom Cost Polms Rmm: xlos insing ost ontous T goo: UC is omlt n otiml! 1 2 3 T : Exlos otions in vy ition No inomtion out gol lotion tt Gol Ext Wok? Filu to tt t stts n us xonntilly mo wok. Wy? 14
G In BF, o xml, w souln t ot xning t il nos (wy?) G G G Vy siml ix: nv xn no twi Cn tis wk otnss? Wy o wy not? 15
Gon Wong? Bst-Fist / Gy 16
Bst-Fist / Gy Exn t no tt sms losst Wt n go wong? Bst-Fist / Gy 2 =11 3 TART 1 =12 2 =8 2 1 8 =5 =4 2 =8 9 1 9 4 15 =11 =6 4 3 =9 GOAL =0 5 =4 5 =6 17
Bst-Fist / Gy A ommon s: Bst-ist tks you stigt to t (wong) gol Wost-s: lik lygui DF in t wost s Cn xlo vyting Cn gt stuk in loos i no yl king Lik DF in omltnss (init stts w/ yl king) 18