AI Lec5 ClassNotes
AI Lec5 ClassNotes
AI Lec5 ClassNotes
Uniformed-cost Search
Breadth-First Search find the shallowest goal state, but this may not
always be the least-cost solution.
•Uniform-Cost Search modifies the Breadth-First Search strategy by
always expanding the lowest path cost g(n) node on the fringe.
AI-Lec5 Page 1
always expanding the lowest path cost g(n) node on the fringe.
•Frontier is a priority queue, i.e., new successors are merged into the
queue sorted by g(n).
•Can remove successors already on queue w/higher g(n).
•Saves memory, costs time; another space-time trade-off.
Performance:
Complete? Does it always find a solution if one exists?
•Yes (If b is finite and If step costs ≥ small +ve constant epsilon
•Optimal? Does it always find a least-cost solution? Yes, if step cost ≥
small +ve constant epsilon
•Time Complexity: O(b^ceiling(C*/epsilon) ) ~ O(bC*) where C*is the cost
of the optimal solution
•Space Complexity: O(b^ceiling(C*/epsilon) ) ~ O(bC*)where C∗is the cost
of the optimal solution
Performance
• Complete? No: fails in infinite-depth spaces, spaces with loops. Modify to
avoid repeated states along path. Complete in finite spaces
• Time? O(b^m): terrible if mis much larger than d but if solutions are
dense, may be much faster than breadth-first
• Space? O(bm), i.e., linear space!
• Optimal? No
AI-Lec5 Page 3
AI-Lec5 Page 4
AI-Lec5 Page 5