Search With C Sts and Heuristic Search
Search With C Sts and Heuristic Search
Todays Lecture
Recap from last lecture, combined with AIspace demo Search with costs: Least Cost First Search
O(bm)
O(bm)
O(mb)
O(mb)
O(bm) O(bm)
O(b+m)
O(b+m)
6
Todays Lecture
Recap from last lecture, combined with AIspace demo Search with costs: Least Cost First Search
Def.: A search algorithm is optimal if when it finds a solution, it is the best one
Def.: A search algorithm is optimal if when it finds a solution, it is the best one: it has the lowest path cost
10
The frontier is implemented as a priority queue ordered by path cost. Lets look at this in action:
11
DFS
BFS IDS None of the above
12
- Not in general: arc costs could be negative: a path that initially looks
high-cost could end up getting a ``refund''. - Yes, as long as arc costs are guaranteed to be non-negative.
13
O(bm)
O(mb)
O(bm)
O(b+m)
O(bm)
O(mb)
O(bm)
O(b+m)
E.g. uniform cost: just like BFS, in worst case frontier has to store all nodes m-1 steps from the start node
14
In other words, they are general and do not take into account the specific nature of the problem.
15
Todays Lecture
Recap from last lecture, combined with AIspace demo Search with costs: Least Cost First Search
16
Heuristic Search
Blind search algorithms do not take into account the goal until they are at a goal node.
Often there is extra knowledge that can be used to guide the search:
an estimate of the distance from node n to a goal node.
17
More formally
Def.: A search heuristic h(n) is an estimate of the cost of the optimal (cheapest) path from node n to a goal node.
Estimate: h(n1) n1
n2
n3
Estimate: h(n2)
Estimate: h(n3)
18
19
20
21
A low heuristic value can mean that a cycle gets followed forever -> not complete
22
Analysis of BestFS
Complete? No, see the example last slide
O(mb)
O(bm)
O(b+m)
O(mb)
O(bm)
O(b+m)
- Heuristic could be such to emulate BFS: E.g. h(n) = (m distance of n from start)
23
24