Minotaur 0.4.1
Docs for developers
Bnb.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only half bull!
3//
4// (C)opyright 2009 - 2025 The Minotaur Team.
5//
6
13#ifndef BNB_H
14#define BNB_H
15
16#include "Types.h"
17#include "AMPLInterface.h"
18#include "BranchAndBound.h"
19#include "Brancher.h"
20#include "Presolver.h"
21#include "Problem.h"
22#include "Solver.h"
23
24namespace Minotaur {
29class Bnb : public Solver {
30public:
32 Bnb(EnvPtr env);
33
35 ~Bnb();
36
37 void doSetup();
38
40 void showHelp() const;
41
43 int showInfo();
44
46 virtual int solve(ProblemPtr p);
47
48 virtual std::string getAbout();
49
51 virtual SolveStatus getStatus();
52
54 virtual DoubleVector getSolution();
55
57 double getUb();
58
60 double getLb();
61
62private:
63 const static std::string me_;
64 double objSense_;
65 ProblemPtr oinst_;
66 SolveStatus status_;
67
68 BranchAndBound* getBab_(Engine *engine, HandlerVector &handlers);
69 BrancherPtr getBrancher_(HandlerVector handlers, Engine *e);
70 int getEngine_(Engine **e);
71 PresolverPtr presolve_(HandlerVector &handlers);
72 void writeBnbStatus_(BranchAndBound *bab);
73 void setInitialOptions_();
74};
75}
76#endif
77
78
Declare the AMPLInterface class fo reading problems from AMPL.
Declare the BranchAndBound class for branch-and-bound-algorithm, BabStats class for statistics and Ba...
Declare the base class Brancher for finding and creating branches in Branch-and-Bound.
Declare Presolver class for presolving.
Declare the base class Modification.
Define the abstract base class Solver.
Declare important 'types' used in Minotaur.
Definition: Bnb.h:29
int showInfo()
Display information.
Definition: Bnb.cpp:412
Bnb(EnvPtr env)
Default constructor.
Definition: Bnb.cpp:58
void showHelp() const
show help messages
Definition: Bnb.cpp:401
double getUb()
Return the upper bound for the optimal value.
virtual SolveStatus getStatus()
get status of the last solve.
Definition: Bnb.cpp:332
~Bnb()
Destroy.
Definition: Bnb.cpp:66
virtual DoubleVector getSolution()
get solution of the last solve.
Definition: Bnb.cpp:326
virtual int solve(ProblemPtr p)
Solve the problem.
Definition: Bnb.cpp:451
double getLb()
Return the lower bound for the optimal value.
Implement a generic branch-and-bound algorithm on a single cpu.
Definition: BranchAndBound.h:38
A brancher is used to find suitable branches for a given node. e.g. LexicoBrancher....
Definition: Brancher.h:33
Definition: Engine.h:34
Definition: Environment.h:28
Definition: Presolver.h:39
Definition: Problem.h:74
Definition: Solver.h:28
Definition: ActiveNodeStore.h:20
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158

Minotaur source code documented by Doxygen 1.9.4 on Fri Apr 25 2025