announcements
play

Announcements Survey about recita)on )mes will be posted - PowerPoint PPT Presentation

Introduc)on to Ar)ficial Intelligence Lecture 2 Uninformed Search CS/CNS/EE 154 Andreas Krause TexPoint fonts used in EMF. Announcements Survey


  1. Introduc)on ¡to ¡ ¡ Ar)ficial ¡Intelligence ¡ Lecture ¡2 ¡– ¡Uninformed ¡Search ¡ CS/CNS/EE ¡154 ¡ Andreas ¡Krause ¡ TexPoint ¡fonts ¡used ¡in ¡EMF. ¡ ¡

  2. Announcements ¡ � Survey ¡about ¡recita)on ¡)mes ¡will ¡be ¡posted ¡today ¡ � Please ¡check ¡website ¡for ¡updates ¡ 2 ¡

  3. Agents ¡and ¡environments ¡ � Agents : ¡Alice, ¡Poker ¡player, ¡Robo ¡recep)onist, ¡… ¡ � Agent ¡maps ¡sequence ¡of ¡percepts ¡to ¡ac)on ¡ � Implemented ¡as ¡algorithm ¡running ¡on ¡physical ¡architecture ¡ � Environment ¡ maps ¡sequence ¡of ¡ac)ons ¡to ¡percept ¡ 3 ¡

  4. Example: ¡Vacuum ¡cleaning ¡robot ¡ � Percepts ¡P ¡= ¡{[A,Clean], ¡[A,Dirty], ¡[B,Clean], ¡[B,Dirty]} ¡ � Ac)ons ¡A ¡= ¡{Le], ¡Right, ¡Suck, ¡NoOp} ¡ � Agent ¡func)on: ¡ � Example: ¡ ¡ 4 ¡

  5. Modeling ¡the ¡environment ¡ � Set ¡of ¡states ¡S ¡(not ¡necessarily ¡finite) ¡ � State ¡transi)ons ¡depend ¡on ¡current ¡state ¡and ¡ac)ons ¡ (can ¡be ¡stochas)c ¡or ¡nondeterminis)c) ¡ 5 ¡

  6. Ra)onality: ¡Performance ¡evalua)on ¡ � Fixed ¡performance ¡measure ¡ evaluates ¡environment ¡seq. ¡ � For ¡example: ¡ � One ¡point ¡for ¡each ¡clean ¡square ¡a]er ¡10 ¡rounds? ¡ � Time ¡it ¡takes ¡un)l ¡all ¡squares ¡clean? ¡ � One ¡point ¡per ¡clean ¡square ¡per ¡round, ¡minus ¡one ¡point ¡per ¡move ¡ � Goal : ¡find ¡agent ¡func)on ¡(program) ¡to ¡maximize ¡ performance ¡ 6 ¡

  7. Environment ¡types ¡ Sudoku ¡ Poker ¡ Spam ¡Filter ¡ Taxi ¡ Observable? ¡ Determinis>c? ¡ Episodic? ¡ Sta>c? ¡ Discrete? ¡ Single-­‑agent? ¡ 7 ¡

  8. Simple ¡reflex ¡agent ¡ ¡Ac)on ¡only ¡func)on ¡of ¡last ¡percept ¡ 8 ¡

  9. Example ¡ Percept ¡ Ac>on ¡ [A,dirty] ¡ Suck ¡ [B,dirty] ¡ Suck ¡ [A,clean] ¡ Right ¡ [B,clean] ¡ Le] ¡ � Will ¡never ¡stop ¡(noop), ¡since ¡we ¡can’t ¡remember ¡state ¡ � This ¡is ¡a ¡fundamental ¡problem ¡of ¡simple ¡reflex ¡agents ¡in ¡ par)ally ¡observable ¡environments! ¡ 9 ¡

  10. Reflex ¡agent ¡with ¡state ¡ ¡Ac)on ¡func)on ¡of ¡percept ¡and ¡internal ¡state ¡ 10 ¡

  11. Example ¡ State ¡vars: ¡cleanA ¡= ¡cleanB ¡= ¡false ¡ Percept ¡ cleanA ¡ cleanB ¡ Ac>on ¡ State ¡change ¡ [X,dirty] ¡ ? ¡ ? ¡ Suck ¡ cleanX ¡= ¡true ¡ [A,clean] ¡ ? ¡ true ¡ NoOp ¡ [A,clean] ¡ ? ¡ false ¡ Right ¡ cleanA ¡= ¡true ¡ [B,clean] ¡ true ¡ ? ¡ NoOp ¡ [B,clean] ¡ false ¡ ? ¡ Le] ¡ cleanB ¡= ¡true ¡ ? ¡means ¡“don’t ¡care” ¡ 11 ¡

  12. Goal-­‑based ¡agents ¡ 12 ¡

  13. Search ¡ � “Get ¡from ¡state ¡A ¡to ¡B ¡as ¡quickly ¡as ¡possible” ¡ � A ¡fundamental ¡problem ¡in ¡many ¡AI ¡problems ¡ � Naviga)on, ¡VLSI ¡layout, ¡resource ¡alloca)on, ¡planning, ¡… ¡ � For ¡now ¡assume ¡ � Fully ¡observable ¡environment ¡and ¡determinis)c ¡ac)ons ¡ 13 ¡

  14. Path ¡planning ¡in ¡Romania ¡ � Travel ¡from ¡Arad ¡to ¡Bucharest ¡ � Cost: ¡Length ¡of ¡path ¡ 14 ¡

  15. Search ¡with ¡goal ¡based ¡agents ¡ � Agent ¡has ¡ ¡ � model ¡of ¡environment ¡(map, ¡puzzle ¡rules, ¡mechanics,…) ¡ How ¡will ¡the ¡environment ¡change ¡if ¡I ¡do ¡X? ¡ � Goal ¡checker: ¡ Declares ¡some ¡environment ¡states ¡as ¡goals ¡ � Performance ¡measure: ¡ � Sum ¡of ¡ac)on ¡costs ¡ � If ¡all ¡ac)ons ¡cost ¡the ¡same ¡this ¡is ¡called ¡unit ¡cost ¡model ¡ � Agent ¡func)on: ¡ � Find ¡cheapest ¡sequence ¡of ¡ac)ons ¡to ¡get ¡to ¡a ¡goal ¡state ¡ 15 ¡

  16. Example: ¡Vacuum ¡ Start ¡state ¡ Goals ¡ � In ¡unit ¡cost ¡model, ¡op)mal ¡solu)on ¡is: ¡ 16 ¡

  17. State ¡spaces ¡ � Vacuum ¡robot: ¡ ¡8 ¡states ¡ � Rubik’s ¡cube: ¡ ¡10^19 ¡states… ¡ � Climbing ¡stairs: ¡ ¡∞ ¡states! ¡ � Cannot ¡represent ¡search ¡graph ¡explicitly! ¡ � Implicit ¡representa)on: ¡ � Successor ¡func)ons ¡maps ¡states ¡to ¡set ¡of ¡(ac)on,state) ¡pairs ¡ � Specifies ¡which ¡states ¡can ¡be ¡reached ¡immediately ¡from ¡any ¡ given ¡state ¡ 17 ¡

  18. Example: ¡8 ¡Puzzle ¡ � Swap ¡)les ¡to ¡ order ¡pieces ¡ � Cost: ¡#moves ¡ � States: ¡config’s ¡ � Successor ¡fn: ¡ 18 ¡

  19. State ¡space ¡representa)on ¡ � Place ¡8 ¡queens ¡that ¡don’t ¡auach ¡ each ¡other. ¡ � States: ¡(par)al) ¡board ¡configura)ons ¡ � Successor ¡func)ons ¡(ac)ons): ¡ 19 ¡

  20. Tree ¡search ¡ � Basic ¡algorithm ¡for ¡search ¡problems ¡ � Organize ¡possible ¡sequences ¡into ¡a ¡tree ¡ � Expand ¡tree ¡one ¡node ¡at ¡a ¡)me ¡ 20 ¡

  21. Nodes ¡in ¡tree ¡search ¡ 21 ¡

  22. Tree ¡search ¡in ¡Romania ¡ 22 ¡

  23. General ¡tree ¡search ¡ ¡ func>on ¡treeSearch( problem , strategy ) ¡ ¡Ini)alize ¡tree ¡with ¡ini)al ¡state ¡of ¡ problem ¡ ¡ Repeat ¡ ¡ If ¡no ¡leaf ¡node ¡available ¡for ¡expansion ¡then ¡Fail ¡ ¡Use ¡ strategy ¡to ¡select ¡leaf ¡node ¡for ¡expansion ¡ ¡ If ¡node ¡contains ¡a ¡goal ¡state ¡then ¡return ¡corresponding ¡solu)on ¡ ¡ Else ¡ expand ¡the ¡node ¡and ¡add ¡resul)ng ¡nodes ¡to ¡search ¡tree ¡ 23 ¡

  24. Implementa)on ¡of ¡general ¡search ¡ � Maintain ¡ fringe ¡ of ¡unexpanded ¡nodes ¡ � Typically ¡implemented ¡as ¡some ¡form ¡of ¡queue ¡(FIFO, ¡LIFO, ¡…) ¡ � Expanding ¡a ¡node ¡means ¡inser)ng ¡successor ¡states ¡into ¡fringe ¡ Fringe ¡= ¡[Sibiu, ¡Timisoara, ¡Zerind] ¡ 24 ¡

  25. Implementa)on: ¡Tree ¡search ¡ 25 ¡

  26. Quality ¡of ¡a ¡search ¡strategy ¡ ¡Completeness ¡ � Does ¡it ¡always ¡find ¡a ¡solu)on ¡if ¡one ¡exists? ¡ ¡Time ¡complexity ¡ � Number ¡of ¡nodes ¡expanded ¡ ¡Space ¡complexity ¡ � Maximum ¡size ¡of ¡the ¡queue ¡(fringe) ¡ ¡Op)mality ¡ � Does ¡it ¡always ¡find ¡the ¡op)mal ¡solu)on ¡if ¡one ¡exists? ¡ ¡Time/space ¡complexity ¡measured ¡as ¡ � b : ¡maximum ¡branching ¡factor ¡ � d : ¡depth ¡of ¡least-­‑cost ¡solu)on ¡ � m : ¡maximum ¡depth ¡of ¡tree ¡ 26 ¡

  27. Informed ¡vs. ¡uninformed ¡search ¡ � Uninformed ¡search ¡ � Can ¡only ¡dis)nguish ¡goals ¡from ¡non-­‑goal ¡states ¡ � Topic ¡of ¡this ¡lecture ¡ � Informed ¡search ¡ � Have ¡informa)on ¡about ¡progress ¡towards ¡the ¡op)mal ¡solu)on ¡ � Can ¡dras)cally ¡improve ¡)me ¡complexity ¡ � Next ¡lecture ¡ 27 ¡

  28. Breadth-­‑first ¡search ¡(BFS) ¡ � Strategy: ¡fringe ¡implemented ¡as ¡a ¡FIFO ¡queue ¡ � Expands ¡shallowest ¡unexpanded ¡node ¡ 28 ¡

  29. Proper)es ¡of ¡Breadth ¡first ¡search ¡ � Complete? ¡ � Time ¡complexity? ¡ � Space ¡complexity? ¡ � Op)mal? ¡ ¡Memory ¡usage ¡is ¡o]en ¡prohibi)ve! ¡ 29 ¡

  30. Uniform ¡cost ¡search ¡ � Expand ¡least ¡cost ¡node ¡ � Implementa)on: ¡ ¡ � Fringe ¡is ¡cost-­‑ordered ¡queue ¡(priority ¡queue) ¡ � Equivalent ¡to ¡BFS ¡in ¡the ¡unit ¡cost ¡case ¡ � Complete? ¡ � Time ¡complexity? ¡ � Space ¡complexity? ¡ � Op)mal? ¡ 30 ¡

  31. Depth ¡first ¡search ¡(DFS) ¡ � Strategy: ¡fringe ¡implemented ¡as ¡a ¡LIFO ¡queue ¡ � Expands ¡deepest ¡unexpanded ¡node ¡ 31 ¡

  32. Proper)es ¡of ¡Depth ¡first ¡search ¡ � Complete? ¡ � Time ¡complexity? ¡ � Space ¡complexity? ¡ � Op)mal? ¡ ¡Not ¡op)mal! ¡Fails ¡in ¡graphs ¡with ¡loops! ¡ ¡ 32 ¡

  33. Depth-­‑limited ¡search ¡ � Try ¡to ¡fix ¡DFS ¡by ¡imposing ¡depth ¡limit ¡ � Implementa)on: ¡Do ¡not ¡expand ¡nodes ¡with ¡depth ¡> ¡l ¡ � Complete? ¡ � Time ¡complexity? ¡ � Space ¡complexity? ¡ � Op)mal? ¡ 33 ¡

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