When implementing a graph search algorithm, I needed a priority queue which allowed for priority changes. Until now, I’ve been using the (detail namespaced, so undocumented) boost d_ary_heap_indirect, but was just told it is undefined to have priorities increase (which I see now is also mentioned in the concept documentation).
So, I need to find a structure which allows both increase and decrease. I’ve already tried simply using a vector and push_heap/pop_heap/make_heap, but updates are too slow. What are the alternatives? I see boost has two classes in the pending (again, undocumented) directories, mutable_queue and relaxed_heap, but I can only find mention of them on five year old maillist threads. What are the differences between them, and do they allow both increases and decreases? Are there any implementations which are not pending acceptance?
The Boost.MultiIndex library features container that have operations to update the state of the object and will accordingly update the indexes.
In your case, the
modifymember function seems to fit. From the documentation: