|
ADS
Algorithms and Data Structures
|
A priority queue of the integers \( [ 0 , n ) \) by a key of selection that also knows the least of a second key, the bound, among the ids it holds, beyond the book: two heaps of IndexedDaryHeap [see IndexedDaryHeap.h] on the same ids, one by the keys and one by the bounds, so that top() is the id of least key and minBound() the least bound in \( O( 1 ) \), and every change, pop() included, is made on both heaps by the places of the id, in \( O( D \log_D s ) \). More...
#include "ADS/Contract.h"#include "ADS/priority/IndexedDaryHeap.h"#include <cstddef>#include "ADS/priority/impl/IndexedHeapPair.tpp"Go to the source code of this file.
Classes | |
| class | ADS::IndexedHeapPair< K, Bd, D > |
| the ids \( [ 0 , n ) \) by a key, the least on top, with the least of their bounds More... | |
Namespaces | |
| namespace | ADS |
A priority queue of the integers \( [ 0 , n ) \) by a key of selection that also knows the least of a second key, the bound, among the ids it holds, beyond the book: two heaps of IndexedDaryHeap [see IndexedDaryHeap.h] on the same ids, one by the keys and one by the bounds, so that top() is the id of least key and minBound() the least bound in \( O( 1 ) \), and every change, pop() included, is made on both heaps by the places of the id, in \( O( D \log_D s ) \).
It is the frontier of the searches that choose a node by one value and must know the least of another one over the whole frontier: the bounded suboptimal searches, which expand by a key of their own (the distance to the goal, or an inflated cost) and need the least lower bound \( f_{\mathrm{min}} \) to stop or to certify a factor of suboptimality (the focal search of Pearl and Kim, the explicit estimation search of Thayer and Ruml), and the branch and bound by best estimate, which selects by the estimate of a node and prunes and stops by the least bound of the open nodes.
The alternative is a heap by the bounds with lazy deletion, in which the ids popped by the key stay until they reach its top: it saves the second walk of pop(), but minBound() must skip the stale ones and an id pushed again needs a stamp to tell its copies apart, while here the bound of an id is always the one it has, and erase() and update() take an id out or change it anywhere in both orders (see Heaps).
The contracts [see Contract.h]: the ids are in \( [ 0 , n ) \), push() needs an id not in the queue, update(), erase(), key() and bound() one in it, top(), topKey(), minBound(), minBoundId() and pop() a queue that is not empty; the invariant is that of the two heaps, with the same ids in both. The operations are defined in IndexedHeapPair.tpp.