Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

abacus::FixCand Class Reference

Candidates for fixing. More...

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

+ Inheritance diagram for abacus::FixCand:

Public Member Functions

 FixCand (Master *master)
 Creates an empty set of candidates for fixing. More...
 
 ~FixCand ()
 The destructor. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Member Functions

 FixCand (const FixCand &rhs)
 
void allocate (int nCand)
 Allocates memory to store nCand candidates for fixing. More...
 
void deleteAll ()
 Deletes all allocated memory of members. More...
 
void fixByRedCost (CutBuffer< Variable, Constraint > *addVarBuffer)
 Tries to fix as many candidates as possible. More...
 
const FixCandoperator= (const FixCand &rhs)
 
void saveCandidates (Sub *sub)
 Memorizes suitable variables for fixing. More...
 

Private Attributes

ArrayBuffer< PoolSlotRef< Variable, Constraint > * > * candidates_
 The candidates for fixing. More...
 
ArrayBuffer< FSVarStat * > * fsVarStat_
 The fixing status of the candidates. More...
 
ArrayBuffer< double > * lhs_
 The left hand side of the expression evaluated for fixing. More...
 
Mastermaster_
 A pointer to the corresponding master of the optimization. More...
 

Friends

class Master
 
class Sub
 

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...
 

Detailed Description

Candidates for fixing.

Variables can be only fixed according to the reduced costs and statuses of variables of the root of the remaining branch-and-bound tree. However, if we store these values, we can repeat the fixing process also in any other node of the enumeration tree when we find a better global lower bound.

Possible candidates for fixing are all variables which have the status AtLowerBound or AtUpperBound. We store all these candidates together with their values in this class.

If we try to fix variables according to reduced cost criteria in nodes which are not the root of the remaining branch-and-cut tree, we always have to take the candidates and values from this class.

Definition at line 63 of file fixcand.h.

Constructor & Destructor Documentation

◆ FixCand() [1/2]

abacus::FixCand::FixCand ( Master master)
inline

Creates an empty set of candidates for fixing.

Parameters
masterA pointer to the corresponding master of the optimization.

Definition at line 74 of file fixcand.h.

◆ ~FixCand()

abacus::FixCand::~FixCand ( )
inline

The destructor.

Definition at line 82 of file fixcand.h.

◆ FixCand() [2/2]

abacus::FixCand::FixCand ( const FixCand rhs)
private

Member Function Documentation

◆ allocate()

void abacus::FixCand::allocate ( int  nCand)
private

Allocates memory to store nCand candidates for fixing.

◆ deleteAll()

void abacus::FixCand::deleteAll ( )
private

Deletes all allocated memory of members.

The member pointers are set to 0 that multiple deletion cannot cause any error.

◆ fixByRedCost()

void abacus::FixCand::fixByRedCost ( CutBuffer< Variable, Constraint > *  addVarBuffer)
private

Tries to fix as many candidates as possible.

The new variable status is both stored in the global variable status of the class Master and in the local variable status of Sub. Candidates which are fixed are removed from the candidate set.

We do not used the function Master::primalViolated() for checking of a variable can be fixed, because here we also have to be careful for integer objective function.

Parameters
addVarBufferInactive variables which are fixed to a nonzero value are added to addVarBuffer to be activated in the next iteration.
Returns
1 If contradictions to the variables statuses of sub are detected; 0 otherwise.

◆ operator=()

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

◆ saveCandidates()

void abacus::FixCand::saveCandidates ( Sub sub)
private

Memorizes suitable variables for fixing.

Parameters
subA pointer to the root node of the remaining branch-and-cut tree.

Friends And Related Function Documentation

◆ Master

friend class Master
friend

Definition at line 66 of file fixcand.h.

◆ Sub

friend class Sub
friend

Definition at line 65 of file fixcand.h.

Member Data Documentation

◆ candidates_

ArrayBuffer<PoolSlotRef<Variable, Constraint>*>* abacus::FixCand::candidates_
private

The candidates for fixing.

Definition at line 122 of file fixcand.h.

◆ fsVarStat_

ArrayBuffer<FSVarStat*>* abacus::FixCand::fsVarStat_
private

The fixing status of the candidates.

Definition at line 124 of file fixcand.h.

◆ lhs_

ArrayBuffer<double>* abacus::FixCand::lhs_
private

The left hand side of the expression evaluated for fixing.

Definition at line 126 of file fixcand.h.

◆ master_

Master* abacus::FixCand::master_
private

A pointer to the corresponding master of the optimization.

Definition at line 120 of file fixcand.h.


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