|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
50 template<
class BaseType,
class CoType>
class CutBuffer;
51 template<
class BaseType,
class CoType>
class Active;
52 template<
class BaseType,
class CoType>
class Pool;
53 template<
class BaseType,
class CoType>
class PoolSlot;
54 template<
class BaseType,
class CoType>
class LpSolution;
120 bool relativeRes =
true,
150 int level()
const {
return level_; }
153 int id()
const {
return id_; }
171 double lowerBound()
const;
174 double upperBound()
const;
195 void dualBound(
double x);
210 void maxIterations(
int max);
245 double lBound(
int i)
const {
return (*lBound_)[i]; }
255 void lBound(
int i,
double l);
266 double uBound(
int i)
const {
return (*uBound_)[i]; }
276 void uBound(
int i,
double u);
303 double xVal(
int i)
const {
return xVal_[i]; }
309 double yVal(
int i)
const {
return yVal_[i]; }
317 bool ancestor(
const Sub *sub)
const;
371 bool objAllInteger()
const;
385 virtual void removeCon(
int i);
395 int addConBufferSpace()
const;
405 int addVarBufferSpace()
const;
423 void ignoreInTailingOff();
524 virtual int variablePoolSeparation(
527 double minViolation = 0.001);
546 virtual int constraintPoolSeparation(
549 double minViolation = 0.001);
576 return branchingOnVariable(rules);
606 virtual int selectBranchingVariable(
int &variable);
639 virtual int selectBranchingVariableCandidates(
ArrayBuffer<int> &candidates);
654 virtual int selectBestBranchingSample(
int nSamples,
676 virtual double rankBranchingRule(
BranchRule *branchRule);
693 double lpRankBranchingRule(
BranchRule *branchRule,
int iterLimit = -1);
707 virtual int compareBranchingSampleRanks(
Array<double> &rank1,
720 int closeHalfExpensive(
int &branchVar,
VarType::TYPE branchVarType);
779 int findNonFixedSet(
int &branchVar,
VarType::TYPE branchVarType);
836 double x,
double lb,
double ub);
856 virtual bool feasible() = 0;
866 bool integerFeasible();
879 virtual bool primalSeparation();
887 virtual int separate();
945 virtual int improve(
double &primalValue);
954 bool boundCrash()
const;
977 virtual void varRealloc(
int newSize);
983 virtual void conRealloc(
int newSize);
999 virtual LP::METHOD chooseLpMethod(
int nVarRemoved,
int nConRemoved,
1000 int nVarAdded,
int nConAdded);
1017 bool betterDual(
double x)
const;
1045 virtual int fixByRedCost(
bool &newValues,
bool saveCand);
1073 virtual int fixAndSet(
bool &newValues);
1086 virtual int fixing(
bool &newValues,
bool saveCand =
false);
1098 virtual int setting(
bool &newValues);
1104 virtual int setByRedCost();
1130 virtual void fathom(
bool reoptimize);
1156 virtual int fix(
int i,
FSVarStat *newStat,
bool &newValue);
1169 virtual int set(
int i,
FSVarStat *newStat,
bool &newValue);
1206 virtual double dualRound(
double x);
1212 virtual double guarantee()
const;
1218 virtual bool guaranteed()
const;
1227 virtual bool removeNonLiftableCons();
1236 virtual int prepareBranching(
bool &lastIteration);
1250 virtual void fathomTheSubTree();
1271 virtual int optimize();
1290 virtual void reoptimize();
1296 virtual void initializeVars(
int maxVar);
1302 virtual void initializeCons(
int maxCon);
1325 virtual PHASE branching();
1352 virtual PHASE fathoming();
1365 virtual PHASE cutting();
1376 virtual LpSub *generateLp();
1390 virtual int initializeLp();
1407 virtual int solveLp();
1532 virtual int _separate();
1540 virtual int _conEliminate();
1546 virtual int _varEliminate();
1572 virtual int _pricing(
bool &newValues,
bool doFixSet =
true);
1587 virtual int _improve(
double &primalValue);
1594 virtual int _fixByLogImp(
bool &newValues);
1601 virtual void updateBoundInLp(
int i);
1604 virtual double fixSetNewBound(
int i);
1647 virtual PHASE _activate();
1659 virtual void _deactivate();
1674 virtual int _initMakeFeas();
1684 virtual int _makeFeasible();
1696 virtual int _setByLogImp(
bool &newValues);
1702 virtual void infeasibleSub();
1705 virtual void getBase();
1739 bool _atUpperBound(
int i);
1742 bool _atLowerBound(
int i);
1808 const Sub &operator=(
const Sub &rhs);
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Active< Variable, Constraint > * actVar() const
Returns a pointer to the currently active variables.
Implements the sets of active constraints and variables which are associated with each subproblem.
Array< LPVARSTAT * > * lpVarStat_
A pointer to an array storing the status of each active variable in the linear program.
LpSub * lp_
A pointer to the corresponding linear program.
@ ActiveSub
The subproblem is currently processed.
virtual void activate()
Can be used as an entrance point for problem specific activations.
bool primalViolated(double x) const
Can be used to compare a value with the one of the best known primal bound.
virtual bool tailingOff()
Called when a tailing off effect according to the parameters TailOffPercent and TailOffNLps is observ...
Abstract base class for all branching rules.
bool activated_
The variable is true if the function activate() has been called from the function _activate().
status of fixed and set variables.
virtual void selectCons()
Is called before constraint are selected from the constraint buffer.
ArrayBuffer< int > * removeVarBuffer_
The buffer of the variables which are removed at the beginning of the next iteration.
virtual void setByLogImp(ArrayBuffer< int > &variable, ArrayBuffer< FSVarStat * > &status)
The default implementation of setByLogImp() does nothing.
@ Branching
We try to generate further subproblems as sons of this subproblem.
int id_
The number of the subproblem.
@ Unprocessed
The status after generation, but before optimization of the subproblem.
Sub * father_
A pointer to the father in the branch-and-cut tree.
virtual void changeLBound(int i, double newLb) override
Sets the lower bound of variable i to newLb.
bool boundCrash() const
Returns true if the dual bound is worse than the best known primal bound, false otherwise.
virtual int makeFeasible()
The default implementation of makeFeasible()does nothing.
virtual double rankBranchingRule(BranchRule *branchRule)
Computes the rank of a branching rule.
Status of fixed and set variables.
BranchRule * branchRule() const
Returns a pointer to the branching rule of the subproblem.
int maxCon() const
Returns the maximum number of constraints which can be handled without reallocation.
int lastIterVarAdd_
The last iteration in which variables have been added.
LP::METHOD lpMethod_
The solution method for the next linear program.
LpSub * lp() const
Returns a pointer to the linear program of the subproblem.
virtual bool fixAndSetTime()
Controls if variables should be fixed or set when all variables price out correctly.
FSVarStat * fsVarStat(int i) const
Returns a pointer to the status of fixing/setting of the i-th variable.
Master * master()
Returns the master of the optimization.
double nnzReserve_
The additional space for nonzeros.
double lpRankBranchingRule(BranchRule *branchRule, int iterLimit=-1)
Computes the rank of a branching rule by modifying the linear programming relaxation of the subproble...
virtual bool solveApproxNow()
The default implementation always returns false.
Array< double > * uBound_
A pointer to an array with the local upper bounds of the active variables.
Active< Variable, Constraint > * actVar_
The active variables of the subproblem.
TailOff * tailOff_
A pointer to the tailing off manager.
Implements a branching rule for modifying the lower and the upper bound of a variable.
double primalBound() const
Returns the value of the primal bound.
virtual int pricing()
Should generate inactive variables which do not price out correctly.
double * xVal_
The last LP-solution.
int level_
The level of the subproblem in the enumeration tree.
double lBound(int i) const
Can be used to access the lower of an active variable of the subproblem.
CutBuffer< Constraint, Variable > * addConBuffer_
The buffer of the newly generated constraints.
Implements a stopwatch measuring CPU time.
int nIter_
The number of iterations in the cutting plane phase.
bool allBranchOnSetVars_
If true, then the branching rule of the subproblem and of all ancestor on the path to the root node a...
const Master * master() const
Returns the const master of the optimization.
bool forceExactSolver_
Indicates whether to force the use of an exact solver to prepare branching etc.
virtual int initMakeFeas(ArrayBuffer< InfeasCon * > &infeasCon, ArrayBuffer< Variable * > &newVars, Pool< Variable, Constraint > **pool)
The default implementation of the virtual initMakeFeas() does nothing.
int nVar() const
Returns the number of active variables.
double dualBound_
The dual bound of the subproblem.
Base class for constraint/variabe pools.
int lastIterConAdd_
The last iteration in which constraints have been added.
bool relativeReserve() const
const Sub * father() const
Returns a pointer to the father of the subproblem in the branch-and-bound tree.
bool min() const
Returns true If it is minimization problem,, false otherwise.
Status of slack variables.
Variable * variable(int i) const
Returns a pointer to the i-th active variable.
STATUS status() const
Returns the status of the subproblem optimization.
int maxVar() const
Returns the maximum number of variables which can be handled without reallocation.
@ Done
The optimization is done.
bool forceExactSolver() const
Returns whether using the exact solver is forced.
int infeasCon_
The number of an infeasible constraint.
STATUS
The enumeration defining the different statuses of variables from the point of view of fixing and set...
int maxIterations_
The maximum number of iterations in the cutting plane phase.
ArrayBuffer< Sub * > * sons_
The sons of the node in the branch-and-cut tree.
virtual void removeCon(int i)
Adds a single constraint to the set of constraints which are removed from the active set at the begin...
bool betterDual(double x) const
Returns true if x is better than the best known dual bound of the subproblem, false otherwise.
double lowerBound() const
Returns a lower bound on the optimal solution of the subproblem.
int addVarBufferSpace() const
Can be used to determine the maximal number of the variables which still can be added to the variable...
CutBuffer< Variable, Constraint > * addVarBuffer_
The buffer of the newly generated variables.
virtual void changeUBound(int i, double newUb) override
Sets the upper bound of variable i to newUb.
Constraint * constraint(int i) const
Returns a pointer to the i-th active constraint.
Base class of all other classes of ABACUS.
Master * master_
A pointer to the corresponding master of the optimization.
ogdf::StopwatchCPU localTimer_
double * bInvRow_
A row of the basis inverse associated with the infeasible variable infeasVar_ or slack variable infea...
The parameterized class Array implements dynamic arrays of type E.
double upperBound() const
Returns an upper bound on the optimal solution of the subproblem.
STATUS
A subproblem can have different statuses.
int addConBufferSpace() const
Can be used to determine the maximal number of the constraints which still can be added to the constr...
@ Processed
The subproblem is completely processed but could not be fathomed.
void push(E e)
Puts a new element in the buffer.
Declaration of stopwatch classes.
Forms the virtual base class for all possible variables given in pool format.
Active< Constraint, Variable > * actCon() const
Returns a pointer to the currently active constraints.
virtual void fixByLogImp(ArrayBuffer< int > &variables, ArrayBuffer< FSVarStat * > &status)
Should collect the numbers of the variables to be fixed in variable and the respective statuses in st...
virtual void newDormantRound()
Increments the counter for the number of rounds the subproblem is dormant.
bool max() const
Returns true if it is maximization problem,, false otherwise.
PHASE
The optimization of the subproblem can be in one of the following phases.
int id() const
Returns the identity number of the subproblem.
int infeasVar_
The number of an infeasible variable.
virtual void deactivate()
Can be used as entrance point for problem specific deactivations after the subproblem optimization.
Array< SlackStat * > * slackStat_
A pointer to an array storing the statuses of the slack variables of the last solved linear program.
const OptSense * optSense() const
Returns a pointer to the object holding the optimization sense of the problem.
int level() const
Returns the level of the subproblem in the branch-and-bound tree.
The linear program of a subproblem.
Active< Constraint, Variable > * actCon_
The active constraints of the subproblem.
Array< FSVarStat * > * fsVarStat_
A pointer to an array storing the status of fixing and setting of the active variables.
METHOD
The solution method for the linear program.
int nStrongBranchingIterations() const
The number of simplex iterations that are performed when testing candidates for branching variables w...
virtual bool pausing()
Sometimes it is appropriate to put a subproblem back into the list of open subproblems.
Representation of variables in column format.
LP::METHOD lastLP_
The method that was used to solve the last LP.
double * yVal_
The dual variables of the last linear program.
double yVal(int i) const
Returns the value of the i-th dual variable in the last solved linear program.
Maintains open subproblems.
double xVal(int i) const
Returns the value of the i-th variable in the last solved linear program.
LPVARSTAT * lpVarStat(int i) const
Returns a pointer to the status of the variable i in the last solved linear program.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
bool relativeReserve_
If this member is true then the space reserve of the following three members varReserve_,...
Forms the virtual base class for all possible constraints given in pool format.
Array< double > * lBound_
A pointer to an array with the local lower bound of the active variables.
bool genNonLiftCons_
If true, then the management of non-liftable constraints is performed.
Stores constraints and variables.
int nOpt_
The number of optimizations of the subproblem.
virtual bool exceptionBranch()
Can be used to specify a problem specific criteria for enforcing a branching step.
bool ignoreInTailingOff_
If this flag is set to true then the next LP-solution is ignored in the tailing-off control.
TYPE
The enumeration with the different variable types.
SlackStat * slackStat(int i) const
Returns a pointer to the status of the slack variable i in the last solved linear program.
BranchRule * branchRule_
The branching rule for the subproblem.
virtual bool exceptionFathom()
Can be used to specify a problem specific fathoming criterium that is checked before the separation o...
virtual int generateBranchRules(ArrayBuffer< BranchRule * > &rules)
Tries to find rules for splitting the current subproblem in further subproblems.
linear program of a subproblem.
double uBound(int i) const
Can be used to access the upper of an active variable of the subproblem.
static void remove(V &ts, const T &t)
double conReserve_
The additional space for constraints.
virtual int addBranchingConstraint(PoolSlot< Constraint, Variable > *slot)
Adds a branching constraint to the constraint buffer.
double dualBound() const
Returns a bound which is "better" than the optimal solution of the subproblem w.r....
int nDormantRounds_
The number of subproblem optimizations the subproblem has already the status Dormant.
double varReserve_
The additional space for variables.
int nDormantRounds() const
ArrayBuffer< int > * removeConBuffer_
The buffer of the constraints which are removed at the beginning of the next iteration.
virtual void selectVars()
Is called before variables are selected from the variable buffer.
int nCon() const
Returns the number of active constraints.
STATUS status_
The status of the subproblem.
The master of the optimization.
double nnzReserve() const
Returns the additional space for nonzero elements of the constraint matrix when it is passed to the L...
void removeVar(int i)
Remove variable i from the set of active variables.