1 / 71

Artificial Intelligence

Artificial Intelligence. Problem Solving. Eriq Muhammad Adams eriq.adams@ub.ac.id. Outline. Problem Solving Agents Problem Formulation Example Problems Basic Search Algorithms. sensors. environment. ?. agent. actuators. Problem-Solving Agent. sensors. environment. ?. agent.

lora
Download Presentation

Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Artificial Intelligence Problem Solving Eriq Muhammad Adams eriq.adams@ub.ac.id

  2. Outline • Problem Solving Agents • Problem Formulation • Example Problems • Basic Search Algorithms

  3. sensors environment ? agent actuators Problem-Solving Agent

  4. sensors environment ? agent actuators • Formulate Goal • Formulate Problem • States • Actions • Find Solution Problem-Solving Agent

  5. Problem-solving agents CS 3243 - Blind Search

  6. Example: Route finding

  7. Holiday Planning • On holiday in Romania; Currently in Arad. Flight leaves tomorrow from Bucharest. • Formulate Goal: Be in Bucharest • Formulate Problem: States: various cities Actions: drive between cities • Find solution: Sequence of cities: Arad, Sibiu, Fagaras, Bucharest

  8. States Actions Solution Goal Start Problem Formulation

  9. Vacuum World

  10. Search Problem • State space • each state is an abstract representation of the environment • the state space is discrete • Initial state • Successor function • Goal test • Path cost

  11. Search Problem • State space • Initial state: • usually the current state • sometimes one or several hypothetical states (“what if …”) • Successor function • Goal test • Path cost

  12. Search Problem • State space • Initial state • Successor function: • [state  subset of states] • an abstract representation of the possible actions • Goal test • Path cost

  13. Search Problem • State space • Initial state • Successor function • Goal test: • usually a condition • sometimes the description of a state • Path cost

  14. Search Problem • State space • Initial state • Successor function • Goal test • Path cost: • [path  positive number] • usually, path cost = sum of step costs • e.g., number of moves of the empty tile

  15. 8 2 1 2 3 3 4 7 4 5 6 5 1 6 7 8 Initial state Goal state Example: 8-puzzle

  16. 0.18 sec 6 days 12 billion years 10 million states/sec Example: 8-puzzle Size of the state space = 9!/2 = 181,440 15-puzzle  .65 x1012 24-puzzle  .5 x1025

  17. Example: Robot navigation What is the state space?

  18. Cost of one horizontal/vertical step = 1 Cost of one diagonal step = 2 Example: Robot navigation

  19. Example: Robot navigation

  20. Assumptions in Basic Search • The environment is static • The environment is discretizable • The environment is observable • The actions are deterministic

  21. Simple Agent Algorithm Problem-Solving-Agent • initial-state  sense/read state • goal  select/read goal • successor  select/read action models • problem  (initial-state, goal, successor) • solution  search(problem) • perform(solution)

  22. Search of State Space

  23. Search of State Space

  24. Search of State Space

  25. Search of State Space

  26. Search of State Space

  27. Search of State Space  search tree

  28. Basic Search Concepts • Search tree • Search node • Node expansion • Search strategy: At each stage it determines which node to expand

  29. 8 8 2 2 8 2 7 3 3 4 4 7 7 3 4 5 5 1 1 6 6 5 1 6 8 2 3 4 7 8 4 8 2 2 3 4 7 3 7 5 1 6 5 1 6 5 1 6 Search Nodes  States The search tree may be infinite even when the state space is finite

  30. Implementation: states vs. nodes • A state is a (representation of) a physical configuration • A node is a data structure constituting part of a search tree includes state, parent node, action, path costg(x), depth • The Expand function creates new nodes, filling in the various fields and using the SuccessorFn of the problem to create the corresponding states. CS 3243 - Blind Search

  31. Node Data Structure • STATE • PARENT • ACTION • COST • DEPTH If a state is too large, it may be preferable to only represent the initial state and (re-)generate the other states when needed

  32. Fringe • Set of search nodes that have not been expanded yet • Implemented as a queue FRINGE • INSERT(node,FRINGE) • REMOVE(FRINGE) • The ordering of the nodes in FRINGE defines the search strategy

  33. Search Algorithm • If GOAL?(initial-state) then return initial-state • INSERT(initial-node,FRINGE) • Repeat: • If FRINGE is empty then return failure • n REMOVE(FRINGE) • s  STATE(n) • For every state s’ in SUCCESSORS(s) • Create a node n’ • If GOAL?(s’) then return path or goal state • INSERT(n’,FRINGE)

  34. Search Strategies • A strategy is defined by picking the order of node expansion • Performance Measures: • Completeness – does it always find a solution if one exists? • Time complexity – number of nodes generated/expanded • Space complexity – maximum number of nodes in memory • Optimality – does it always find a least-cost solution • Time and space complexity are measured in terms of • b – maximum branching factor of the search tree • d – depth of the least-cost solution • m – maximum depth of the state space (may be ∞)

  35. Remark • Some problems formulated as search problems are NP-hard (non-deterministic polynomial-timehard) problems. We cannot expect to solve such a problem in less than exponential time in the worst-case • But we can nevertheless strive to solve as many instances of the problem as possible

  36. Blind vs. Heuristic Strategies • Blind (or uninformed) strategies do not exploit any of the information contained in a state (or use only the information available in the problem definition) • Heuristic (or informed) strategies exploits such information to assess that one node is “more promising” than another

  37. Step cost = 1 Step cost = c(action)  > 0 Blind Strategies • Breadth-first • Bidirectional • Depth-first • Depth-limited • Iterative deepening • Uniform-Cost

  38. 1 2 3 4 5 6 7 Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (1)

  39. 1 2 3 4 5 6 7 Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (2, 3)

  40. 1 2 3 4 5 6 7 Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (3, 4, 5)

  41. 1 2 3 4 5 6 7 Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (4, 5, 6, 7)

  42. Evaluation • b: branching factor • d: depth of shallowest goal node • Complete • Optimal if step cost is 1 • Number of nodes generated:1 + b + b2 + … + bd + b(bd-1) = O(bd+1) • Time and space complexity is O(bd+1)

  43. Time and Memory Requirements Assumptions: b = 10; 1,000,000 nodes/sec; 100bytes/node

  44. Bidirectional Strategy 2 fringe queues: FRINGE1 and FRINGE2 Time and space complexity =O(bd/2)<<O(bd)

  45. 2 3 FRINGE = (1) 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

  46. 2 3 FRINGE = (2, 3) 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

  47. 2 3 FRINGE = (4, 5, 3) 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

  48. 2 3 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

  49. 2 3 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

  50. 2 3 4 5 Depth-First Strategy New nodes are inserted at the front of FRINGE 1

More Related