Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

abacus::ConBranchRule Class Reference

Implements the branching by adding a constraint to the set of active constraints. More...

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

+ Inheritance diagram for abacus::ConBranchRule:

Public Member Functions

 ConBranchRule (Master *master, PoolSlot< Constraint, Variable > *poolSlot)
 Creates a branching constraint. More...
 
virtual ~ConBranchRule ()
 
Constraintconstraint ()
 Returns a pointer to the branching constraint, or a 0-pointer if this constraint is not available. More...
 
const Constraintconstraint () const
 Returns a const pointer to the branching constraint, or a 0-pointer if this constraint is not available. More...
 
virtual void extract (LpSub *lp) override
 Overloaded to modify directly the linear programming relaxation. More...
 
virtual int extract (Sub *sub) override
 Adds the branching constraint to the subproblem. More...
 
virtual void initialize (Sub *sub) override
 Initializes the subproblem associated with the branching constraint. More...
 
virtual void unExtract (LpSub *lp) override
 Should undo the modifictions of the linear programming relaxtion |lp|. 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...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Member Functions

const ConBranchRuleoperator= (const ConBranchRule &rhs)
 

Private Attributes

PoolSlotRef< Constraint, VariablepoolSlotRef_
 A reference to the pool slot of the branching constraints. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const ConBranchRule &rhs)
 Output operator for branching constraints. 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 the branching by adding a constraint to the set of active constraints.

Definition at line 44 of file conbranchrule.h.

Constructor & Destructor Documentation

◆ ConBranchRule()

abacus::ConBranchRule::ConBranchRule ( Master master,
PoolSlot< Constraint, Variable > *  poolSlot 
)
inline

Creates a branching constraint.

Note
The subproblem associated with the branching constraint will be modified in the constructor of the subproblem generated with this branching rule such that later the check for local validity of the branching constraint is performed correcly.
Parameters
masterA pointer to the corresponding master of the optimization.
poolSlotA pointer to the pool slot of the branching constraint.

Definition at line 57 of file conbranchrule.h.

◆ ~ConBranchRule()

virtual abacus::ConBranchRule::~ConBranchRule ( )
inlinevirtual

Definition at line 61 of file conbranchrule.h.

Member Function Documentation

◆ constraint() [1/2]

Constraint* abacus::ConBranchRule::constraint ( )
inline

Returns a pointer to the branching constraint, or a 0-pointer if this constraint is not available.

Definition at line 102 of file conbranchrule.h.

◆ constraint() [2/2]

const Constraint* abacus::ConBranchRule::constraint ( ) const
inline

Returns a const pointer to the branching constraint, or a 0-pointer if this constraint is not available.

Definition at line 107 of file conbranchrule.h.

◆ extract() [1/2]

virtual void abacus::ConBranchRule::extract ( LpSub lp)
overridevirtual

Overloaded to modify directly the linear programming relaxation.

This required to evaluate the quality of a branching rule.

Reimplemented from abacus::BranchRule.

◆ extract() [2/2]

virtual int abacus::ConBranchRule::extract ( Sub sub)
overridevirtual

Adds the branching constraint to the subproblem.

Instead of adding it directly to the set of active constraints it is added to the cut buffer.

Parameters
subThe subproblem being modified.
Returns
Always 0, since there cannot be a contractiction.

Implements abacus::BranchRule.

◆ initialize()

virtual void abacus::ConBranchRule::initialize ( Sub sub)
overridevirtual

Initializes the subproblem associated with the branching constraint.

Parameters
subA pointer to the subproblem that is associated with the branching constraint.

Reimplemented from abacus::BranchRule.

◆ operator=()

const ConBranchRule& abacus::ConBranchRule::operator= ( const ConBranchRule rhs)
private

◆ unExtract()

virtual void abacus::ConBranchRule::unExtract ( LpSub lp)
overridevirtual

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.

Friends And Related Function Documentation

◆ operator<<

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

Output operator for branching constraints.

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

Member Data Documentation

◆ poolSlotRef_

PoolSlotRef<Constraint, Variable> abacus::ConBranchRule::poolSlotRef_
private

A reference to the pool slot of the branching constraints.

Definition at line 113 of file conbranchrule.h.


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