Download presentation
Presentation is loading. Please wait.
1
Informed Search CSE 473 University of Washington
2
© Daniel S. Weld 2 Last Time Agents Problem Spaces Blind Search DFS BFS Iterative Deepening Iterative Broadening
3
© Daniel S. Weld 3 Best-first Search Generalization of breadth first search Priority queue of nodes to be explored Cost function f(n) applied to each node Add initial state to priority queue While queue not empty Node = head(queue) If goal?(node) then return node Add children of node to queue
4
© Daniel S. Weld 4 Old Friends Breadth first = best first With f(n) = depth(n) Dijkstra’s Algorithm = best first With f(n) = g(n) Where g(n) = sum of edge costs from start to n Space bound (stores all generated nodes)
5
© Daniel S. Weld 5 A* Search Hart, Nilsson & Rafael 1968 Best first search with f(n) = g(n) + h(n) Where g(n) = sum of edge costs from start to n And h(n) = estimate of lowest cost path n-->goal If h(n) is admissible then search will find optimal Underestimates cost of any solution which can reached from node { Space bound since must maintain queue
6
© Daniel S. Weld 6 European Example start end
7
© Daniel S. Weld 7 A* Example
8
© Daniel S. Weld 8 A* Example
9
© Daniel S. Weld 9 A* Example
10
© Daniel S. Weld 10 A* Example
11
© Daniel S. Weld 11 A* Example
12
© Daniel S. Weld 12 A* Example
13
© Daniel S. Weld 13 Optimality of A*
14
© Daniel S. Weld 14 Optimality Continued
15
© Daniel S. Weld 15 A* Summary Pros Cons
16
© Daniel S. Weld 16 Iterative-Deepening A* Like iterative-deepening depth-first, but... Depth bound modified to be an f-limit Start with limit = h(start) Prune any node if f(node) > f-limit Next f-limit=min-cost of any node pruned a b c d e f FL=15 FL=21
17
© Daniel S. Weld 17 IDA* Analysis Complete & Optimal (ala A*) Space usage depth of solution Each iteration is DFS - no priority queue! # nodes expanded relative to A* Depends on # unique values of heuristic function In 8 puzzle: few values close to # A* expands In traveling salesman: each f value is unique 1+2+…+n = O(n 2 ) where n=nodes A* expands if n is too big for main memory, n 2 is too long to wait! Generates duplicate nodes in cyclic graphs
18
© Daniel S. Weld 18 SMA* Problem with IDA*: f-limit 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 Keeps bounded-size priority queue When needs memory, drops node with highest f-cost In ancestor of forgotten nodes, retains cost of best path which has been dropped. This focuses regeneration. Duplicates minimal work Optimal in a number of nice ways
19
© Daniel S. Weld 19 Depth-First Branch & Bound Single DF search uses linear space Keep track of best solution so far If f(n) = g(n)+h(n) cost(best-soln) Then prune n Requires Finite search tree, or Good upper bound on solution cost Generates duplicate nodes in cyclic graphs Adapted from Richard Korf presentation
20
© Daniel S. Weld 20 No O(b^d) O(b + N) Beam Search Idea Best first but only keep N best items on priority queue Evaluation Complete? Time Complexity? Space Complexity?
21
© Daniel S. Weld 21 Hill Climbing Idea Always choose best child; no backtracking Beam search with |queue| = 1 Problems? Local maxima Plateaus Diagonal ridges “Gradient ascent”
22
© Daniel S. Weld 22 Randomizing Hill Climbing Randomly disobeying heuristic Random restarts [Add something on heavy tailed distribution]
23
© Daniel S. Weld 23 Simulated Annealing Objective: avoid local minima Technique: For the most part use hill climbing When no improvement possible Choose random neighbor Let be the decrease in quality Move to neighbor with probability e - -/T Reduce “temperature” (T) over time Pros & cons Optimal? temp If T decreased slowly enough, will reach optimal state Widely used See also WalkSAT
24
© Daniel S. Weld 24 Limited Discrepancy Search Discrepancy bound indicates how often to violate heuristic Iteratively increase... a b c d e f g h Assume that heuristic says go left
25
© Daniel S. Weld 25 174611094281174629844710 Genetic Algorithms Start with random population Representation serialized States are ranked with “fitness function” Produce new generation Select random pair(s): probability ~ fitness Randomly choose “crossover point” Offspring mix halves Randomly mutate bits 776511094281776529844710 164611094281 776029844210 Crossover Mutation
26
© Daniel S. Weld 26 Properties Importance of careful reprsentation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.