C 188: Atiiil Intllign Fll 2009 Ltu 2: Quu-Bs 9/1/2009 Dn Klin UC Bkly Multil slis om tut Russll, Anw Moo Announmnts Pojt 0: Pyton Tutoil Du tomoow! T is l tomoow om 1m-3m in o 275 T l tim is otionl, ut P0 itsl is not On sumit, you soul gt mil om t utog Pojt 1: On t w toy tt ly n sk ustions. It s long tn most! Ot tion 107 ws on u, Fiys 1-2m My OHs Mony w in t l, Tusy k in 711 o GI OHs on w sit 1
Agnts tt Pln A Polms Toy Uninom Mtos (t viw o som) Dt-Fist Bt-Fist Uniom-Cost Huisti Mtos (nw o ll) Gy Rlx Agnts Rlx gnts: Coos tion s on unt t (n my mmoy) My v mmoy o mol o t wol s unt stt Do not onsi t utu onsuns o ti tions At on ow t wol I Cn lx gnt tionl? [mo: lx otiml / loo ] 2
Gol Bs Agnts Gol-s gnts: Pln Ask wt i Disions s on (yotsiz) onsuns o tions Must v mol o ow t wol volvs in sons to tions At on ow t wol WOULD BE [mo: ln st / slow ] 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 ( ln) wi tnsoms t stt stt to gol stt 3
Exml: Romni tt s: Citis usso untion: Go to j ity wit ost = ist tt stt: A Gol tst: Is stt == Bust? olution? tt Gs tt s g: A mtmtil snttion o s olm Fo vy s olm, t s osoning stt s g T susso untion is snt y s G W n ly uil tis g in mmoy (so w on t) Riiulously tiny s g o tiny s olm 4
tt izs? Polm: Et ll o t oo Pmn ositions: 10 x 12 = 120 Foo ount: 30 Gost ositions: 12 Pmn ing: u, own, lt, igt Ts N, 1.0 E, 1.0 A s t: Tis is wt i t o lns n outoms tt stt t t oot no Ciln oson to sussos Nos ontin stts, oson to PLAN to tos stts Fo most olms, w n nv tully uil t wol t 5
Anot T : Exn out ossil lns Mintin ing o unxn lns Ty to xn s w t nos s ossil 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 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.
tts vs. Nos Nos in stt s gs olm stts Rsnt n stt stt o t wol Hv sussos, n gol / non-gol, v multil ssos Nos in s ts lns Rsnt ln (sun o tions) wi sults in t no s stt Hv olm stt n on nt, t lngt, t & ost T sm olm stt my iv y multil s t nos Polm tts Nos Pnt Dt 5 No Ation Dt 6 Rviw: Dt Fist ttgy: xn st no ist Imlmnttion: Fing is LIFO stk G G G 8
Rviw: Bt Fist ttgy: xn sllowst no ist Imlmnttion: Fing is FIFO uu G Tis G G Algoitm Potis Comlt? Gunt to in solution i on xists? Otiml? Gunt to in t lst ost t? Tim omlxity? omlxity? Vils: n Num o stts in t olm T vg ning to B (t vg num o sussos) C* Cost o lst ost solution s Dt o t sllowst solution m Mx t o t s t 9
DF Algoitm Comlt Otiml Tim DF Dt Fist N N N N O(B Ininit LMAX ) O(LMAX) Ininit TART GOAL Ininit ts mk DF inomlt How n w ix tis? DF Wit yl king, DF is omlt.* m tis 1 no nos 2 nos m nos Algoitm Comlt Otiml Tim DF w/ Pt Cking Y N O( m+1 ) O(m) Wn is DF otiml? * O g s nxt ltu. 10
BF Algoitm Comlt Otiml Tim DF BF w/ Pt Cking 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? Comisons Wn will BF outom DF? Wn will DF outom BF? 11
Ittiv Dning Ittiv ning uss DF s suoutin: 1. Do DF wi only ss o ts o lngt 1 o lss. 2. I 1 il, o DF wi only ss ts o lngt 2 o lss. 3. I 2 il, o DF wi only ss ts o lngt 3 o lss..n so on. Algoitm Comlt Otiml Tim DF BF ID w/ Pt Cking Y N O( m+1 ) O(m) Y N* O( s+1 ) O( s ) Y N* O( s+1 ) O(s) 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. 12
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 1 17 11 3 0 G 2 1 15 8 9 2 8 1 16 G 2 1 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 s ky s ioity y using it gin Unlik gul uu, instions n t onstnt tim, usully O(log n) W ll n ioity uus o ost-snsitiv s mtos 13
Uniom Cost Algoitm Comlt Otiml Tim DF BF UC w/ Pt Cking Y N O( m+1 ) O(m) Y N O( s+1 ) O( s ) Y* Y O( C*/ε ) O( C*/ε ) C*/ε tis * UC n il i tions n gt itily Uniom Cost Issus 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 [mo: s mo mty] 14
Huistis Any stimt o ow los stt is to gol Dsign o tiul s olm Exmls: Mnttn istn, Eulin istn 10 5 11.2 Huistis 15
Bst Fist / Gy Exn t no tt sms losst Wt n go wong? [mo: gy] 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) 16
Gon Wong? 17