1 C 232: A)iil Intllign Toy tm 3, 2015 Agnts tt Pln A Polms Uninom Mtos Dt- Fist Bt- Fist Uniom- Cost [Ts slis w t y Dn Klin n Pit Al o C188 Into to AI t UC Bkly. All C188 mtils vill t M://i.kly.u.] Agnts tt Pln Rlx Agnts Rlx gnts: Coos )on 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 )ons Consi ow t wol I Cn lx gnt )onl? [Dmo: lx o)ml (L2D1)] [Dmo: lx o)ml (L2D2)]
2 Vio o Dmo Rlx O)ml Vio o Dmo Rlx O Plnning gnts: Ask wt i Disions s on (yotsiz) onsuns o )ons Must v mol o ow t wol volvs in sons to )ons Must omult gol (tst) Consi ow t wol WOULD BE i tin )on is om O)ml vs. omlt lnning O)ml: in t st solu)on Comlt lnning: ins solu)on Plnning Agnts Polms Plnning vs. lnning nts on singl ln vs. lns t vy st o t wy [Dmo: lnning (L2D3)] [Dmo: mstmin (L2D4)]
3 Polms Polms A Mols A s olm onsists o: A stt s A mol o t wol t givn oint in tim. A susso un)on (wit )ons, osts) A stt stt n gol tst N, 1.0 E, 1.0 How t wol volvs in sons to gnt s tions. A solu)on is sun o )ons ( ln) wi tnsoms t stt stt to gol stt Imotnt: Fin t igt lvl o sttion, so tt you mol is goo mol o t wol. Exml: Tvling in Romni Wt s in tt? tt s: Ci)s usso un)on: Ros: o to jnt ity wit ost = istn tt stt: A ol tst: Is stt == Bust? olu)on? T wol stt inlus vy lst til o t nvionmnt A s stt ks only t tils n o lnning (st)on) Polm: Pting tts: (x,y) lo)on A)ons: NEW usso: ut lo)on only ol tst: is (x,y)=end Polm: Et- All- Dots tts: {(x,y), ot oolns} A)ons: NEW usso: ut lo)on n ossily ot ooln ol tst: ots ll ls
4 tt izs? Quiz: Pssg Wol stt: Agnt osi)ons: 120 Foo ount: 30 ost osi)ons: 12 Agnt ing: NEW How mny Wol stts? 120x(2 30 )x(12 2 )x4 tts o ting? 120 tts o t- ll- ots? 120x(2 30 ) Polm: t ll ots wil king t gosts m- s Wt os t stt s v to siy? olu)on: tt s n Ts tt s tt s g: A mtm)l snt)on o s olm Nos (stt) wol onigu)ons As snt sussos ()on sults) T gol tst is st o gol nos (my only on) In stt s g, stt ous only on! W n ly uil tis ull g in mmoy (it s too ig), ut it s usul i
5 tt s Ts tt s g: A mtm)l snt)on o s olm Nos (stt) wol onigu)ons As snt sussos ()on sults) T gol tst is st o gol nos (my only on) In s g, stt ous only on! W n ly uil tis ull g in mmoy (it s too ig), ut it s usul i Tiny s g o 0ny s olm N, 1.0 E, 1.0 Tis is now / stt Possil utus A s t: A wt i t o lns n ti outoms T stt stt is t oot no Ciln oson to sussos Nos sow stts, ut oson to PLAN tt iv tos stts Fo most olms, w n nv tully uil t wol t tt s vs. Ts Quiz: tt s vs. Ts tt E NODE in in t s t is n n0 PATH in t stt s g. W onstut ot on mn n w onstut s li:l s ossil. T Consi tis 4- stt g: How ig is its s t (om )? Imotnt: Lots o t stutu in t s t!
6 T Exml: Romni ing wit T nl T : Exn out otn)l lns (t nos) Mintin ing o )l lns un onsi)on Ty to xn s w t nos s ossil Imotnt is: Fing Exnsion Exlo)on sttgy Min us)on: wi ing nos to xlo?
7 Dt- Fist Dt- Fist ttgy: xn st no ist Imlmnt0on: Fing is LIFO stk Algoitm Po)s Dt- Fist (DF) Po)s Comlt: unt to in solu)on i on xists? O)ml: unt to in t lst ost t? Tim omlxity? omlxity? Ctoon o s t: is t ning to m is t mximum t solu)ons t vious ts Num o nos in n) t? 1 + + 2 +. m = O( m ) m tis 1 no nos 2 nos m nos Wt nos DF xn? om l ix o t t. Coul oss t wol t! I m is init, tks )m O( m ) How mu s os t ing tk? Only s silings on t to oot, so O(m) Is it omlt? m oul ininit, so only i w vnt yls (mo lt) Is it o)ml? No, it ins t lmost solu)on, glss o t o ost m tis 1 no nos 2 nos m nos
8 Bt- Fist Bt- Fist ttgy: xn sllowst no ist Imlmnt0on: Fing is FIFO uu Tis Bt- Fist (BF) Po)s Quiz: DF vs BF Wt nos os BF xn? Posss ll nos ov sllowst solu)on Lt t o sllowst solu)on s tks )m O( s s tis ) 1 no nos 2 nos How mu s os t ing tk? Hs ougly t lst ), so O( s ) s nos Is it omlt? s must init i solu)on xists, so ys! m nos Is it o)ml? Only i osts ll 1 (mo on osts lt) Wn will BF outom DF? Wn will DF outom BF? [Dmo: s/s mz wt (L2D6)]
9 Cost- nsi)v Uniom Cost TART 2 3 1 1 2 3 8 2 9 8 2 4 4 15 OAL 2 2 BF ins t sotst t in tms o num o )ons. It os not in t lst- ost t. W will now ov simil lgoitm wi os in t lst- ost t. Uniom Cost Uniom Cost (UC) Po)s ttgy: xn st no ist: Fing is ioity uu (ioity: umultiv ost) 2 1 8 2 3 9 8 1 15 2 2 1 Wt nos os UC xn? Posss ll nos wit ost lss tn st solu)on! I tt solu)on osts C* n s ost t lst ε, tn t )v t is ougly C*/ε Tks )m O( C*/ε ) (xonn)l in )v t) C*/ε tis 1 2 3 0 3 9 1 How mu s os t ing tk? Hs ougly t lst ), so O( C*/ε ) Cost ontous 4 6 11 5 17 11 13 7 8 11 10 16 Is it omlt? Assuming st solu)on s init ost n minimum ost is osi)v, ys! Is it o)ml? Ys! (Poo nxt ltu vi A*)
10 Uniom Cost Issus T On Quu Rmm: UC xlos insing ost ontous T goo: UC is omlt n o)ml! T : Exlos o)ons in vy i)on No inom)on out gol lo)on W ll ix tt soon! tt 1 2 3 ol [Dmo: mty gi UC (L2D5)] [Dmo: mz wit /sllow wt DF/BF/UC (L2D7)] All ts s lgoitms t sm xt o ing sttgis Contully, ll ings ioity uus (i.. oll)ons o nos wit M ioi)s) P)lly, o DF n BF, you n voi t log(n) ov om n tul ioity uu, y using stks n uus Cn vn o on imlmnt)on tt tks vil uuing ojt n Mols on Wong? ots ov mols o t wol T gnt osn t tully ty ll t lns out in t l wol! Plnning is ll in simul)on You s is only s goo s you mols