heuris c searches recap
play

Heuris'c Searches recap Describing a state. En're state - PowerPoint PPT Presentation

Heuris'c Searches recap Describing a state. En're state space vs. incremental development. Elimina'on of children. the solu'on path. Genera'on


  1. Heuris'c ¡Searches ¡

  2. recap ¡ • Describing ¡a ¡state. ¡ • En're ¡state ¡space ¡vs. ¡incremental ¡ development. ¡ • Elimina'on ¡of ¡children. ¡ • the ¡solu'on ¡path. ¡ • Genera'on ¡of ¡children. ¡

  3. Heuris'c ¡Search ¡ • Heuris'cs ¡help ¡us ¡to ¡reduce ¡the ¡size ¡ of ¡the ¡search ¡space. ¡ ¡ ¡ • An ¡evalua'on ¡func'on ¡is ¡applied ¡to ¡ each ¡goal ¡to ¡assess ¡how ¡promising ¡it ¡ is ¡in ¡leading ¡to ¡the ¡goal. ¡ • Heuris'c ¡searches ¡incorporate ¡the ¡ use ¡of ¡domain-­‑specific ¡knowledge ¡in ¡ the ¡process ¡of ¡choosing ¡which ¡node ¡ to ¡visit ¡next ¡in ¡the ¡search ¡process. ¡

  4. Heuris'c ¡Search ¡ • Search ¡methods ¡that ¡include ¡the ¡use ¡of ¡ domain ¡knowledge ¡in ¡the ¡form ¡of ¡ heuris'cs ¡are ¡described ¡as ¡“weak” ¡ search ¡methods. ¡ ¡ ¡ • The ¡knowledge ¡used ¡is ¡“weak” ¡in ¡that ¡it ¡ may ¡help ¡but ¡does ¡not ¡always ¡help ¡to ¡ find ¡a ¡solu'on. ¡ ¡ • Examples ¡of ¡heuris'c ¡searches ¡: ¡best ¡ . ¡ first ¡search, ¡A* ¡algorithm, ¡hill-­‑climbing. ¡

  5. Heuris'c ¡Search ¡ • Heuris'c ¡searches ¡incorporate ¡the ¡use ¡ of ¡domain-­‑specific ¡knowledge ¡in ¡the ¡ process ¡of ¡choosing ¡which ¡node ¡to ¡visit ¡ next ¡in ¡the ¡search ¡process. ¡ • Search ¡methods ¡that ¡include ¡the ¡use ¡of ¡ domain ¡knowledge ¡in ¡the ¡form ¡of ¡ heuris'cs ¡are ¡described ¡as ¡“weak” ¡ search ¡methods. ¡ ¡ ¡ • The ¡knowledge ¡used ¡is ¡“weak” ¡in ¡that ¡it ¡ usually ¡helps ¡but ¡does ¡not ¡always ¡help ¡ . ¡ to ¡find ¡a ¡solu'on. ¡

  6. Calcula'ng ¡Heuris'cs ¡ • Heuris'cs ¡are ¡rules ¡of ¡thumb ¡that ¡may ¡ find ¡a ¡solu'on ¡but ¡are ¡not ¡guaranteed ¡ to. ¡ ¡ • Heuris'c ¡func'ons ¡have ¡also ¡been ¡ defined ¡as ¡evalua'on ¡func'ons ¡that ¡ es'mate ¡the ¡cost ¡from ¡a ¡node ¡to ¡the ¡ goal ¡node. ¡ • The ¡incorpora'on ¡of ¡domain ¡knowledge ¡ into ¡the ¡search ¡process ¡by ¡means ¡of ¡ heuris'cs ¡is ¡meant ¡to ¡speed ¡up ¡the ¡ search ¡process. ¡ . ¡ • Heuris'c ¡func'ons ¡are ¡not ¡guaranteed ¡ to ¡be ¡completely ¡accurate. ¡ ¡ ¡

  7. Calcula'ng ¡Heuris'cs ¡ • Heuris'c ¡values ¡are ¡greater ¡than ¡and ¡ equal ¡to ¡zero ¡for ¡all ¡nodes. ¡ • ¡Heuris'c ¡values ¡are ¡seen ¡as ¡an ¡ approximate ¡cost ¡of ¡finding ¡a ¡solu'on. ¡ ¡ ¡ • A ¡heuris'c ¡value ¡of ¡zero ¡indicates ¡that ¡ the ¡state ¡is ¡a ¡goal ¡state. ¡ • A ¡heuris'c ¡that ¡never ¡overes'mates ¡the ¡ cost ¡to ¡the ¡goal ¡is ¡referred ¡to ¡as ¡an ¡ admissible ¡heuris'c. ¡ ¡ ¡ . ¡ • Not ¡all ¡heuris'cs ¡are ¡necessarily ¡ admissible. ¡ ¡

  8. Calcula'ng ¡Heuris'cs ¡ • A ¡heuris'c ¡value ¡of ¡infinity ¡indicates ¡that ¡ the ¡state ¡is ¡a ¡“deadend” ¡and ¡is ¡not ¡going ¡ to ¡lead ¡anywhere. ¡ ¡ ¡ • A ¡good ¡heuris'c ¡must ¡not ¡take ¡long ¡to ¡ compute. ¡ ¡ ¡ • Heuris'cs ¡are ¡oMen ¡defined ¡on ¡a ¡ simplified ¡or ¡relaxed ¡version ¡of ¡the ¡ problem, ¡e.g. ¡the ¡number ¡of ¡'les ¡that ¡are ¡ out ¡of ¡place. ¡ . ¡

  9. Calcula'ng ¡Heuris'cs ¡ • A ¡heuris'c ¡func'on ¡h1 ¡is ¡beOer ¡than ¡ some ¡heuris'c ¡func'on ¡h2 ¡if ¡fewer ¡ nodes ¡are ¡expanded ¡during ¡the ¡ search ¡when ¡h1 ¡is ¡used ¡than ¡when ¡ h2 ¡is ¡used. ¡ • Experience ¡has ¡shown ¡that ¡it ¡is ¡ difficult ¡to ¡devise ¡heuris'c ¡func'ons. ¡ ¡ ¡ • Furthermore, ¡heuris'cs ¡are ¡fallible ¡ . ¡ and ¡are ¡by ¡no ¡means ¡perfect. ¡ ¡

  10. Example: ¡8-­‑Puzzle ¡Problem ¡ Initial State Goal State 2 8 3 1 2 3 8 1 6 4 4 7 5 7 6 5 . ¡

  11. Heuris'cs ¡for ¡the ¡8-­‑Puzzle ¡Problem ¡ • Number ¡of ¡'les ¡out ¡of ¡place ¡-­‑ ¡count ¡ the ¡number ¡of ¡'les ¡out ¡of ¡place ¡in ¡ each ¡state ¡compared ¡to ¡the ¡goal ¡. ¡ • Sum ¡the ¡distance ¡that ¡the ¡'les ¡are ¡ out ¡of ¡place. ¡ • Tile ¡reversals ¡-­‑ ¡mul'ple ¡the ¡number ¡ of ¡'le ¡reversals ¡by ¡2. ¡ . ¡ ¡

  12. Examples ¡8-­‑Puzzle ¡Problem ¡ Sum of 2 x the number Tiles out distances out of direct tile State of place of place reversals 2 8 3 5 6 0 1 6 4 7 5 2 8 3 3 4 0 1 4 7 6 5 . ¡ 2 8 3 5 6 0 1 6 4 7 5

  13. Best-­‑First ¡Search ¡ • The ¡best-­‑first ¡search ¡is ¡a ¡general ¡search ¡ where ¡the ¡minimum ¡cost ¡nodes ¡are ¡ expanded ¡first. ¡ ¡ ¡ • The ¡best-­‑ ¡first ¡search ¡is ¡not ¡guaranteed ¡ to ¡find ¡the ¡shortest ¡solu'on ¡path. ¡ ¡ • The ¡best-­‑first ¡search ¡aOempts ¡to ¡ minimize ¡the ¡cost ¡of ¡finding ¡a ¡solu'on. ¡ ¡ ¡ • Is ¡a ¡combina'on ¡of ¡the ¡depth ¡first-­‑ . ¡ search ¡and ¡breadth-­‑first ¡search ¡with ¡ heuris'cs. ¡ ¡ ¡

  14. Best-­‑First ¡Search ¡ Goal ¡States: ¡H, ¡L ¡ A B3 C2 D2 E3 F2 G4 H1 I99 . ¡ J99 L3 K99

  15. Best ¡first ¡search ¡exercise ¡ A5 ¡to ¡B4 ¡and ¡C4 ¡ B4 ¡to ¡D6 ¡and ¡E5 ¡ ¡ ¡ C4 ¡to ¡F4 ¡and ¡G5 ¡ ¡ ¡ D6 ¡to ¡I7 ¡and ¡J8 ¡ ¡ ¡ I7 ¡to ¡K7 ¡and ¡L8 ¡ ¡ ¡ ¡ Start ¡state ¡: ¡A ¡ . ¡ Goal ¡state ¡: ¡E ¡ ¡

  16. Hill-­‑Climbing ¡ • Hill-­‑climbing ¡is ¡similar ¡to ¡the ¡best ¡ first ¡search. ¡ • While ¡the ¡best ¡first ¡search ¡considers ¡ states ¡globally, ¡hill-­‑climbing ¡ considers ¡only ¡local ¡states. ¡ • The ¡hill-­‑climbing ¡algorithm ¡ generates ¡a ¡par'al ¡tree/graph. ¡

  17. Hill-­‑Climbing ¡ Goal ¡States: ¡H, ¡L ¡ A B3 C2 D2 E3 F2 G4 H1 I99 J99 L3 K99

  18. Hill ¡climbing ¡exercise ¡ A ¡to ¡B3 ¡and ¡C2 ¡ B3 ¡to ¡D2 ¡and ¡E3 ¡ C2 ¡to ¡F2 ¡and ¡G4 ¡ D2 ¡to ¡H1 ¡and ¡I99 ¡ F2 ¡to ¡J99 ¡ G4 ¡to ¡K99 ¡and ¡L3 ¡ ¡ Start ¡state: ¡A ¡ Goal ¡state: ¡H, ¡L ¡

  19. Greedy ¡Hill-­‑Climbing ¡ • Evaluate ¡the ¡ini'al ¡state. ¡ • Select ¡a ¡new ¡operator. ¡ • Evaluate ¡the ¡new ¡state ¡ • If ¡it ¡is ¡closer ¡to ¡the ¡goal ¡state ¡than ¡the ¡ current ¡state ¡make ¡it ¡the ¡current ¡state. ¡ • If ¡it ¡is ¡no ¡beOer ¡ignore ¡ • If ¡the ¡current ¡state ¡is ¡the ¡goal ¡state ¡or ¡no ¡ new ¡operators ¡are ¡available, ¡quit. ¡ ¡ Otherwise ¡repeat ¡steps ¡2 ¡to ¡4. ¡

  20. Example ¡1: ¡Greedy ¡Hill-­‑Climbing ¡ without ¡Backtracking ¡ A Goal ¡States: ¡H, ¡L ¡ B4 C4 D2 E5 F2 G4 H1 I99 J99 L3 K99

  21. Example ¡2: ¡Greedy ¡Hill-­‑Climbing ¡ with ¡Backtracking ¡ Goal ¡States: ¡H, ¡L ¡ A B3 C2 D2 E3 F2 G4 H1 I99 J99 L3 K99

  22. Example ¡3: ¡Greedy ¡Hill-­‑Climbing ¡ without ¡Backtracking ¡ Goal ¡States: ¡H, ¡L ¡ A B3 C2 D2 E3 F2 G4 H1 I99 J99 L3 K99

  23. A ¡Algorithm ¡ • The ¡A ¡algorithm ¡is ¡essen'ally ¡the ¡best ¡ first ¡search ¡implemented ¡with ¡the ¡ following ¡func'on: ¡f(n) ¡= ¡g(n) ¡+ ¡h(n) ¡ – where ¡g(n) ¡-­‑ ¡measures ¡the ¡length ¡of ¡ the ¡path ¡from ¡any ¡state ¡n ¡to ¡the ¡start ¡ state ¡ – h(n) ¡-­‑ ¡is ¡the ¡heuris'c ¡measure ¡from ¡the ¡ state ¡n ¡to ¡the ¡goal ¡state ¡

  24. 8-­‑Puzzle ¡Example ¡ a) 2 8 3 f(a)=4+0=4 g(n)=0 1 6 4 7 5 b) c) d) 2 8 3 2 8 3 2 8 3 1 6 4 1 4 f(c)=3+1=4 1 f(b)=5+1=6 6 4 f(d)=5+1=6 g(n)=1 7 5 7 6 5 7 5 e) f) g) 2 8 3 2 8 3 2 8 3 1 4 g(n)=2 f(e)=3+2=5 1 4 f(f)=3+2=5 f(g)=4+2=4 1 4 7 6 5 7 6 5 7 6 5 h(n)=no. of tiles out of place

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend