Presentation is loading. Please wait.

Presentation is loading. Please wait.

Search in Artificial Intelligence zFind the next move in chess, checkers. zScheduling: finding a good class schedule. zTheorem proving: given a set of.

Similar presentations


Presentation on theme: "Search in Artificial Intelligence zFind the next move in chess, checkers. zScheduling: finding a good class schedule. zTheorem proving: given a set of."— Presentation transcript:

1 Search in Artificial Intelligence zFind the next move in chess, checkers. zScheduling: finding a good class schedule. zTheorem proving: given a set of axioms and inference rules, find a proof of a theorem. zPlanning: find a sequence of actions to achieve a goal for a robot. zNatural language understanding: find the best parse of a sentence.

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

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

4 Search zTypes of Search yBlind yHeuristic & optimization yAdversary Search zAnalysis yCompleteness yTime complexity ySpace Complexity yGuaranteed to find best solution? yGuaranteed to find the closest solution?

5 5 Search Strategies zBlind Search yGenerate & test yDepth first search yBreadth first search yIterative deepening search yIterative broadening search zHeuristic search zOptimizing search

6 O(b^d) O(d) Not for infinite spaces Depth First Search a b cd e f gh zMaintain stack of nodes to visit zEvaluation yComplete? yTime Complexity? ySpace Complexity?

7 Yes O(b^d) Breadth First Search a b c def gh zMaintain queue of nodes to visit zEvaluation yComplete? yTime Complexity? ySpace Complexity?

8 Yes O(b^d) O(d) Iterative Deepening Search a b c d e f gh zDFS with limit; incrementally grow limit zEvaluation yComplete? yTime Complexity? ySpace Complexity? j i k L

9 9 Search Strategies zBlind Search zHeuristic Search yBest-first yBeam yHill climbing ySimulated annealing zOptimizing Search 

10 Heuristic Search zA heuristic (metric) is: yFunction from a state to a real number xLow number means state is close to goal xHigh number means state is far from the goal Designing a good heuristic is very important! (And hard) More on this in a bit...

11 No O(b^d) zIdea yBreadth first but use priority queue instead of a queue zEvaluation yComplete? yTime Complexity? ySpace Complexity? Best First Search a b c d e f ghj i k L

12 No O(b^d) O(b + N) Beam Search zIdea yBest first but only keep N best items on priority queue zEvaluation yComplete? yTime Complexity? ySpace Complexity? a b c d e f ghj i k L

13 No - suffers from plateau, local maxima, ridges O(b^d) but only in pathological cases O(b) Hill Climbing zIdea yAlways choose best child; no backtracking zEvaluation yComplete? yTime Complexity? ySpace Complexity? a b c d e f ghj i k L

14 Simulated Annealing zObjective: avoid local minima zTechnique: yFor the most part use hill climbing yOccasionally take non-optimal step yReduce probability(non-optimal) over time zComparison to Hill Climbing yCompleteness? ySpeed? ySpace Complexity? temp

15 15 Search Strategies zBlind Search zHeuristic Search zOptimizing Search yA* yIDA* ySMA* Objective is to find the very best solution.  

16 A* Search zIdea yBest first search with admissible heuristic yPlus keep checking until all possibilities look worse zEvaluation yFinds optimal solution? yTime Complexity? ySpace Complexity? Yes O(b^d) Underestimates cost of any solution which can reached from node {

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

18 Importance of Heuristics D IDS A*(h1)A*(h2) 2 10 6 6 4 11213 12 6 68020 18 8 638439 25 10 4712793 39 12 364404 227 73 143473941 539 113 18 3056 363 24 391351641 zh1 = number of tiles in wrong place zh2 = sum of distances of tiles from correct loc 7 2 3 8 5 4 1 6

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

20 SMA* zProblem is f-cost bound increases slowly zMust do iterative search again and again zStoring little state between each iteration yJust one number: next highest contour level zSMA* yUses all available memory to store state yDuplicates minimal work yOptimal in a number of nice ways

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

22 Alpha-beta Pruning z a b c d e f ghj i k L c f c f c f c f max min max


Download ppt "Search in Artificial Intelligence zFind the next move in chess, checkers. zScheduling: finding a good class schedule. zTheorem proving: given a set of."

Similar presentations


Ads by Google