Minotaur 0.4.1
Docs for developers
BndProcessor.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2009 - 2025 The Minotaur Team.
5//
6
13#ifndef MINOTAURBNDPROCESSOR_H
14#define MINOTAURBNDPROCESSOR_H
15
16#include "NodeProcessor.h"
17#include "Types.h"
18
19namespace Minotaur {
20
21 class Engine;
22 class Problem;
23 class Solution;
24 typedef Engine* EnginePtr;
25 typedef const Solution* ConstSolutionPtr;
26
27 struct BPStats {
28 UInt bra;
34 };
35
43 class BndProcessor : public NodeProcessor {
44
45 public:
48
50 BndProcessor(EnvPtr env, EnginePtr engine, HandlerVector handlers_);
51
54
55 // True if a new solution was found while processing this node.
56 bool foundNewSolution();
57
58 // Find branches that will be used to branch at this node.
59 Branches getBranches();
60
61 // Get warm-start information.
63
64 // Implement NodeProcessor::process().
65 void process(NodePtr node, RelaxationPtr rel,
66 SolutionPoolPtr s_pool);
67
68 // write statistics. Base class method.
69 void writeStats(std::ostream &out) const;
70
71 // write statistics. Base class method.
72 void writeStats() const;
73
74 protected:
75
77 Branches branches_;
78
84
86 double cutOff_;
87
90
93
95 HandlerVector handlers_;
96
99
101 static const std::string me_;
102
105
107 double oATol_;
108
110 double oRTol_;
111
114
117
120
127 virtual bool isFeasible_(NodePtr node, ConstSolutionPtr sol,
128 SolutionPoolPtr s_pool, bool &should_prune);
129
131 virtual void solveRelaxation_();
132
137 virtual bool shouldPrune_(NodePtr node, double solval,
138 SolutionPoolPtr s_pool);
139
140 };
141
143
144}
145#endif
146
Define the NodeProcessor class for processing nodes in the branch-and-bound algorithm.
Declare important 'types' used in Minotaur.
Simple node-processor for branch-and-bound.
Definition: BndProcessor.h:43
static const std::string me_
For logging.
Definition: BndProcessor.h:101
RelaxationPtr relaxation_
Relaxation that is processed by this processor.
Definition: BndProcessor.h:113
WarmStartPtr ws_
Warm-start information for start processing the children.
Definition: BndProcessor.h:119
LoggerPtr logger_
Log.
Definition: BndProcessor.h:98
~BndProcessor()
Destroy.
Definition: BndProcessor.cpp:80
void writeStats() const
Write statistics to our own logger.
Definition: BndProcessor.cpp:439
double cutOff_
If lb is greater than cutOff_, we can prune this node.
Definition: BndProcessor.h:86
HandlerVector handlers_
All the handlers that are used for this processor.
Definition: BndProcessor.h:95
bool contOnErr_
Definition: BndProcessor.h:83
virtual void solveRelaxation_()
Solve the relaxation.
Definition: BndProcessor.cpp:414
virtual bool shouldPrune_(NodePtr node, double solval, SolutionPoolPtr s_pool)
Definition: BndProcessor.cpp:288
virtual bool isFeasible_(NodePtr node, ConstSolutionPtr sol, SolutionPoolPtr s_pool, bool &should_prune)
Definition: BndProcessor.cpp:117
Branches branches_
Branches found by this processor for this node.
Definition: BndProcessor.h:77
BndProcessor()
Default constructor.
Definition: BndProcessor.cpp:34
EnginePtr engine_
Engine used to process the relaxation.
Definition: BndProcessor.h:89
void process(NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
Definition: BndProcessor.cpp:144
double oRTol_
Relative tolerance for pruning a node on basis of bounds.
Definition: BndProcessor.h:110
BPStats stats_
Statistics.
Definition: BndProcessor.h:116
Branches getBranches()
Find branches that will be used to branch at this node.
Definition: BndProcessor.cpp:104
WarmStartPtr getWarmStart()
Definition: BndProcessor.cpp:111
EngineStatus engineStatus_
Status of the engine.
Definition: BndProcessor.h:92
double oATol_
Absolute tolerance for pruning a node on basis of bounds.
Definition: BndProcessor.h:107
bool foundNewSolution()
Definition: BndProcessor.cpp:98
UInt numSolutions_
How many new solutions were found by the processor.
Definition: BndProcessor.h:104
Definition: Engine.h:34
Definition: Environment.h:28
Definition: Logger.h:37
Definition: NodeProcessor.h:49
Definition: Node.h:54
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: WarmStart.h:45
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
EngineStatus
Different status that an external engine may report.
Definition: Types.h:176
Definition: BndProcessor.h:27
UInt proc
Number of times problem ocurred in solving.
Definition: BndProcessor.h:32
UInt inf
Number of times relaxation became infeasible.
Definition: BndProcessor.h:29
UInt ub
Number of nodes processed.
Definition: BndProcessor.h:33
UInt opt
Number of times relaxation became infeasible.
Definition: BndProcessor.h:30
UInt prob
Number of times relaxation gave optimal feasible solution.
Definition: BndProcessor.h:31

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025