1 / 32

Princess Nora University Artificial Intelligence

Princess Nora University Artificial Intelligence. Chapter (4) Informed search algorithms. Outline. Best-first search Greedy best-first search A * search Heuristics Local search algorithms Hill-climbing search Simulated annealing search Local beam search Genetic algorithms.

sirius
Download Presentation

Princess Nora University 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. Princess Nora UniversityArtificial Intelligence Chapter (4) Informed search algorithms

  2. Outline • Best-first search • Greedy best-first search • A* search • Heuristics • Local search algorithms • Hill-climbing search • Simulated annealing search • Local beam search • Genetic algorithms

  3. Informed Search Idea: use problem specific knowledge to pick which node to expand • Typically involves a heuristic function h(n) estimating the cheapest path from n.STATE to a goal state A search strategy is defined by picking the order of node expansion

  4. Best-first search • We can use it to direct our search towards the goal. • Best first search simply chooses the unvisited node with the best heuristic value to visit next. • It can be implemented in the same algorithm as lowest-cost Breadth First Search. • Idea: use an evaluation functionf(n) for each node • estimate of "desirability" • Expand most desirable unexpanded node • Implementation: Order the nodes in fringe in decreasing order of desirability Special cases: • greedy best-first search • A* search

  5. Romania with step costs in km

  6. Greedy best-first search • Evaluation function f(n) = h(n) (heuristic) = estimate of cost from n to goal • e.g., hSLD(n) = straight-line distance from n to Bucharest • Greedy best-first search expands the node that appears to be closest to goal

  7. Greedy best-first search example

  8. Greedy best-first search example

  9. Greedy best-first search example

  10. Greedy best-first search example

  11. Properties of greedy best-first search • Complete? No – can get stuck in loops, e.g., Iasi Neamt Iasi Neamt • Time?O(bm), but a good heuristic can give dramatic improvement • Space?O(bm) -- keeps all nodes in memory Optimal? No

  12. A* search • Idea: avoid expanding paths that are already expensive • Evaluation function f(n) = g(n) + h(n) • g(n) = cost so far to reach n • h(n) = estimated cost from n to goal • f(n) = estimated total cost of path through n to goal

  13. A* search example

  14. A* search example

  15. A* search example

  16. A* search example

  17. A* search example

  18. A* search example

  19. Admissible heuristics • A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal state from n. • An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic • Example: hSLD(n) (never overestimates the actual road distance) • Theorem: If h(n) is admissible, A* using TREE-SEARCH is optimal

  20. Properties of A* • Complete? Yes (unless there are infinitely many nodes with f ≤ f(G) ) • Time? Exponential • Space? Keeps all nodes in memory • Optimal? Yes

  21. Local search algorithms • In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution • State space = set of "complete" configurations • Find configuration satisfying constraints, e.g., n-queens • In such cases, we can use local search algorithms • keep a single "current" state, try to improve it. • Very memory efficient (only remember current state)

  22. Hill-climbing search • “ a loop that continuously moves in the direction of increasing value” • terminates when a peak is reached • Value can be either • Objective function value • Heuristic function value (minimized) • Hill climbing does not look ahead of the immediate neighbors of the current state. • Can randomly choose among the set of best successors, if multiple have the best value. • Characterized as “trying to find the top of Mount Everest while in a thick fog”

  23. Example: n-queens • Put n queens on an n × n board with no two queens on the same row, column, or diagonal

  24. Hill-climbing search

  25. Hill climbing and local maxima • When local maxima exist, hill climbing is suboptimal • Local maxima: a local maximum, as opposed to a global maximum, is a peak that is lower than the highest peak in the state space. • Once on a local maximum, the algorithm will halt • even though the solution may be far from satisfactory. • Simple (often effective) solution • Multiple random restarts

  26. Hill-climbing search: 8-queens problem • A local minimum with h = 1

  27. Simulated annealing search • Idea: escape local maxima by allowing some "bad" moves but gradually decrease their frequency

  28. Properties of simulated annealing search • One can prove: If T decreases slowly enough, then simulated annealing search will find a global optimum with probability approaching 1 • Widely used in VLSI layout, airline scheduling, etc

  29. Local beam search • Keep track of k states rather than just one • Start with k randomly generated states • At each iteration, all the successors of all k states are generated • If any one is a goal state, stop; else select the k best successors from the complete list and repeat.

  30. Genetic algorithms • A successor state is generated by combining two parent states • Start with k randomly generated states (population) • A state is represented as a string over a finite alphabet (often a string of 0s and 1s) • Evaluation function (fitness function). Higher values for better states. • Produce the next generation of states by selection, crossover, and mutation

  31. Genetic algorithms • Fitness function: number of non-attacking pairs of queens (min = 0, max = 8 × 7/2 = 28) • 24/(24+23+20+11) = 31% • 23/(24+23+20+11) = 29% etc

  32. Genetic algorithms

More Related