Informed Search: CS 4804 Fall 2020
Informed Search: CS 4804 Fall 2020
Informed Search: CS 4804 Fall 2020
• Demo G
Recap: Uninformed Search Algorithms
1. Is Depth-first graph search guaranteed to
return an optimal solution?
2. Is Breadth-first graph search guaranteed to
return an optimal solution?
3. Is Uniform-cost graph search guaranteed to
return an optimal solution?
4. Is Iterative Deepening graph search
guaranteed to return an optimal solution?
Informed Search
• Uniformed search: can be both complete and
optimal, but can be very slow
• Informed search:
– Uses domain-specific hints
– More focus
– Can find solutions more efficiently
– Heuristic function: h(n)
Heuristics
• Heuristic is a problem-solving technique that finds a
satisfactory(good-enough) solution given a limited time frame
• The heuristic function is a way to inform the search about
the direction to a goal
• Heuristic function h(n):
– Estimated cost of the cheapest path from the state at node n to a
goal state
• Designed for a particular search problem
• Examples: Euclidean distance
– Manhattan distance: |x1 −x2|+|y1 −y2|
B
– Euclidean distance:
A
HSLD: Straight-line distance
HSLD(n)
Greedy best-first Search
• From city A (Arad) to city B (Bucharest)
• Strategy: Expand a node with the lowest h(n) value
A->S->F->B = 450
Greedy Best-first Search
• Operates like UCS (Uniform Cost Search) with a
priority queue
– Difference: use estimated forward cost, not computed
backward cost
• Not optimal
• May not find the best solution
• May not find the solution (if use a very bad h(n))
• Worse-case: Just like a badly-guided DFS and
exploring all the wrong areas
A* Search
• Combing UCS and Greedy
• f(n) = g(n) + h(n): lowest estimated cost of the path
from n to G
• g(n) is the path cost from the initial state to node n
• Uses a priority queue
• A* combines the total backward cost and estimated
forward cost (heuristic value)
• Effectively yielding an estimated total cost from start to
goal
140
140
80
140
99
140
80
• h(B) is consistent B
– h(A)<= c(A, a,B) + h(B) 2 1
– h(B)<= c(B, a, A) + h(A)
A C
– h(C)<= c(C, a, B) + h(B)
– h(B)<= c(B, a, C) + h(C)
– h(A) = 7, h(B) = 5, h(C) = 5
Search Contours
• Demo
• Pruning: eliminating possibilities from consideration
without having to examine them
Inadmissible Heuristics and Weighted A*
• Weighted A* search:
– f(n) = g(n) + W x h(n), W>1
– With slightly more costs, but could search faster
– Optimal path may not be found
• Cost of Weighted A* search: between C* and W x C*
A* search g(n) + h(n) W=1
UCS search g(n) W=0
Greedy search h(n) W=∞
Weighted A* search g(n) + W x h(n) W>1
Heuristic Functions
• Start States: any tile can be
designated as the start state
• Actions: Blank space moving
• Action cost: 1
• h1: # of misplaced tiles
• h2: sum of the distances of the
tiles from their goal positions
Heuristic Quality
• Effective branching factor b*
N + 1 = 1+ b* + (b*)2 + ... + (b*)d
• Dominance: h2(n) >= h1(n)
Memory-bounded Search