|
| | PriorityFrontier (Q &q, int n) |
| | \( S \) on the queue \( q \), empty, for the nodes \( [ 0 , n ) \)
|
| template<class D> |
| void | add (int v, const D &d, bool) |
| | \( v \) into \( S \) at the distance \( d \)
|
| int | extract (void) |
| | a node out of \( S \); the stale copies of a lazy queue skipped
|
| template<class D> |
| void | update (int v, const D &d) |
| | the priority of \( v \), already in \( S \), falls to \( d \)
|
| bool | empty (void) const |
| | whether \( S \) is empty; a lazy queue may still hold stale copies
|
template<FrontierQueue Q>
class ADS::PriorityFrontier< Q >
a priority queue of the nodes [see PriorityQueue.h] as \( S \): the priority of a node its distance or, if the priority is a pair, the pair ( distance , node ), which breaks the ties by the names of the nodes, so that any priority queue extracts the same nodes in the same order.
A queue without a Priority (std::priority_queue, Boost.Heap) holds the pairs ( distance , node ) themselves, which must then be its items, in the order that puts the least pair on top (std::greater). The fall of a distance is queue_decrease() on the handle of the node if the queue lowers its keys natively, a new insertion of the node otherwise (decrease_key_of() of Capabilities.h): the copy of least priority of a node is then the one of its distance, which comes out first, and the others, which come out after it, are skipped. The queue is reached only by the customization points of PriorityQueue.h, so that a queue of another library needs no wrapper