Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

abacus::BoundBranchRule Class Reference

Implements a branching rule for modifying the lower and the upper bound of a variable. More...

#include <ogdf/lib/abacus/boundbranchrule.h>

+ Inheritance diagram for abacus::BoundBranchRule:

Public Member Functions

 BoundBranchRule (Master *master, int variable, double lBound, double uBound)
 Creates a bound branch rule for given branching variable, lower bound lBound and upper bound uBound. More...
 
virtual ~BoundBranchRule ()
 
virtual void extract (LpSub *lp)
 Pverloaded to modify directly the linear programming relaxation. More...
 
virtual int extract (Sub *sub)
 Modifies a subproblem by changing the lower and the upper bound of the branching variable. More...
 
double lBound () const
 Returns the lower bound of the branching variable. More...
 
double uBound () const
 Returns the upper bound of the branching variable. More...
 
virtual void unExtract (LpSub *lp)
 Should undo the modifictions of the linear programming relaxtion |lp|. More...
 
int variable () const
 Returns the number of the branching variable. More...
 
- Public Member Functions inherited from abacus::BranchRule
 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 initialize (Sub *sub)
 Called from the constructor of a subproblem. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Attributes

double lBound_
 The lower bound of the branching variable. More...
 
double oldLpLBound_
 
double oldLpUBound_
 
double uBound_
 The upper bound of the branching variable. More...
 
int variable_
 The branching variable. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const BoundBranchRule &rhs)
 Output operator for bound branch rules. 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...
 
- Protected Attributes inherited from abacus::BranchRule
Mastermaster_
 A pointer to the corresponding master of the optimization. More...
 

Detailed Description

Implements a branching rule for modifying the lower and the upper bound of a variable.

Definition at line 40 of file boundbranchrule.h.

Constructor & Destructor Documentation

◆ BoundBranchRule()

abacus::BoundBranchRule::BoundBranchRule ( Master master,
int  variable,
double  lBound,
double  uBound 
)
inline

Creates a bound branch rule for given branching variable, lower bound lBound and upper bound uBound.

Parameters
masterA pointer to the corresponding master of the optimization.
variableThe branching variable.
lBoundThe lower bound of the branching variable.
uBoundThe upper bound of the branching variable.

Definition at line 50 of file boundbranchrule.h.

◆ ~BoundBranchRule()

virtual abacus::BoundBranchRule::~BoundBranchRule ( )
inlinevirtual

Definition at line 58 of file boundbranchrule.h.

Member Function Documentation

◆ extract() [1/2]

virtual void abacus::BoundBranchRule::extract ( LpSub lp)
inlinevirtual

Pverloaded to modify directly the linear programming relaxation.

This required to evaluate the quality of a branching rule.

Reimplemented from abacus::BranchRule.

Definition at line 94 of file boundbranchrule.h.

◆ extract() [2/2]

virtual int abacus::BoundBranchRule::extract ( Sub sub)
inlinevirtual

Modifies a subproblem by changing the lower and the upper bound of the branching variable.

Parameters
subThe subproblem being modified.
Returns
0 If the subproblem is successfully modified.
1 If the modification causes a contradiction.

Implements abacus::BranchRule.

Definition at line 79 of file boundbranchrule.h.

◆ lBound()

double abacus::BoundBranchRule::lBound ( ) const
inline

Returns the lower bound of the branching variable.

Definition at line 115 of file boundbranchrule.h.

◆ uBound()

double abacus::BoundBranchRule::uBound ( ) const
inline

Returns the upper bound of the branching variable.

Definition at line 120 of file boundbranchrule.h.

◆ unExtract()

virtual void abacus::BoundBranchRule::unExtract ( LpSub lp)
inlinevirtual

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.

Parameters
lpA pointer to a the linear programming relaxtion of a subproblem.

Reimplemented from abacus::BranchRule.

Definition at line 103 of file boundbranchrule.h.

◆ variable()

int abacus::BoundBranchRule::variable ( ) const
inline

Returns the number of the branching variable.

Definition at line 110 of file boundbranchrule.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const BoundBranchRule rhs 
)
friend

Output operator for bound branch rules.

Writes the branching variable together with its lower and upper bound to an output stream.

Parameters
outThe output stream.
rhsThe branch rule being output.
Returns
A reference to the output stream.

Definition at line 133 of file boundbranchrule.h.

Member Data Documentation

◆ lBound_

double abacus::BoundBranchRule::lBound_
private

The lower bound of the branching variable.

Definition at line 126 of file boundbranchrule.h.

◆ oldLpLBound_

double abacus::BoundBranchRule::oldLpLBound_
private

Definition at line 128 of file boundbranchrule.h.

◆ oldLpUBound_

double abacus::BoundBranchRule::oldLpUBound_
private

Definition at line 129 of file boundbranchrule.h.

◆ uBound_

double abacus::BoundBranchRule::uBound_
private

The upper bound of the branching variable.

Definition at line 127 of file boundbranchrule.h.

◆ variable_

int abacus::BoundBranchRule::variable_
private

The branching variable.

Definition at line 125 of file boundbranchrule.h.


The documentation for this class was generated from the following file: