Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
virtual ~ConBranchRule ()
 
Constraintconstraint ()
 Returns a pointer to the branching constraint, or a 0-pointer if this constraint is not available.
 
const Constraintconstraint () const
 Returns a const pointer to the branching constraint, or a 0-pointer if this constraint is not available.
 
virtual void extract (LpSub *lp) override
 Overloaded to modify directly the linear programming relaxation.
 
virtual int extract (Sub *sub) override
 Adds the branching constraint to the subproblem.
 
virtual void initialize (Sub *sub) override
 Initializes the subproblem associated with the branching constraint.
 
virtual void unExtract (LpSub *lp) override
 Should undo the modifictions of the linear programming relaxtion |lp|.
 
- Public Member Functions inherited from abacus::BranchRule
 BranchRule (Master *master)
 Initializes a branching rule.
 
virtual ~BranchRule ()
 
virtual bool branchOnSetVar ()
 Should indicate if the branching is performed by setting a binary variable.
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor.
 

Private Member Functions

const ConBranchRuleoperator= (const ConBranchRule &rhs)
 

Private Attributes

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

Friends

std::ostream & operator<< (std::ostream &out, const ConBranchRule &rhs)
 Output operator for branching constraints.
 

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.
 
static bool endsWith (const string &str, const string &end)
 Returns true if str ends with end, false otherwise.
 
static double fracPart (double x)
 Returns the absolute value of the fractional part of x.
 
static const charonOff (bool value)
 Converts a boolean variable to the strings "on" and "off".
 
- Protected Attributes inherited from abacus::BranchRule
Mastermaster_
 A pointer to the corresponding master of the optimization.
 

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 Symbol 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: