1 / 22

Search in Artificial Intelligence

Search in Artificial Intelligence. Find the next move in chess, checkers. Scheduling: finding a good class schedule. Theorem proving: given a set of axioms and inference rules, find a proof of a theorem. Planning: find a sequence of actions to achieve a goal for a robot.

Download Presentation

Search in 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. Search in Artificial Intelligence • Find the next move in chess, checkers. • Scheduling: finding a good class schedule. • Theorem proving: given a set of axioms and inference rules, find a proof of a theorem. • Planning: find a sequence of actions to achieve a goal for a robot. • Natural language understanding: find the best parse of a sentence.

  2. Dimensions of Search Problems • In its general form: find a desired object among a set of objects. • Sometimes, you don’t even know if the object exists or not. • In other cases, the goal is to find the best object. • Blind vs. informed search.

  3. Specifying a search problem? • What are states (nodes in graph)? • What are the operators (arcs between nodes)? • Initial state? • Goal test • Metric (e.g., distance to goal) 7 2 3 1 2 3 4 1 6 4 5 6 E.g., Eight Puzzle 8 5 7 8

  4. Search • Types of Search • Blind • Heuristic & optimization • Adversary Search • Analysis • Completeness • Time complexity • Space Complexity • Guaranteed to find best solution? • Guaranteed to find the closest solution?

  5. Search Strategies • Blind Search • Generate & test • Depth first search • Breadth first search • Iterative deepening search • Iterative broadening search • Heuristic search • Optimizing search

  6. Depth First Search • Maintain stack of nodes to visit • Evaluation • Complete? • Time Complexity? • Space Complexity? Not for infinite spaces a O(b^d) b e O(d) g h c d f

  7. Breadth First Search • Maintain queue of nodes to visit • Evaluation • Complete? • Time Complexity? • Space Complexity? Yes a O(b^d) b c O(b^d) g h d e f

  8. Iterative Deepening Search • DFS with limit; incrementally grow limit • Evaluation • Complete? • Time Complexity? • Space Complexity? Yes a b e O(b^d) c f d i O(d) L g h j k

  9. Search Strategies  • Blind Search • Heuristic Search • Best-first • Beam • Hill climbing • Simulated annealing • Optimizing Search

  10. Heuristic Search • A heuristic (metric) is: • Function from a state to a real number • Low number means state is close to goal • High number means state is far from the goal Designing a good heuristic is very important! (And hard) More on this in a bit...

  11. Best First Search • Idea • Breadth first but use priority queue instead of a queue • Evaluation • Complete? • Time Complexity? • Space Complexity? a b e No c f d i O(b^d) L g h j k O(b^d)

  12. Beam Search • Idea • Best first but only keep N best items on priority queue • Evaluation • Complete? • Time Complexity? • Space Complexity? a b e No c f d i O(b^d) L g h j k O(b + N)

  13. Hill Climbing • Idea • Always choose best child; no backtracking • Evaluation • Complete? • Time Complexity? • Space Complexity? a b e No - suffers from plateau, local maxima, ridges c f d i O(b^d) but only in pathological cases L g h j k O(b)

  14. Simulated Annealing • Objective: avoid local minima • Technique: • For the most part use hill climbing • Occasionally take non-optimal step • Reduce probability(non-optimal) over time • Comparison to Hill Climbing • Completeness? • Speed? • Space Complexity? temp

  15. Search Strategies  • Blind Search • Heuristic Search • Optimizing Search • A* • IDA* • SMA*  Objective is to find the very best solution.

  16. A* Search { Underestimates cost of any solution which can reached from node • Idea • Best first search with admissible heuristic • Plus keep checking until all possibilities look worse • Evaluation • Finds optimal solution? • Time Complexity? • Space Complexity? Yes O(b^d) O(b^d)

  17. 7 2 3 4 1 6 8 5 Admissible Heuristics • f(x) = g(x) + h(x) • g: cost so far • h: underestimate of remaining costs e 12 8 d a f 10 8 For eight puzzle? 14 20 b 15 c

  18. 7 2 3 4 1 6 8 5 Importance of Heuristics • h1 = number of tiles in wrong place • h2 = sum of distances of tiles from correct loc D IDS A*(h1) A*(h2) 2 10 6 6 4 112 13 12 6 680 20 18 8 6384 39 25 10 47127 93 39 12 364404 227 73 14 3473941 539 113 18 3056 363 24 39135 1641

  19. F=21 F=15 Iterative Deepening A* • Like iterative deepening depth first, but... • Depth bound modified to be an f-cost limit • Contour lines bounding search e d a f b c

  20. SMA* • Problem is f-cost bound increases slowly • Must do iterative search again and again • Storing little state between each iteration • Just one number: next highest contour level • SMA* • Uses all available memory to store state • Duplicates minimal work • Optimal in a number of nice ways

  21. Adversary Search • Game playing: want to make the move for which the opponent cannot respond well. a max b e c min f d i L max g h j k -1 min c c c c 1 f f f f -1 1 1 max g 1 h -1 h g -1 g h -1

  22. Alpha-beta Pruning max a b e min c f d i max L g h j k min c c c c f f f f max

More Related