15 #ifndef MINOTAURMINLPDIVING_H
16 #define MINOTAURMINLPDIVING_H
30 typedef const Solution* ConstSolutionPtr;
31 typedef VarBoundMod* VarBoundModPtr;
98 const static std::string me_;
Define abstract base class for heuristics of various kinds.
Declare important 'types' used in Minotaur.
Definition: Environment.h:28
Definition: Heuristic.h:30
Definition: LinearHandler.h:60
Diving heuristif for MINLPs.
Definition: MINLPDiving.h:81
double * gradientObj_
Gradient of objective function for vector length diving.
Definition: MINLPDiving.h:111
Timer * timer_
Timer for this heuristic.
Definition: MINLPDiving.h:152
UInt maxNLP_
Maximum number of NLPs allowed for diving heuristic.
Definition: MINLPDiving.h:128
DivingheurStats * stats_
Statistics for the heuristic.
Definition: MINLPDiving.h:149
UInt LexBounds_(UInt numfrac, const double *x, Direction d, Order o)
Lexicographic selection method for fractional variable.
Definition: MINLPDiving.cpp:400
bool shouldDive_()
Function to decide on diving or not.
Definition: MINLPDiving.cpp:645
void sort_(UInt left, UInt right)
Sort the score.
Definition: MINLPDiving.cpp:753
double rounding_(double value, Direction d)
Rounding a value in a given direction.
Definition: MINLPDiving.cpp:570
UInt isFrac_(const double *x)
The number of fractional variables in current solution.
Definition: MINLPDiving.cpp:376
DoubleVector score_
Violated variable fraction part list.
Definition: MINLPDiving.h:146
void writeStats(std::ostream &out) const
writing the statistics to the logger
Definition: MINLPDiving.cpp:899
std::stack< VarBoundModPtr > mods_
Definition: MINLPDiving.h:137
DoubleVector avgDual_
Definition: MINLPDiving.h:102
double intTol_
Definition: MINLPDiving.h:115
void restoreBounds_(double *LB_copy, double *UB_copy, UInt vars)
Restore the bounds for the problem.
Definition: MINLPDiving.cpp:561
ProblemPtr p_
Problem to be solved.
Definition: MINLPDiving.h:143
UInt nSelector_
Number of method for selection of variables.
Definition: MINLPDiving.h:140
UInt VectorLength_(UInt numfrac, const double *x, Direction d, Order o)
Vector Length selection method for fractional variable.
Definition: MINLPDiving.cpp:797
ModVector lastNodeMods_
Definition: MINLPDiving.h:119
void saveBounds_(double *LB_copy, double *UB_copy, UInt vars)
Save bounds of the problem.
Definition: MINLPDiving.cpp:597
MINLPDiving(EnvPtr env, ProblemPtr p, EnginePtr e)
default constructor
Definition: MINLPDiving.cpp:42
void getScore_(const double *x, Scoretype s)
Get the score of solution.
Definition: MINLPDiving.cpp:217
LinearHandler * lh_
Linear Handler for presolving.
Definition: MINLPDiving.h:122
UInt maxSol_
Maximum number of feasible solution required from heuristic.
Definition: MINLPDiving.h:131
EnginePtr e_
Engine being used to solve the problem.
Definition: MINLPDiving.h:105
UInt FracBounds_(UInt numfrac, const double *x, Direction d, Order o)
Fractional selection method for fractional variable.
Definition: MINLPDiving.cpp:140
bool vectorFlag_(UInt min_vlength)
Function to decide on vector length diving.
Definition: MINLPDiving.cpp:875
UInt ReducedCost_(UInt numfrac, const double *x, Direction d, Order o)
Reduced cost diving selection method for fractional variable.
Definition: MINLPDiving.cpp:482
void implementDive_(int i, const double *x, SolutionPoolPtr s_pool)
Function to implement diving.
Definition: MINLPDiving.cpp:299
void solve(NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
call to heuristic
Definition: MINLPDiving.cpp:673
UIntVector violated_
violated variable index list
Definition: MINLPDiving.h:155
LoggerPtr logger_
Logger.
Definition: MINLPDiving.h:125
FuncPtr selectHeur_(int i, Direction &d, Order &o)
Select the method, ordering and direction.
Definition: MINLPDiving.cpp:608
void updateAvgDual_(ConstSolutionPtr sol)
Update the average of dual multiplier.
Definition: MINLPDiving.cpp:786
EnvPtr env_
Environment.
Definition: MINLPDiving.h:108
~MINLPDiving()
default destructor
Definition: MINLPDiving.cpp:83
void backtrack_(UInt n_flipped)
Backtracking method.
Definition: MINLPDiving.cpp:99
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: ActiveNodeStore.h:20
Order
Order of rounding: least fractional or most fractional.
Definition: MINLPDiving.h:42
@ Most
Select the variable with Least fractional part.
Definition: MINLPDiving.h:44
Scoretype
Type of score evaluation for fractional variable.
Definition: MINLPDiving.h:48
@ ReducedCost
Score of variable is the index of the variable.
Definition: MINLPDiving.h:52
@ LexBound
Score of variable is the Vector Length.
Definition: MINLPDiving.h:51
@ VectorLength
Score of variable is the fractional part`.
Definition: MINLPDiving.h:50
Direction
Direction of rounding.
Definition: MINLPDiving.h:34
@ Ceil
Round to the smallest integer.
Definition: MINLPDiving.h:36
@ Farthest
Round to the nearest integer.
Definition: MINLPDiving.h:38
@ Nearest
Round to the largest integer.
Definition: MINLPDiving.h:37
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
A statistic struct for MINLP Diving heuristic.
Definition: MINLPDiving.h:58
UInt totalSol
NLPs solved.
Definition: MINLPDiving.h:66
double time[4]
Solutions obtained.
Definition: MINLPDiving.h:63
UInt iterations[4]
Time for each selection method.
Definition: MINLPDiving.h:64
UInt numSol[4]
NLPs that encountered errors.
Definition: MINLPDiving.h:62
UInt errors[4]
Infeasible NLPs solved.
Definition: MINLPDiving.h:61
double best_obj_value
Local optimal solutions obtained.
Definition: MINLPDiving.h:68
UInt totalNLPs
NLP iterations.
Definition: MINLPDiving.h:65
UInt numInfeas[4]
NLPs solved in each selection method.
Definition: MINLPDiving.h:60
UInt numLocal
Solutions found.
Definition: MINLPDiving.h:67
double totalTime
Best objective value of feasible solution.
Definition: MINLPDiving.h:69