Abstract base class for all branching rules. More...
#include <ogdf/lib/abacus/branchrule.h>
Public Member Functions | |
BranchRule (Master *master) | |
Initializes a branching rule. More... | |
virtual | ~BranchRule () |
virtual bool | branchOnSetVar () |
Should indicate if the branching is performed by setting a binary variable. More... | |
virtual void | extract (LpSub *lp) |
Should modify the linear programming relaxation |lp| in order to determine the quality of the branching rule in an LP-based branching rule selection. More... | |
virtual int | extract (Sub *sub)=0 |
Modifies a subproblem by setting the branching variable. More... | |
virtual void | initialize (Sub *sub) |
Called from the constructor of a subproblem. More... | |
virtual void | unExtract (LpSub *lp) |
Should undo the modifictions of the linear programming relaxtion |lp|. More... | |
Public Member Functions inherited from abacus::AbacusRoot | |
virtual | ~AbacusRoot () |
The destructor. More... | |
Protected Attributes | |
Master * | master_ |
A pointer to the corresponding master of the optimization. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from abacus::AbacusRoot | |
static bool | ascii2bool (const string &str) |
Converts the string str to a boolean value. More... | |
static bool | endsWith (const string &str, const string &end) |
Returns true if str ends with end, false otherwise. More... | |
static double | fracPart (double x) |
Returns the absolute value of the fractional part of x. More... | |
static const char * | onOff (bool value) |
Converts a boolean variable to the strings "on" and "off". More... | |
Abstract base class for all branching rules.
Branching should be very flexible within a branch-and-cut framework. Therefore in a branching step each generated subproblem receives an object of the class BranchRule. When the subproblem is activated, it copies the active variables, their bounds and statuses, and the active constraints from the father, and then modifies the subproblem according to the branching rule.
This class is an abstract base class for all branching rules within this framework. We provide by non-abstract derived classes standard branching schemes for setting a binary variable to its lower or upper bound (SetBranchRule), for setting an integer variable to a certain value (ValBranchRule), for changing the bounds of an integer variable (ConBranchRule), and for adding a branching constraint (ConBranchRule).
Definition at line 59 of file branchrule.h.
|
inline |
Initializes a branching rule.
master | A pointer to the corresponding master of the optimization. |
Definition at line 66 of file branchrule.h.
|
inlinevirtual |
Definition at line 69 of file branchrule.h.
|
inlinevirtual |
Should indicate if the branching is performed by setting a binary variable.
This is only required as in the current version of the GNU-compiler run time type information is not satisfactorily implemented.
This function is currently required to determine global validity of Gomory cuts for general s.
Reimplemented in abacus::SetBranchRule.
Definition at line 114 of file branchrule.h.
|
virtual |
Should modify the linear programming relaxation |lp| in order to determine the quality of the branching rule in an LP-based branching rule selection.
The default implementation does nothing except writing a warning to the error stream. If a derived concrete branching rule should be used in LP-based branching rule selection then this function has to be redefined.
lp | A pointer to a the linear programming relaxtion of a subproblem. |
Reimplemented in abacus::ConBranchRule, abacus::SetBranchRule, abacus::ValBranchRule, and abacus::BoundBranchRule.
|
pure virtual |
Modifies a subproblem by setting the branching variable.
sub | The subproblem being modified. |
Implemented in abacus::ConBranchRule, abacus::SetBranchRule, abacus::ValBranchRule, and abacus::BoundBranchRule.
|
inlinevirtual |
Called from the constructor of a subproblem.
It can be used to perform initializations of the branching rule that can only be done after the generation of the subproblem.
The default implementation does nothing.
sub | A pointer to the subproblem that should be used for the initialization. |
Reimplemented in abacus::ConBranchRule.
Definition at line 128 of file branchrule.h.
|
virtual |
Should undo the modifictions of the linear programming relaxtion |lp|.
This function has to be redefined in a derived class if extract(LpSub*) is redefined there.
lp | A pointer to a the linear programming relaxtion of a subproblem. |
Reimplemented in abacus::ConBranchRule, abacus::SetBranchRule, abacus::ValBranchRule, and abacus::BoundBranchRule.
|
protected |
A pointer to the corresponding master of the optimization.
Definition at line 131 of file branchrule.h.