Intro To AI
Intro To AI
Heuristic Search
Method for AI to reach goal from current state
Search Problem:
Uninformed Search
Explore blindly one of the next state
BFS
Guaranteed to find the shallowest path (not global optimal)
Time and space complexity: O(b ), where b is branching factor and d is depth
d
Pseudo-code:
DFS
More efficient than BFS with multiple paths to a solution (not global optimal)
Space complexity: O(bd)
Pseudo-code:
BFS-Optimal
Consider cost from the start; use priority queue instead of queue
Reorder the queue in ascending order (smallest cost in the front)
Step Priority Queue Deque Add
Informed Search
Use estimated cost to goal to decide which state to explore
Estimate the cost to goal through some heuristic
Admissible Heuristic
Heuristic value of a state is ≤ minimum cost to reach the goal from the current state
A* Search
Provides global optimal given that heuristic is consistent
Let g(n) and h(n) be cost-so-far and cost-to-goal respectively
f (n) = g(n) + h(n)
′ ′ ′ ′ ′
h(n ) = g(n ) + h(n ) = g(n) + c(n, n ) + h(n )
If n is in the open list or closed list, compare the f (n ) with the old f (n ). Replace the old node if the cost is lower and reopen the node.
′ ′ ′
Consistent Heuristic
For every node n and its successor n',
′ ′
h(n) ≤ c(n, n ) + h(n )