24#ifndef __PBeFS_BranchAndBoundScheme
25 #define __PBeFS_BranchAndBoundScheme
86 inline constexpr std::array< std::string_view , 7 > bb_scheme_names = {
87 "sequential" ,
"shared" ,
"distributed" ,
"deterministic" ,
"selfsplit" ,
88 "stealing" ,
"multiqueue" };
95 return( detail::bb_scheme_names.at( std::size_t( s ) ) );
103 for( std::size_t i = 0 ; i < detail::bb_scheme_names.size() ; ++i )
104 if( detail::bb_scheme_names[ i ] == name )
106 throw( std::invalid_argument(
"bb_scheme: unknown scheme " +
107 std::string( name ) ) );
117template< BranchAndBound P , ADS::WorkerExecutor Executor = ADS::ThreadPool >
118[[nodiscard]] BBSolution< typename P::node_type , bb_value_t< P > >
122 std::optional< std::vector< BBLeaf<
124 seeds = std::nullopt )
126 const auto solve = [ & ](
const auto & b ) {
127 return( seeds ? b.solve( std::move( *seeds ) ) : b.solve() );
147 throw( std::invalid_argument(
"parallel_branch_and_bound: the scheme "
148 "multiqueue needs values atomic with no "
Header file for DeterministicBranchAndBound, the parallel Branch-and-Bound (B&B) by synchronous round...
Header file for MultiQueueBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers share the...
Header file for the parallel best-first searches with an incumbent, i.e., the parallel Branch-and-Bou...
Header file for SelfSplitBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers share noth...
Header file for StealingBranchAndBound, the parallel Branch-and-Bound (B&B) whose workers keep the ch...
the sequential best-first search with an incumbent
Definition BranchAndBound.h:875
the parallel B&B by synchronous rounds
Definition DeterministicBranchAndBound.h:119
the parallel B&B with a queue per worker and the children sent to their owners
Definition ParallelBranchAndBound.h:595
the parallel B&B on the MultiQueue of ADS
Definition MultiQueueBranchAndBound.h:127
the parallel B&B by a split of the tree after a sampling
Definition SelfSplitBranchAndBound.h:130
the parallel B&B with one queue shared by the workers
Definition ParallelBranchAndBound.h:348
the parallel B&B by work stealing
Definition StealingBranchAndBound.h:117
the values that the MultiQueue of ADS takes as keys: arithmetic, with a greatest value,...
Definition MultiQueueBranchAndBound.h:104
namespace for the Parallel Best-First Search library
Definition AStar.h:83
BBScheme bb_scheme(std::string_view name)
the scheme of the given name; throws std::invalid_argument if there is none
Definition BranchAndBoundScheme.h:102
typename detail::bb_value< P >::type bb_value_t
the type of the values of the B&B problem P: its value_type, or double
Definition BranchAndBound.h:293
BBScheme
the schemes of the B&B of the core
Definition BranchAndBoundScheme.h:70
@ selfsplit
a split of a sampling [see SelfSplitBranchAndBound]
Definition BranchAndBoundScheme.h:75
@ stealing
work stealing [see StealingBranchAndBound]
Definition BranchAndBoundScheme.h:76
@ multiqueue
a MultiQueue [see MultiQueueBranchAndBound]
Definition BranchAndBoundScheme.h:77
@ sequential
one worker [see BranchAndBoundSearch]
Definition BranchAndBoundScheme.h:71
@ distributed
a queue per worker [see DistributedBranchAndBound]
Definition BranchAndBoundScheme.h:73
@ shared
one shared queue [see SharedBranchAndBound]
Definition BranchAndBoundScheme.h:72
@ deterministic
synchronous rounds [see DeterministicBranchAndBound]
Definition BranchAndBoundScheme.h:74
BBSolution< typename P::node_type, bb_value_t< P > > parallel_branch_and_bound(const P &problem, BBScheme s, const BasicParallelBBOptions< bb_value_t< P > > &o={}, std::optional< std::vector< BBLeaf< typename P::node_type, bb_value_t< P > > > > seeds=std::nullopt)
the B&B of the problem by the scheme s on the given runtime, with the given options,...
Definition BranchAndBoundScheme.h:119
std::string_view bb_scheme_name(BBScheme s)
the name of the scheme s
Definition BranchAndBoundScheme.h:94
the options of the parallel B&B with values of type V
Definition ParallelBranchAndBound.h:135