|
PBeFS
Parallel Best-First Search
|
Header file for StealingBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers keep the children they generate in a queue of their own and take about half of the queue of another worker only when theirs is empty, i.e., by work stealing. More...
#include <atomic>#include <cstdint>#include <memory>#include <optional>#include <utility>#include <vector>#include "PBeFS/bnb/ParallelBranchAndBound.h"#include "ADS/concurrent/StealablePriorityQueue.h"Go to the source code of this file.
Classes | |
| class | StealingBranchAndBound< P, Executor > |
| the parallel B&B by work stealing More... | |
Namespaces | |
| namespace | PBeFS_di_unipi_it |
| namespace for the Parallel Best-First Search library | |
Header file for StealingBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers keep the children they generate in a queue of their own and take about half of the queue of another worker only when theirs is empty, i.e., by work stealing.
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 the following, with the notation of the page "Parallel branch-and-bound" of the documentation, the procedures of the sequential search [see BranchAndBound.h] and DIVE of the parallel ones [see ParallelBranchAndBound.h]; each worker \( i \) has a queue \( Q_i \) in the frontier of work stealing of ADS:
Lines 15 to 22 are the extraction of the frontier, whose test of the end at line 17 counts the workers that hold a node or work on one and the thieves that are trying a steal, and is therefore exact; the owner of a queue extracts from it with no lock, and a thief waits for the next operation of the victim, i.e., at most the evaluation of a node. A worker steals only when its own queue is empty (line 16), and therefore it stays in its own part of the tree; the selection is then best-first within each queue only.