Minotaur 0.4.1
Docs for developers
MultiSolHeur.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
13#ifndef MULTISOLHEUR_H
14#define MULTISOLHEUR_H
15
16#include "CutManager.h"
17#include "Heuristic.h"
18#include "MILPEngine.h"
19#include "Relaxation.h"
20#include "Solution.h"
21#include "Types.h"
22
23namespace Minotaur {
24 class Engine;
25 class Problem;
26
29 UInt milpS;
35 double time;
36 };
37
38 class MultiSolHeur : public Heuristic {
39
40 public:
41
44
48 virtual ~MultiSolHeur();
49
51 //to ub
53
55
57 void writeStats(std::ostream &out) const;
58
59 private:
60
62 const static std::string me_;
63
65 EnvPtr env_;
66
68 ProblemPtr minlp_;
69
71 ProblemPtr miqp_;
72
74 EnginePtr nlpe_;
75
77 MILPEnginePtr milpe_;
78
80 //SolutionPoolPtr sPool_;
81
83 LoggerPtr logger_;
84
86 double ub_;
87
89 double lb_;
90
91 VariablePtr objVar_;
92
93 SolutionPtr bestSol_;
94
95 bool newSolFound_;
96
98 double intTol_;
99
100 double objATol_;
101
102 double solATol_;
103
104 double objRTol_;
105
106 double solRTol_;
107
109 std::vector<ConstraintPtr> nlCons_;
110
112 double * xC_;
113
115 MultiSolHeurStats* stats_;
116
118 Timer* timer_;
119
120
122
123 std::stack<Modification *> mods_;
124
125 void cutToCons_(const double *nlpx, const double *lpx,
126 SeparationStatus *status);
127
128 void cutsAtLpSol_(const double *lpx, SeparationStatus *status);
129
130 void addCut_(const double *nlpx, const double *lpx,
131 ConstraintPtr con,
132 SeparationStatus *status);
133
134 void linearAt_(FunctionPtr f, double fval, const double *x,
135 double *c, LinearFunctionPtr *lf, int *error);
136
137 FunctionPtr newObj_(const double * x0, const double * x);
143 void relMods_(const double *x);
144
145 void undoMods_();
146
148 void solveMILP(SolveStatus &status);
149 //void solveMILP(RelaxationPtr rel, SolveStatus &status);
150
151 void findCenter_();
152
153 void findSol_(ConstSolutionPtr sol, SolutionPoolPtr sPool,
154 bool &isTerm,
155 //double oldBest, bool &isTerm,
156 std::vector<SolutionPtr> & infSols,
157 std::vector<SolutionPtr> & limSols);
158 void ifOnlyNonlinObj_();
159
160 void ifNonlinCons_();
161
162 void improveSol_(const double * x0);
163
164 void itrMilpSolve_(SolutionPoolPtr sPool);
165
166 void fixInts_(const double *x);
167
168 void newMIQP_(RelaxationPtr rel, const double * x0,
169 SolutionPoolPtr sPool);
170
171 void solveNLP_();
172
173 void unfixInts_();
174
175 };
176
177 typedef MultiSolHeur* MultiSolHeurPtr;
178
179}
180
181#endif
182
Manages addition and deletion of cuts to problem.
Define abstract base class for heuristics of various kinds.
Declare the class MILPEngine for solving MILPs and getting solution.
Declare the class Relaxation for storing and manipulating relaxations.
Implement base class Solution.
Declare important 'types' used in Minotaur.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: Engine.h:34
Definition: Environment.h:28
Definition: Function.h:37
Definition: Heuristic.h:30
The base class linear function is of the form c'x.
Definition: LinearFunction.h:31
Definition: Logger.h:37
Definition: MILPEngine.h:28
Definition: MultiSolHeur.h:38
void solve(NodePtr, RelaxationPtr, SolutionPoolPtr)
Use this heuristic.
Definition: MultiSolHeur.h:54
void writeStats(std::ostream &out) const
write statistic to the logger
Definition: MultiSolHeur.cpp:1201
virtual ~MultiSolHeur()
default destructor
Definition: MultiSolHeur.cpp:110
MultiSolHeur()
default constructor
Definition: MultiSolHeur.cpp:46
void solveAtSol(ConstSolutionPtr sol, RelaxationPtr rel, SolutionPoolPtr sPool)
call to the heuristic and find solutions with value less than or equal
Definition: MultiSolHeur.cpp:184
Definition: Node.h:54
Definition: Problem.h:74
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: Timer.h:40
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
SeparationStatus
Status from separation routine:
Definition: Types.h:217
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158
statistics for heuristic
Definition: MultiSolHeur.h:28
UInt nlpS
Number of MILPs solved in the heuristic.
Definition: MultiSolHeur.h:30
double time
Number of cuts generated.
Definition: MultiSolHeur.h:35
UInt nlpInf
Number of NLPs hit engine limit.
Definition: MultiSolHeur.h:32
UInt nlpLim
Number of NLPs solved in the heuristic.
Definition: MultiSolHeur.h:31
UInt cuts
Number of NLPs other than opt and inf.
Definition: MultiSolHeur.h:34
UInt nlpOthr
Number of infeasible NLPs.
Definition: MultiSolHeur.h:33

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