CPSC 322 Lecture Notes - Lecture 4: Priority Queue

244 views1 pages
School
Course
Professor

Document Summary

Search heuristic h(n) is an estimate of the cost of the shortest path from node n to goal node. A search heuristic is admissible if it is an underestimate of the cost from n to goal. Lowest-cost-first search: frontier is a priority queue ordered by cost(p) Best-first search: frontier is a priority queue ordered by h(p) A* search: frontier is a priority queue ordered by f(p) = cost(p) + h(p) For a* search, the frontier is a priority queue ordered by f(p) = cost(p) + h(p). However, using a heap to implement a priority queue may present sorting and comparison problems when there are two tuples with the same priority. In our case, this would be when two paths have the same value. We solve this problem by storing the path information as a triple (value, index, path) and usi(cid:374)g i(cid:374)dex to (cid:862)break ties(cid:863) (cid:449)he(cid:374) there are t(cid:449)o paths (cid:449)ith the sa(cid:373)e (cid:448)alue.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents