|
PBeFS
Parallel Best-First Search
|
Header file for the parallel best-first searches with an incumbent, i.e., the parallel Branch-and-Bound (B&B) on an executor of ADS (the pool of C++ threads, OpenMP or FastFlow): SharedBranchAndBound, whose workers extract the nodes from one queue as the workers of SPA* do, and DistributedBranchAndBound, whose workers have a queue each and send the children to their owners as the workers of HDA* do. More...
#include <atomic>#include <memory>#include <mutex>#include <random>#include <type_traits>#include "PBeFS/bnb/BranchAndBound.h"#include "ADS/parallel/Channels.h"#include "ADS/parallel/Mailbox.h"Go to the source code of this file.
Classes | |
| struct | BasicParallelBBOptions< V > |
| the options of the parallel B&B with values of type V More... | |
| class | BBIncumbent< Node, V > |
| the incumbent shared by the workers of a parallel B&B More... | |
| class | SharedBranchAndBound< P, Executor > |
| the parallel B&B with one queue shared by the workers More... | |
| class | DistributedBranchAndBound< P, Executor > |
| the parallel B&B with a queue per worker and the children sent to their owners More... | |
| struct | DistributedBranchAndBound< P, Executor >::Msg |
| a node travelling to its owner More... | |
Namespaces | |
| namespace | PBeFS_di_unipi_it |
| namespace for the Parallel Best-First Search library | |
Typedefs | |
| using | ParallelBBOptions = BasicParallelBBOptions<> |
| the options of the parallel B&B with values of type double | |
Header file for the parallel best-first searches with an incumbent, i.e., the parallel Branch-and-Bound (B&B) on an executor of ADS (the pool of C++ threads, OpenMP or FastFlow): SharedBranchAndBound, whose workers extract the nodes from one queue as the workers of SPA* do, and DistributedBranchAndBound, whose workers have a queue each and send the children to their owners as the workers of HDA* do.
The problem, the options and the Solution are those of BranchAndBound.h, and the design is discussed in docs/branch-and-bound.md.
The two searches are the following, with the notation of the page "Parallel branch-and-bound" of the documentation and the procedures PROCESS and PRUNABLE of the sequential search [see BranchAndBound.h]; the incumbent \( z \) is shared (BBIncumbent), DIVE(K) is the child of \( K \) that the worker goes on with (the last one with depth-first, the one of least bound with plunging if it is close enough to the least open bound, none otherwise), and \( p \) is the number of workers:
The counter busy of the shared search is raised under the lock when a node is extracted (line 26) and lowered only after the children of the node have been pushed (line 12), so that \( Q = \emptyset \) and busy \( = 0 \), read under the lock at line 19, mean that no node is open anywhere. The distributed search detects its end at line 39 by the mailbox of ADS, when no worker has a node and no node is travelling; since a tree has no duplicates, the owner of line 43 only balances the load.