Download presentation
Presentation is loading. Please wait.
1
Heuristic Search Henry Kautz
2
Problem: Large Graphs It is expensive to find optimal paths in large graphs, using BFS, IDS, or Uniform Cost Search (Dijkstra’s Algorithm) How can we search large graphs efficiently by using “commonsense” about which direction looks most promising?
3
Plan a route from 9th & 50th to 3rd & 51st
Example 53nd St 52nd St G 51st St S 50th St 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave Plan a route from 9th & 50th to 3rd & 51st
4
Plan a route from 9th & 50th to 3rd & 51st
Example 53nd St 52nd St G 51st St S 50th St 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave Plan a route from 9th & 50th to 3rd & 51st
5
Best-First Search The Manhattan distance ( x+ y) is an estimate of the distance to the goal It is a search heuristic Best-First Search Order nodes in priority to minimize estimated distance to the goal Compare: Uniform-Cost / Dijkstra’s Order nodes in priority to minimize distance from the start
6
Best-First Search Fringe: Priority queue (heap)
Key: h(n) – heuristic estimate of distance from n to goal
7
Obstacles Best-FS eventually will expand vertex to get back on the right track S G 52nd St 51st St 50th St 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave
8
Non-Optimality of Best-First
Path found by Best-first = 10 53nd St 2 3 52nd St 1 2 S G 5 4 3 2 51st St 1 50th St 5 4 3 2 1 7 6 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave Shortest Path = 8
9
Improving Best-First Best-first is often tremendously faster than UCS, but might stop with a non-optimal solution How can it be modified to be (almost) as fast, but guaranteed to find optimal solutions? A* - Hart, Nilsson, Raphael 1968 One of the first significant algorithms developed in AI Widely used in many applications
11
h values S G 2 3 1 2 5 4 3 2 1 5 4 3 2 1 7 6 53nd St 52nd St 51st St
50th St 5 4 3 2 1 7 6 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave
12
g values S G 8 7 9 6 1 2 3 4 5 3 4 5 6 7 1 2 53nd St 52nd St 51st St
50th St 3 4 5 6 7 1 2 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave
13
f = g + h 53nd St 10 10 52nd St 10 8 S G 6 6 6 6 51st St 6 50th St 8 8 8 8 8 8 8 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave
14
Maze Runner Demo
21
A* Graph Search Optimal if h is consistent as well as admissible
22
A* Graph Search for Any Admissible Heuristic
if State[node] is not in closed OR g[node] < g[LookUp(State[node],closed)] then
26
Properties of Heuristics
Let h1 and h2 be admissible heuristics if for all s, h1(s) h2(s), then h1 dominates h2 h1 is better than h2 h3(s) = max(h1(s), h2(s)) is admissible h3 dominates h1 and h2
27
Exercise: Rubik’s Cube
State: position and orientation of each cubie Corner cubie: 8 positions, 3 orientations Edge cubie: 8 positions, 2 orientations Center cubie: 1 position – fixed Move: Turn one face Center cubits never move! Devise an admissible heuristic
28
Next Heuristic functions for STRIPS planning Games
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.