Minotaur 0.4.1
Docs for developers
PCBProcessor.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
14#ifndef MINOTAURPCBPROCESSOR_H
15#define MINOTAURPCBPROCESSOR_H
16
17#include "NodeProcessor.h"
18#include "Types.h"
19
20namespace Minotaur
21{
22
23class CutManager;
24//class Problem;
25
26struct NodeStats {
27 UInt bra;
34};
35
45{
46
47public:
50
52 PCBProcessor(EnvPtr env, EnginePtr engine, HandlerVector handlers_);
53
56
57 // Add a heuristic.
58 void addHeur(HeurPtr h);
59
60 // True if a new solution was found while processing this node.
61 bool foundNewSolution();
62
63 // Find branches that will be used to branch at this node.
64 Branches getBranches();
65
66 // Get warm-start information.
68
69 // Implement NodeProcessor::process().
70 void process(NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool);
71
72 void setCutManager(CutManager* cutman);
73
74 // write statistics. Base class method.
75 void writeStats(std::ostream& out) const;
76
77 // write statistics. Base class method.
78 void writeStats() const;
79
80private:
82 Branches branches_;
83
88 bool contOnErr_;
89
91 CutManager* cutMan_;
92
94 double cutOff_;
95
97 EnginePtr engine_;
98
100 EngineStatus engineStatus_;
101
103 EnvPtr env_;
104
106 HandlerVector handlers_;
107
109 HeurVector heurs_;
110
112 HandlerPtr infHand_;
113
115 LoggerPtr logger_;
116
118 static const std::string me_;
119
122 int presFreq_;
123
125 UInt numSolutions_;
126
128 double oATol_;
129
131 double oRTol_;
132
134 RelaxationPtr relaxation_;
135
137 NodeStats stats_;
138
140 WarmStartPtr ws_;
141
148 virtual bool isFeasible_(NodePtr node, ConstSolutionPtr sol,
149 SolutionPoolPtr s_pool, bool& should_prune);
150
152 virtual bool presolveNode_(NodePtr node, SolutionPoolPtr s_pool);
153
155 virtual void solveRelaxation_();
156
161 virtual bool shouldPrune_(NodePtr node, double solval,
162 SolutionPoolPtr s_pool);
163
167 void removeCuts_(ConstSolutionPtr sol);
168
170
177 void separate_(ConstSolutionPtr sol, NodePtr node, SolutionPoolPtr s_pool,
178 SeparationStatus* status);
179
180 // Implement NodeProcessor::tightenBounds_()
181 virtual void tightenBounds_(NodePtr node, SolutionPoolPtr s_pool,
183};
184
185typedef PCBProcessor* PCBProcessorPtr;
186
187} // namespace Minotaur
188#endif
189
Define the NodeProcessor class for processing nodes in the branch-and-bound algorithm.
Declare important 'types' used in Minotaur.
Abstract base class to manage cuts in the relaxation.
Definition: CutManager.h:42
Definition: Engine.h:34
Definition: Environment.h:28
Base class for handling specific types of constraints or objective.
Definition: Handler.h:49
Definition: Heuristic.h:30
Definition: Logger.h:37
Definition: NodeProcessor.h:49
Definition: Node.h:54
Default node processor used in solver for now.
Definition: PCBProcessor.h:45
WarmStartPtr getWarmStart()
Definition: PCBProcessor.cpp:95
PCBProcessor()
Default constructor.
Definition: PCBProcessor.h:49
void process(NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
Definition: PCBProcessor.cpp:181
Branches getBranches()
Find branches that will be used to branch at this node.
Definition: PCBProcessor.cpp:89
void writeStats() const
Write statistics to our own logger.
Definition: PCBProcessor.cpp:630
bool foundNewSolution()
Definition: PCBProcessor.cpp:84
~PCBProcessor()
Destroy.
Definition: PCBProcessor.cpp:62
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
SeparationStatus
Status from separation routine:
Definition: Types.h:217
EngineStatus
Different status that an external engine may report.
Definition: Types.h:176
Definition: PCBProcessor.h:26
UInt opt
Number of times relaxation became infeasible.
Definition: PCBProcessor.h:29
UInt ub
Number of nodes processed.
Definition: PCBProcessor.h:32
UInt prob
Number of times relaxation gave optimal feasible solution.
Definition: PCBProcessor.h:30
UInt tol_err
Number of nodes pruned because of bound.
Definition: PCBProcessor.h:33
UInt inf
Number of times relaxation became infeasible.
Definition: PCBProcessor.h:28
UInt proc
Number of times problem ocurred in solving.
Definition: PCBProcessor.h:31

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