1 / 42

Symbolic AI: Problem Solving

E. Trentin, DIISM. Symbolic AI: Problem Solving. Example: Romania. 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 :

carlo
Download Presentation

Symbolic AI: Problem Solving

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. E. Trentin, DIISM Symbolic AI: Problem Solving Problem Solving - Search

  2. Example: Romania 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, e.g., Arad, Sibiu, Fagaras, Bucharest

  3. Example: Romania

  4. Single-state problem formulation A problem is defined by five items: A set of discrete states (representing the “world”) initial state e.g., "at Arad" actions or successor functionS(x) = set of action–state pairs e.g., S(Arad) = {<Arad  Zerind, Zerind>, … } goal test, can be explicit, e.g., x = "at Bucharest" implicit, e.g., Checkmate(x) path cost g(x) (additive) from the root to node x e.g., sum of distances, number of actions executed, etc. c(x,a,y) is the step cost (assumed to be ≥ 0) for expanding node y from node x via action a A solution is a sequence of actions leading from the initial state to a goal state

  5. Example: The 8-puzzle states? actions? goal test? path cost?

  6. Example: The 8-puzzle states?locations of tiles actions?move blank left, right, up, down goal test?= goal state (given) path cost? 1 per move [Note: optimal solution of n-Puzzle family is NP-hard]

  7. Example: robotic assembly states?: coordinates of parts of the object to be assembled actions?: motions of robot joints goal test?: complete assembly path cost?: time to execute

  8. Tree search algorithms Basic idea: offline, simulated exploration of state space by generating successors of already-explored states (a.k.a.~expanding states)

  9. Tree search example

  10. Tree search example

  11. Tree search example

  12. Implementation: states vs. nodes A state is a (representation of) a physical configuration A node is a data structure (part of a search tree) that 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.

  13. Search strategies A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: completeness: does it always find a solution if one exists? time complexity: number of nodes generated 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 ∞)

  14. Uninformed search strategies Uninformed search strategies use only the information available in the problem definition Breadth-first search Uniform-cost search Depth-first search Depth-limited search Iterative deepening search

  15. Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end

  16. Breadth-first search • Expand shallowest unexpanded node • Implementation: • fringe is a FIFO queue, i.e., new successors go at end

  17. Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end

  18. Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end

  19. Properties of breadth-first search Complete?Yes (if b is finite) Time?1+b+b2+b3+… +bd = O(bd) Space?O(bd) (keeps every node in memory) Optimal? Yes (if cost = 1 per step) Space may be the bigger problem (even bigger than time)

  20. Uniform-cost search Expand least-cost unexpanded node Implementation: fringe = queue ordered by path cost Equivalent to breadth-first if step costs all equal Complete? Yes, if step cost ≥ ε Time? # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)) where C* is the cost of the optimal solution Space? # of nodes with g≤ cost of optimal solution, O(bceiling(C*/ ε)) Optimal? Yes – nodes expanded in increasing order of g(n)

  21. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  22. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  23. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  24. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  25. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  26. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  27. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  28. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  29. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  30. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  31. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  32. Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

  33. (kind of wobbling) properties of depth-first search Complete? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path  complete in finite spaces Time?O(bm): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?O(bm), i.e., linear space! Optimal? No

  34. Depth-limited search (DLS) DLS = depth-first search with depth limit l, i.e., nodes at depth l are not expanded any further Recursive implementation:

  35. Iterative deepening search

  36. Iterative deepening search l =0

  37. Iterative deepening search l =1

  38. Iterative deepening search l =2

  39. Iterative deepening search l =3

  40. Properties of iterative deepening search Complete? Yes Time?O(bd) Space?O(bd) Optimal? Yes (if step cost = 1)

  41. Repeated states Failure to detect repeated states can turn a linear problem into an exponential one!

  42. Graph search

More Related