Title: Lo al Sear h B.Y. ✫ ✬ Required reading: AIMA, Chapter 4 Choueiry L WH: Chapters 6, 10, 13 and 14. In tro du tion to Arti� ial In telligen e CSCE 476-876, Spring 2012 URL: www. se.unl.edu/� ho uei ry/ S1 2-4 76- 87 6 1 Berthe Y. Choueiry (Sh u-w e-ri) (402)472-5444 Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
B.Y. ✫ ✬ Choueiry Outline Iterativ e impro v emen t sear h: Hill- lim bing Sim ulated annealing ... • 2 • • Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
B.Y. ✫ ✬ Choueiry T yp es of Sear h (I) 1- Uninformed vs. informed 2- Systemati / onstru tiv e vs. iterativ e impro v emen t xxx 3 Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
Iterativ e impro v emen t (a.k.a. lo al sear h) B.Y. ✫ ✬ Choueiry Sometimes, the `path' to the goal is irrelev an t only the state des ription (or its qualit y) is needed Iterativ e impro v emen t sear h − → ho ose a single urren t state, sub-optimal gradually mo dify urren t state 4 generally visiting `neigh b ors' • un til rea hing a near-optimal state • Example: omplete-state form ulation of N -queens • Instru tor's F • ebruary notes 17, 2012 #8 ✪ ✩
B.Y. ✫ ✬ Choueiry Main adv an tages of lo al sear h te hniques 1. Memory (usually a onstan t amoun t) 2. Find reasonable solutions in large spa es where w e annot p ossibly sear h the spa e exhaustiv ely 3. Useful for optimization problems: 5 b est state giv en an ob je tiv e fun tion (qualit y of the goal) Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
In tuition : state-s ap e lands ap e B.Y. ✫ ✬ Choueiry evaluation All states are la y ed up on the surfa e of a lands ap e current state A state's lo ation determines its neigh b ors (where it an mo v e) 6 A state's elev ation represen ts its qualit y (v alue of ob je tiv e fun tion) • Mo v e from one neigh b or of the urren t state to another state • un til rea hing the highest p eak Instru tor's • F ebruary • notes 17, 2012 #8 ✪ ✩
T w o ma jor lasses B.Y. 1. Hill lim bing (a.k.a. gradien t as en t/des en t) ✫ ✬ try to mak e hanges to impro v e qualit y of urren t state Choueiry 2. Sim ulated Annealing (ph ysi s) things an temp orarily get w orse → Others: tabu sear h, lo al b eam sear h, geneti algorithms, et . → Optimalit y (soundness)? Completeness? 7 Complexit y: spa e? time? In pra ti e, surprisingly go o d.. (ero ding m yth) − → Instru tor's − → F ebruary − → notes 17, 2012 #8 ✪ ✩
Hill lim bing Start from an y state at random and lo op: B.Y. ✫ ✬ Examine all dire t neigh b ors Choueiry If a neigh b or has higher v alue then mo v e to it else exit evaluation objective function global maximum shoulder 8 local maximum “flat” local maximum Lo al optima: (maxima or minima) sear h halts current state Problems: Plateau: �at lo al optim um or shoulder state space current Ridge state Instru tor's 8 F > > ebruary < > > notes : 17, 2012 #8 ✪ ✩
Plateaux Allo w sidew a y mo v es B.Y. ✫ ✬ Choueiry objective function global maximum shoulder local maximum “flat” local maximum 9 F or shoulder, go o d solution F or �at lo al optima, ma y result in an in�nite lo op state space current state Limit n um b er of mo v es Instru tor's • F ebruary • notes 17, 2012 #8 ✪ ✩
✬ ✩ vigate na to di� ult is that optima al lo of Sequen e Ridges B.Y. Choueiry 10 Instru tor's notes #8 F ebruary 17, 2012 ✫ ✪
V arian ts of Hill Clim bing B.Y. ✫ ✬ Choueiry Sto hasti hill lim bing: random w alk Cho ose to disob ey the heuristi , sometimes P arameter: Ho w often? First- hoi e hill lim bing • Cho ose �rst b est neigh b or examined Go o d solution when w e ha v e to o man y neigh b ors 11 Random-restart hill lim bing • A series of hill- lim bing sear hes from random initial states Instru tor's • F ebruary notes 17, 2012 #8 ✪ ✩
Random-restart hill- lim bing B.Y. ✫ ✬ Choueiry When HC halts or no progress is made re-start from a di�eren t (randomly hosen) starting sa v e b est results found so far → Rep eat random restart - for a �xed n um b er of iterations, or 12 - un til b est results ha v e not b een impro v ed for a ertain n um b er of iterations → Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
Sim ulated annealing (I) Basi idea: When stu k in a lo al maxim um allo w few steps to w ards less go o d neigh b ors to es ap e the lo al maxim um B.Y. ✫ ✬ Choueiry Start from an y state at random, start oun t do wn and lo op un til time is o v er: Pi k up a neigh b or at random Set ∆ E = v alue(neigh b or) - v alue( urren t state) If ∆ E>0 (neigh b or is b etter) then mo v e to neigh b or else ∆ E<0 mo v e to it with probabilit y < 1 13 ∆ E is negativ e T ransition probabilit y ≃ e ∆ E/T T: oun t-do wn time as time passes, less and less lik ely to mak e the mo v e to w ards `unattra tiv e' neigh b ors 8 Instru tor's < F ebruary : notes 17, 2012 #8 ✪ ✩
Sim ulated annealing (I I) B.Y. ✫ ✬ Choueiry Analogy to ph ysi s: Gradually o oling a liquid un til it freezes If temp erature is lo w ered su� ien tly slo wly , material will attain lo w est-energy on�guration (p erfe t order) Coun t do wn T emp erature 14 Mo v es b et w een states Thermal noise Global optim um Lo w est-energy on�guration ← → ← → Instru tor's F ← → ebruary notes 17, 2012 #8 ✪ ✩
B.Y. ✫ ✬ Ho w ab out de ision problems ? Choueiry Optimization problems De ision problems Iterativ e impro v emen t Iterativ e repair State v alue Num b er of onstrain ts violated Sub-optimal state In onsisten t state 15 Optimal state Consisten t state ← → ← → ← → ← → Instru tor's F ebruary notes 17, 2012 #8 ✪ ✩
Lo al b eam sear h B.Y. ✫ ✬ Choueiry Keeps tra k of k states Me hanism: Begins with k states A t ea h step, all su essors of all k states generated • Goal rea hed? Stop. • Otherwise, sele ts k b est su essors, and rep eat. 16 Not exa tly a k restarts: k runs are not indep enden t Sto hasti b eam sear h in reases div ersit y • Instru tor's F ebruary • notes 17, 2012 #8 ✪ ✩
Geneti algorithms B.Y. Basi on ept: om bines t w o (paren t) states ✫ ✬ Choueiry Me hanism: Starts with k random states (p opulation) En o des individuals in a ompa t represen tation (e.g., a string • in an alphab et) • Com bines partial solutions to generate new solutions (next generation) 17 Instru tor's + = F ebruary notes 17, 2012 #8 ✪ ✩
Imp ortan t omp onen ts of a geneti algorithm B.Y. ✫ ✬ Choueiry 32748552 32748152 24748552 32752411 24 31% 24752411 24752411 32752411 24748552 23 29% 32752124 32252124 24415124 32752411 Fitness fun tion ranks a state's qualit y , assigns probabilit y for 20 26% 24415411 24415417 32543213 24415124 11 14% sele tion (a) (b) (c) (d) (e) Sele tion Initial Population randomly Fitness Function ho oses Selection pairs for Crossover om binations Mutation dep ending 18 on �tness • Crosso v er p oin t randomly hosen for ea h individual, o�springs are generated • Mutation randomly hanges a state Instru tor's F • ebruary notes 17, • 2012 #8 ✪ ✩
Recommend
More recommend