13#ifndef MINOTAURPARBRANCHANDBOUND_H
14#define MINOTAURPARBRANCHANDBOUND_H
26 class ParNodeIncRelaxer;
27 class ParPCBProcessor;
34 typedef Engine* EnginePtr;
35 typedef ParBabOptions* ParBabOptionsPtr;
36 typedef NodeProcessor* NodeProcessorPtr;
37 typedef NodeRelaxer* NodeRelaxerPtr;
38 typedef ParNodeIncRelaxer* ParNodeIncRelaxerPtr;
39 typedef ParPCBProcessor* ParPCBProcessorPtr;
40 typedef Solution* SolutionPtr;
41 typedef SolutionPool* SolutionPoolPtr;
42 typedef ParTreeManager* ParTreeManagerPtr;
43 typedef WarmStart* WarmStartPtr;
60 void printsomething();
126 std::vector<std::vector<double> >serVec,
127 std::vector<std::vector<double> >parVec);
203 void print2dvec(std::vector<std::vector<int> > output);
206 void print2dvec(std::vector<std::vector<double> > output);
234 if (gettimeofday(&time,NULL)) {
238 return (
double)time.tv_sec + (double)time.tv_usec * .000001;
249 static const std::string me_;
264 HeurVector preHeurs_;
299 NodePtr processRoot_(
bool *should_prune,
bool *should_dive);
310 void processRoot_(
bool *should_prune,
bool *should_dive,
317 bool shouldPrune_(
NodePtr node);
332 bool shouldStopPar_(
double wallStartTime,
double treeLb);
341 void showStatus_(
bool current_uncounted);
354 void showParStatus_(
UInt current_uncounted,
double treeLb,
355 double wallStartTime,
UInt threadId);
Declare important 'types' used in Minotaur.
Definition: Environment.h:28
Definition: Heuristic.h:30
Definition: NodeProcessor.h:49
Definition: NodeRelaxer.h:42
Implement a generic parallel branch-and-bound algorithm on a multicore cpu.
Definition: ParBranchAndBound.h:48
void writeStats()
Write statistics to the logger.
int strToInt(std::string str)
Convert a string to integer data type.
Definition: ParBranchAndBound.cpp:561
void setNodeProcessor(NodeProcessorPtr p)
Set the NodeProcessor that processes each node.
Definition: ParBranchAndBound.cpp:363
virtual ~ParBranchAndBound()
Destroy.
Definition: ParBranchAndBound.cpp:83
double totalTime()
Return total time taken.
Definition: ParBranchAndBound.cpp:1903
ParTreeManagerPtr getTreeManager()
Return a pointer to the tree manager. The client can then directly query the ParTreeManager for its s...
Definition: ParBranchAndBound.cpp:149
void parsolve(ParNodeIncRelaxerPtr parNodeRelaxer[], ParPCBProcessorPtr parPCBProcessor[], UInt nThreads)
Start solving the Problem using branch-and-bound.
Definition: ParBranchAndBound.cpp:1012
void parsolveSync(ParNodeIncRelaxerPtr parNodeRelaxer[], ParPCBProcessorPtr parPCBProcessor[], UInt nThreads)
Branch-and-bound solver with reproducibility of results.
Definition: ParBranchAndBound.cpp:1493
std::vector< std::vector< double > > readSerialOutput(const char *inputFile)
Read output of branch-and-bound tree generated by a single thread.
Definition: ParBranchAndBound.cpp:336
void setLogLevel(LogLevel level)
Set log level.
Definition: ParBranchAndBound.cpp:357
void writeParStats(std::ostream &out, ParPCBProcessorPtr parPCBProcessor[])
Write statistics of parallel algorithm to the ostream out.
Definition: ParBranchAndBound.cpp:1888
double getWallTime()
Get wall clock time.
Definition: ParBranchAndBound.h:232
NodeRelaxerPtr getNodeRelaxer()
Return a pointer to NodeRelaxer used in branch-and-bound.
Definition: ParBranchAndBound.cpp:131
NodeProcessorPtr getNodeProcessor()
Return a pointer to NodeProcessor used in branch-and-bound.
Definition: ParBranchAndBound.cpp:125
SolveStatus getStatus()
Return the final status.
Definition: ParBranchAndBound.cpp:143
double getPerGap()
Return the percentage gap between the lower and upper bounds.
Definition: ParBranchAndBound.cpp:113
void print2dvec(std::vector< std::vector< int > > output)
Print a two-dimensional vector (customized).
Definition: ParBranchAndBound.cpp:251
void solve()
Start solving the Problem using branch-and-bound.
UInt numProcNodes()
Return number of nodes processed while solving.
Definition: ParBranchAndBound.cpp:229
void setNodeRelaxer(NodeRelaxerPtr nr)
Set the NodeRelaxer for setting-up relaxations at each node.
Definition: ParBranchAndBound.cpp:369
void parsolveOppor(ParNodeIncRelaxerPtr parNodeRelaxer[], ParPCBProcessorPtr parPCBProcessor[], UInt nThreads)
Start solving the Problem using parallel branch-and-bound in an opportunistic mode.
Definition: ParBranchAndBound.cpp:587
void shouldCreateRoot(bool b)
Switch to turn on/off root-node creation.
Definition: ParBranchAndBound.cpp:375
std::vector< std::vector< double > > mapSerialOutput(std::vector< std::vector< double > >serVec, std::vector< std::vector< double > >parVec)
Map nodes generated in serial and parallel branch-and-bound tree.
Definition: ParBranchAndBound.cpp:161
double getUb()
Return the upper bound for the solution value from the search tree.
Definition: ParBranchAndBound.cpp:155
double getLb()
Return the lower bound from the search tree.
Definition: ParBranchAndBound.cpp:119
void addPreRootHeur(HeurPtr h)
Add a heuristic that will be called before root node.
Definition: ParBranchAndBound.cpp:107
ParBranchAndBound()
Default constructor.
Definition: ParBranchAndBound.cpp:52
Definition: ParNodeIncRelaxer.h:32
Default node processor used in solver for now.
Definition: ParPCBProcessor.h:47
Base class for managing the branch-and-bound tree.
Definition: ParTreeManager.h:29
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: WarmStart.h:45
Definition: ActiveNodeStore.h:20
LogLevel
Levels of verbosity.
Definition: Types.h:226
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158
Different options and parameters that control branch-and-bound.
Definition: ParBranchAndBound.h:377
UInt solLimit
Limit on number of nodes processed.
Definition: ParBranchAndBound.h:403
double logInterval
Time in seconds between status updates of the progress.
Definition: ParBranchAndBound.h:391
UInt nodeLimit
Limit on number of nodes processed.
Definition: ParBranchAndBound.h:394
double timeLimit
Time limit in seconds for the branch-and-bound.
Definition: ParBranchAndBound.h:406
ParBabOptions()
Default constructor.
Definition: ParBranchAndBound.cpp:1922
bool createRoot
Should the root be created in branch-and-bound (yes), or the user calls branch-and-bound after creati...
Definition: ParBranchAndBound.h:388
double perGapLimit
Stop if the percent gap between lower and upper bounds of the objective function falls below this lev...
Definition: ParBranchAndBound.h:400
Statistics about the branch-and-bound.
Definition: ParBranchAndBound.h:360
UInt nodesProc
Number of nodes processed.
Definition: ParBranchAndBound.h:365
ParBabStats()
Constructor. All data is initialized to zero.
Definition: ParBranchAndBound.cpp:1912
double updateTime
Time of the last log display.
Definition: ParBranchAndBound.h:371
double timeUsed
Total time used in branch-and-bound.
Definition: ParBranchAndBound.h:368