Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Attributes | List of all members
Minotaur::BrCand Class Referenceabstract

Base class for describing candidates for branching on a node in branch-and-bound. More...

#include <BrCand.h>

Inheritance diagram for Minotaur::BrCand:
Inheritance graph
[legend]
Collaboration diagram for Minotaur::BrCand:
Collaboration graph
[legend]

Public Member Functions

 BrCand ()
 Constructor.
 
virtual ~BrCand ()
 Destroy.
 
virtual void decrBranches ()
 Decrement the number of branches currently associated with this candidate.
 
virtual double getDDist ()=0
 
virtual BranchDirection getDir () const
 Get the preferred direction.
 
virtual HandlerPtr getHandler ()
 Return the handler that created this candidate.
 
virtual std::string getName () const
 Display for debugging. More...
 
virtual int getPCostIndex () const
 Return the index in the pseudo cost array. If it is not in the array, return a value less than 0.
 
virtual double getScore ()
 Return the score for this candidate.
 
virtual double getUDist ()=0
 
virtual int numBranches ()
 Return the number of branches currently associated with this candidate.
 
virtual void setDir (BranchDirection d)
 Set the preferred direction that will be processed first in the branch-and-bound tree.
 
void setDist (double ddist, double udist)
 Set the distance of the current solution from the down branch and the up branch.
 
virtual void setHandler (HandlerPtr h)
 Set the handler that created this candidate.
 
virtual void setNumBranches (int n)
 Set the number of branches associated with this candidate.
 
virtual void setScore (const double score)
 Set score for this candidate. More...
 

Protected Attributes

HandlerPtr h_
 Handler that created this candidate.
 
int branches_
 Number of branches still in the tree which were created by this candidate.
 
int pCostIndex_
 Index of the this candidate in the pseudo-cost array.
 
BranchDirection prefDir_
 Which is preferred for processing next? UpBranch or DownBranch?
 
double score_
 Score of this candidate.
 

Detailed Description

Base class for describing candidates for branching on a node in branch-and-bound.

A BranchCand object is something that can be branched upon. This class is abstract. Examples are BrVarCand, BrSOS1Cand, BrSOS2Cand, BrHyperCand, BrGenCand etc.

Member Function Documentation

◆ getDDist()

virtual double Minotaur::BrCand::getDDist ( )
pure virtual

Return the distance of the current point from the branching constraint: down direction. For an integer constrained variable, x, it would be $ x - \lfloor x \rfloor $.

Implemented in Minotaur::BrVarCand, and Minotaur::SOSBrCand.

◆ getName()

virtual std::string Minotaur::BrCand::getName ( ) const
inlinevirtual

Display for debugging.

Reimplemented in Minotaur::BrVarCand, and Minotaur::SOSBrCand.

◆ getUDist()

virtual double Minotaur::BrCand::getUDist ( )
pure virtual

Return the distance of the current point from the branching constraint: up direction For an integer constrained variable, x, it would be $
x - \lceil x \rceil $.

Implemented in Minotaur::BrVarCand, and Minotaur::SOSBrCand.

◆ setScore()

virtual void Minotaur::BrCand::setScore ( const double  score)
inlinevirtual

Set score for this candidate.

The score is used to compare two candidates.

Parameters
[in]scoreThe desired score of this candidate.

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

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025