5_SP10 cs188 lecture 3 -- a-star search (2PP)

5_SP10 cs188 lecture 3 -- a-star search (2PP) - s Unlike a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
5 Uniform Cost Search S a b d p a c e p h f r q q c G a q e p h f r q q c G a Expand cheapest node first: Fringe is a priority queue S G d b p q c e h a f r 3 9 1 16 4 11 5 7 13 8 10 11 17 11 0 6 3 9 1 1 2 8 8 2 15 1 2 Cost contours 2 Priority Queue Refresher pq.push(key, value) inserts (key, value) into the queue. pq.pop() returns the key with the lowest value, and removes it from the queue. s You can decrease a key’s priority by pushing it again
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s Unlike a regular queue, insertions arent constant time, usually O(log n ) s We need priority queues for cost-sensitive search methods s A priority queue is a data structure in which you can insert and retrieve (key, value) pairs with the following operations:...
View Full Document

Ask a homework question - tutors are online