|
PBeFS
Parallel Best-First Search
|
Header file for MultiQueueBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers share the open nodes in the MultiQueue of ADS, a relaxed priority queue of \( 2 p \) sequential queues each under its own lock, as the workers of MQAStar do. More...
#include <algorithm>#include <atomic>#include <cstdint>#include <iterator>#include <limits>#include <memory>#include <optional>#include <utility>#include <vector>#include "PBeFS/bnb/ParallelBranchAndBound.h"#include "ADS/concurrent/MultiQueue.h"Go to the source code of this file.
Classes | |
| class | MultiQueueBranchAndBound< P, Executor > |
| the parallel B&B on the MultiQueue of ADS More... | |
Namespaces | |
| namespace | PBeFS_di_unipi_it |
| namespace for the Parallel Best-First Search library | |
Concepts | |
| concept | PBeFS_di_unipi_it::MultiQueueValue |
| the values that the MultiQueue of ADS takes as keys: arithmetic, with a greatest value, and atomic with no lock | |
Header file for MultiQueueBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers share the open nodes in the MultiQueue of ADS, a relaxed priority queue of \( 2 p \) sequential queues each under its own lock, as the workers of MQAStar do.
The problem, the options and the Solution are those of BranchAndBound.h and ParallelBranchAndBound.h, and the design is discussed in docs/branch-and-bound.md.
The search is that of SharedBranchAndBound [see ParallelBranchAndBound.h] but for the queue and the test of the end: a pop takes the better of the first nodes of two queues drawn at random, and therefore not always the first of all, and the counter \( m \) of the nodes that are in the queue or held by a worker, which is atomic, takes the place of busy and of the lock \( L \):
The test at line 10 is exact: at line 16, \( m \) counts the children and drops the node processed in one atomic step, before the pushes (the child that dives is held by the worker, and counted as such), so that \( m = 0 \) means that \( Q \) is empty and that no worker holds a node, whatever the order of the pops. Since the first node of \( Q \) is not known, a node is pruned when popped (line 12) rather than with all the others, and DIVE compares the children with the bound of the node processed instead of the least bound of \( Q \). The children of a node go into one queue under one lock, as by a stickiness of their number.