Author jab
Recipients georg.brandl, jab, rhettinger
Date 2010-01-18.22:07:44
SpamBayes Score 2.70887e-08
Marked as misclassified No
Message-id <1263852467.57.0.690062730163.issue7734@psf.upfronthosting.co.za>
In-reply-to
Content
Though the heapq module does not support changing the priority of a particular element of the heap (a necessary operation for the A* search family of algorithms), such an element can be marked as invalid and a new element can be added with different priority. Any element marked as invalid that makes it to the top of the heap can simply be popped off and ignored.

Users who haven't seen this trick before might mistakenly think the heapq module does not provide sufficient operations to implement A* search.

Please see the recent thread on comp.lang.python for more background:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/8adc3ce8d2219647
History
Date User Action Args
2010-01-18 22:07:47jabsetrecipients: + jab, georg.brandl, rhettinger
2010-01-18 22:07:47jabsetmessageid: <1263852467.57.0.690062730163.issue7734@psf.upfronthosting.co.za>
2010-01-18 22:07:45jablinkissue7734 messages
2010-01-18 22:07:44jabcreate