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 <>
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:
Date User Action Args
2010-01-18 22:07:47jabsetrecipients: + jab, georg.brandl, rhettinger
2010-01-18 22:07:47jabsetmessageid: <>
2010-01-18 22:07:45jablinkissue7734 messages
2010-01-18 22:07:44jabcreate