Chapter 5 Informedsearch
Chapter 5 Informedsearch
algorithms
Outline
Review limitations of uninformed search methods
Informed (or heuristic) search uses
problem-specific heuristics to improve
efficiency
Best-first, A* (and if needed for memory limits, RBFS, SMA*)
Techniques for generating heuristics
A* is optimal with admissible (tree)/consistent (graph)
heuristics
A* is quick and easy to code, and often works *very* well
Heuristics
A structured way to add “smarts” to your solution
Provide *significant* speed-ups in practice
Implementation:
Order the nodes in frontier by increasing estimated cost.
Provides problem-specific knowledge to the search
algorithm
Heuristic functions for 8-
puzzle
8-puzzle
Avg. solution cost is about 22 steps
branching factor ~ 3
Exhaustive search to depth 22:
3.1 x 1010 states.
A good heuristic function can reduce the search
process.
h1(S) = ?
h2(S) = ?
Admissible heuristics
E.g., for the 8-puzzle:
h1(n) = number of misplaced tiles
h2(n) = total Manhattan distance
(i.e., no. of squares from desired location of each tile)
h1(S) = ? 8
h2(S) = ? 3+1+2+2+2+3+3+2 = 18
Consistent heuristics
(consistent => admissible)
A heuristic is consistent if for every node n, every successor
n' of n generated by any action a,
If h is consistent, we have
B G
I D
15 24 C 25
24 20
Algorithm can tell you when best solution found within memory constraint is optimal or not.
Memory Bounded A*
Search
The Memory Bounded A* Search is the
best of the search algorithms we have
seen so far. It uses all its memory to
avoid double work and uses smart
heuristics to first descend into promising
branches of the search-tree.
If memory not a problem, then plain A*
search is easy to code and performs
well.
Heuristic functions
8-puzzle
Avg. solution cost is about 22 steps
branching factor ~ 3
Exhaustive search to depth 22:
3.1 x 1010 states.
A good heuristic function can reduce the search
process.
If the rules of the 8-puzzle are relaxed so that a tile can move
anywhere, then h1(n) gives the shortest solution
If the rules are relaxed so that a tile can move to any adjacent
square, then h2(n) gives the shortest solution