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 SolutionPtr getSol();
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 SolutionPtr sol_;
68
69 BranchAndBound* getBab_(Engine *engine, HandlerVector &handlers);
70 BrancherPtr getBrancher_(HandlerVector handlers, Engine *e);
71 int getEngine_(Engine **e);
72 PresolverPtr presolve_(HandlerVector &handlers);
73 void writeBnbStatus_(BranchAndBound *bab);
74 void setInitialOptions_();
75};
76}
77#endif
78
79
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:417
Bnb(EnvPtr env)
Default constructor.
Definition: Bnb.cpp:58
void showHelp() const
show help messages
Definition: Bnb.cpp:406
double getUb()
Return the upper bound for the optimal value.
virtual SolveStatus getStatus()
get status of the last solve.
Definition: Bnb.cpp:337
virtual SolutionPtr getSol()
get solution of the last solve.
Definition: Bnb.cpp:332
~Bnb()
Destroy.
Definition: Bnb.cpp:67
virtual int solve(ProblemPtr p)
Solve the problem.
Definition: Bnb.cpp:456
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: Solution.h:30
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 Sun Jul 13 2025