13#ifndef MINOTAURMAXINFBRANCHER_H
14#define MINOTAURMAXINFBRANCHER_H
22typedef Engine* EnginePtr;
114 void printMaxInferenceScores()
const;
117 std::vector<double> upScores_;
120 std::vector<double> downScores_;
124 void statsTable()
const;
127 double gFunction(
double x)
const;
132 void infAggregation_(
int idx,
int nvars,
int nposbin,
double wt1,
double wt2,
ConstraintPtr c);
133 void infPrecedence_(
int idx,
int nvars,
int nnegbin,
int nposbin,
ConstraintPtr c);
134 void infVariableBound_(
int idx,
int nposbin,
double wt,
double wt1,
double wt2,
ConstraintPtr c);
135 void infSetPartition_(
int idx,
int nvars,
double wt);
136 void infSetPack_(
int idx,
int nvars,
double wt);
137 void infCardinality_(
int idx,
int nvars,
int nposbin,
int nnegcoefone,
double wt,
ConstraintPtr c);
138 void infEquationKnapsack_(
int idx,
int nvars,
double wt,
ConstraintPtr c,
double sumnegwt);
139 void infBinPack_(
int idx,
int nvars,
double wt,
ConstraintPtr c,
double sumnegwt);
140 void infKnapsack_(
int idx,
int nvars,
double wt,
ConstraintPtr c,
int nposbin,
double sumnegwt);
142 void findCandidates_();
145 void getPCScore_(
BrCandPtr cand,
double *ch_down,
double *ch_up,
double *score);
146 double getScore_(
const double & up_score,
const double & down_score);
147 bool shouldPrune_(
const double &chcutoff,
const double &change,
const EngineStatus & status,
bool *is_rel);
148 BrCandPtr findBestCandidate_(
const double objval,
double cutoff,
169 void updatePCost_(
const int &i,
const double &new_cost, DoubleVector &cost, UIntVector &count);
186 void useStrongBranchInfo_(
BrCandPtr cand,
const double & chcutoff,
double & change_up,
double & change_down,
const EngineStatus & status_up,
const EngineStatus & status_down);
196 void writeScore_(
BrCandPtr cand,
double score,
double change_up,
double change_down);
197 void writeScores_(std::ostream &out);
201 UIntVector lastStrBranched_;
204 UInt maxStrongCands_;
207 DoubleVector pseudoDown_;
208 DoubleVector pseudoUp_;
209 std::vector<BrCandPtr> relCands_;
210 UIntVector timesDown_;
214 std::vector<BrCandPtr> unrelCands_;
218 HandlerVector handlers_;
227 UIntVector fracCount_;
233 UIntVector unfixedCount_;
238 void updateFracCount_();
243 void updateUnfixedCount_();
246 UIntVector actualTimesUp_;
249 UIntVector actualTimesDown_;
250 std::vector<std::string> variableNames_;
254 const static std::string me_;
Declare the base class Brancher for finding and creating branches in Branch-and-Bound.
Base class for describing candidates for branching on a node in branch-and-bound.
Definition: BrCand.h:32
A brancher is used to find suitable branches for a given node. e.g. LexicoBrancher....
Definition: Brancher.h:33
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: Environment.h:28
A class to select a variable for branching using maximum-inference branching.
Definition: MaxInfBrancher.h:34
void setThresh(UInt k)
Set reliability threshhold.
Definition: MaxInfBrancher.cpp:530
void setMaxDepth(UInt k)
Set the depth at which we stop strong branching.
Definition: MaxInfBrancher.cpp:520
void setMinNodeDist(UInt k)
Don't do strong branching on a cand if we did it 'k' nodes or less ago.
Definition: MaxInfBrancher.cpp:525
void initialize(RelaxationPtr rel)
Initialize data structures.
Definition: MaxInfBrancher.cpp:168
void setIterLim(UInt k)
Set iteration limit of engine.
Definition: MaxInfBrancher.cpp:515
void setEngine(EnginePtr engine)
Set engine.
Definition: MaxInfBrancher.cpp:510
MaxInfBrancher(EnvPtr env, HandlerVector &handlers)
Construct using an environment pointer and initialize.
Definition: MaxInfBrancher.cpp:39
UInt getIterLim()
Get iteration limit of engine.
Definition: MaxInfBrancher.cpp:428
void writeStats(std::ostream &out) const
Write statistics to the given out stream.
Definition: MaxInfBrancher.cpp:385
void setTrustCutoff(bool val)
Set value of trustCutoff parameter.
Definition: MaxInfBrancher.cpp:505
UInt getThresh() const
Return the threshhold value.
Definition: MaxInfBrancher.cpp:499
bool getTrustCutoff()
Return value of trustCutoff parameter.
Definition: MaxInfBrancher.cpp:423
void updateAfterSolve(NodePtr node, ConstSolutionPtr sol)
Update pseudo-costs after LP is solved.
Definition: MaxInfBrancher.cpp:355
Branches findBranches(RelaxationPtr rel, NodePtr node, ConstSolutionPtr sol, SolutionPoolPtr s_pool, BrancherStatus &br_status, ModVector &mods)
Find a branching candidate.
Definition: MaxInfBrancher.cpp:72
std::string getName() const
Return the name of this brancher.
Definition: MaxInfBrancher.cpp:402
~MaxInfBrancher()
Destroy.
Definition: MaxInfBrancher.cpp:66
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
BrancherStatus
What can a brancher do to a node in branch-and-bound.
Definition: Types.h:193
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
EngineStatus
Different status that an external engine may report.
Definition: Types.h:176
Definition: MaxInfBrancher.h:24
UInt strBrCalls
Number of iterations in strong-branching.
Definition: MaxInfBrancher.h:29
UInt engProbs
Number of times called to find a branching candidate.
Definition: MaxInfBrancher.h:27
UInt calls
Number of times variable bounds were changed.
Definition: MaxInfBrancher.h:26
UInt iters
Number of times an unexpected engine status was met.
Definition: MaxInfBrancher.h:28
double time
Number of times strong branching on a variable.
Definition: MaxInfBrancher.h:30