PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
DistributedBranchAndBound< P, Executor > Class Template Reference

the parallel B&B with a queue per worker and the children sent to their owners More...

#include <PBeFS/bnb/ParallelBranchAndBound.h>

Classes

struct  Msg
 a node travelling to its owner More...

Public Types

using Node = typename P::node_type
 the node type
using Value = bb_value_t< P >
 the value type
using Options = BasicParallelBBOptions< Value >
 the options
using Leaf = BBLeaf< Node , Value >
 the leaf type
using SolutionT = BBSolution< Node , Value >
 the solution type

Public Member Functions

 DistributedBranchAndBound (const P &problem, const Options &options={})
 constructor, taking the problem (which must outlive the search)
void set_executor (Executor &ex) noexcept
 sets the Executor that runs the workers, which must outlive the searches; without it, each search builds one of as many threads as there are workers
SolutionT solve (void) const
 searches the tree from the root, returning the Solution
SolutionT solve (std::vector< Leaf > seeds) const
 searches the subtrees of the given nodes, returning the Solution [see BranchAndBoundSearch::solve()]; each node goes to its owner, which is the worker \( i \bmod p \) for the node \( i \) if the problem gives no hash( n )

Detailed Description

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
class PBeFS_di_unipi_it::DistributedBranchAndBound< P, Executor >

the parallel B&B with a queue per worker and the children sent to their owners

Each worker extracts the nodes from its own queue, and sends each child, in batches, to the worker that owns it: \( \mathrm{hash}( n ) \bmod p \) if the problem gives hash( n ), a random worker otherwise (with depth-first or plunging, the child that dives is kept). Since a tree has no duplicates, the owners only balance the load. The incumbent is shared, and the termination is detected as in HDAStar, by the mailbox of ADS.

Member Typedef Documentation

◆ Leaf

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
using Leaf = BBLeaf< Node , Value >

the leaf type

◆ Node

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
using Node = typename P::node_type

the node type

◆ Options

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
using Options = BasicParallelBBOptions< Value >

the options

◆ SolutionT

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
using SolutionT = BBSolution< Node , Value >

the solution type

◆ Value

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
using Value = bb_value_t< P >

the value type

Constructor & Destructor Documentation

◆ DistributedBranchAndBound()

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
DistributedBranchAndBound ( const P & problem,
const Options & options = {} )
inlineexplicit

constructor, taking the problem (which must outlive the search)

Member Function Documentation

◆ set_executor()

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
void set_executor ( Executor & ex)
inlinenoexcept

sets the Executor that runs the workers, which must outlive the searches; without it, each search builds one of as many threads as there are workers

◆ solve() [1/2]

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
SolutionT solve ( std::vector< Leaf > seeds) const
inlinenodiscard

searches the subtrees of the given nodes, returning the Solution [see BranchAndBoundSearch::solve()]; each node goes to its owner, which is the worker \( i \bmod p \) for the node \( i \) if the problem gives no hash( n )

◆ solve() [2/2]

template<BranchAndBound P, ADS::WorkerExecutor Executor = ADS::ThreadPool>
SolutionT solve ( void ) const
inlinenodiscard

searches the tree from the root, returning the Solution


The documentation for this class was generated from the following file: