Bonmin 1.8.9
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Bonmin::CbcDfsDiver Class Reference

A more elaborate diving class. More...

#include <BonDiver.hpp>

+ Inheritance diagram for Bonmin::CbcDfsDiver:
+ Collaboration diagram for Bonmin::CbcDfsDiver:

Public Types

enum  ComparisonModes { Enlarge , FindSolutions , CloseBound , LimitTreeSize }
 

Public Member Functions

 CbcDfsDiver ()
 Default constructor.
 
 CbcDfsDiver (const CbcDfsDiver &rhs)
 Copy constructor.
 
CbcDfsDiveroperator= (const CbcDfsDiver &rhs)
 Assignment operator.
 
virtual ~CbcDfsDiver ()
 Destructor.
 
virtual CbcTree * clone () const
 Virtual copy constructor.
 
virtual void cleanTree (CbcModel *model, double cutoff, double &bestPossibleObjective)
 Prune the tree using an objective function cutoff.
 
virtual double getBestPossibleObjective ()
 Get best possible objective function in the tree.
 
void initialize (BabSetupBase &b)
 Initialize the method (get options)
 
virtual void endSearch ()
 Don't know what this is yet?
 
void setComparisonMode (ComparisonModes newMode)
 Changes the mode of comparison of the tree for "safety reasons" if the mode really changes we always finish the current dive and put all the node back onto the heap.
 
ComparisonModes getComparisonMode ()
 get the mode of comparison of the tree.
 
Heap access and maintenance methods.
virtual CbcNode * top () const
 Return top node (next node to process.*‍/.
 
virtual void push (CbcNode *x)
 Add node to the heap.
 
virtual void pop ()
 Remove the top node of the heap.
 
virtual CbcNode * bestNode (double cutoff)
 Remove the best node from the heap and return it.
 
vector methods
virtual bool empty ()
 Test if empty.
 
virtual int size ()
 Give size of the tree.
 

Static Public Member Functions

static void registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
 Register the options of the method.
 

Protected Attributes

int treeCleaning_
 Flag to say that we are currently cleaning the tree and should work only on the heap.
 
std::list< CbcNode * > dive_
 List of the nodes in the current dive.
 
int diveListSize_
 Record dive list size for constant time access.
 
int divingBoardDepth_
 Depth of the node from which diving was started (we call this node the diving board).
 
double cutoff_
 Last reported cutoff.
 
int nBacktracks_
 number of backtracks done in current dive.
 
Parameters of the method.
int maxDepthBFS_
 Maximum depth until which we'll do a bredth-first-search.
 
int maxDiveBacktracks_
 Maximum number of backtrack in one dive.
 
int maxDiveDepth_
 Maximum depth to go from divingBoard.
 
ComparisonModes mode_
 Current mode of the diving strategy.
 

Detailed Description

A more elaborate diving class.

First there are several modes which can be commanded by the Comparison class below. In particular can command to dive to find solutions, to try to close the bound as possible or to limit the size of the tree.

The diving goes into the tree doing depth-first search until one of the following happens:

In the first case all the nodes are put on the tree and the next node on top will be the top of the heap, in the two latter case we just put the node on the tree and backtrack in the list of depth-first search nodes.

Bug
This won't work in a non-convex problem where objective does not decrease down branches.

Definition at line 199 of file BonDiver.hpp.

Member Enumeration Documentation

◆ ComparisonModes

Enumerator
Enlarge 

At the very beginning we might want to enlarge the tree just a bit.

FindSolutions 
CloseBound 
LimitTreeSize 

Definition at line 202 of file BonDiver.hpp.

Constructor & Destructor Documentation

◆ CbcDfsDiver() [1/2]

Bonmin::CbcDfsDiver::CbcDfsDiver ( )

Default constructor.

◆ CbcDfsDiver() [2/2]

Bonmin::CbcDfsDiver::CbcDfsDiver ( const CbcDfsDiver & rhs)

Copy constructor.

◆ ~CbcDfsDiver()

virtual Bonmin::CbcDfsDiver::~CbcDfsDiver ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

CbcDfsDiver & Bonmin::CbcDfsDiver::operator= ( const CbcDfsDiver & rhs)

Assignment operator.

◆ clone()

virtual CbcTree * Bonmin::CbcDfsDiver::clone ( ) const
virtual

Virtual copy constructor.

◆ top()

virtual CbcNode * Bonmin::CbcDfsDiver::top ( ) const
virtual

Return top node (next node to process.*‍/.

◆ push()

virtual void Bonmin::CbcDfsDiver::push ( CbcNode * x)
virtual

Add node to the heap.

◆ pop()

virtual void Bonmin::CbcDfsDiver::pop ( )
virtual

Remove the top node of the heap.

◆ bestNode()

virtual CbcNode * Bonmin::CbcDfsDiver::bestNode ( double cutoff)
virtual

Remove the best node from the heap and return it.

◆ empty()

virtual bool Bonmin::CbcDfsDiver::empty ( )
virtual

Test if empty.

◆ size()

virtual int Bonmin::CbcDfsDiver::size ( )
inlinevirtual

Give size of the tree.

Definition at line 240 of file BonDiver.hpp.

◆ cleanTree()

virtual void Bonmin::CbcDfsDiver::cleanTree ( CbcModel * model,
double cutoff,
double & bestPossibleObjective )
virtual

Prune the tree using an objective function cutoff.

This routine removes all nodes with objective worst than the specified cutoff value. It also sets bestPossibleObjective to best of all on tree before deleting.

Bug
This won't work in a non-convex problem where objective does not decrease down branches.

◆ getBestPossibleObjective()

virtual double Bonmin::CbcDfsDiver::getBestPossibleObjective ( )
virtual

Get best possible objective function in the tree.

◆ registerOptions()

static void Bonmin::CbcDfsDiver::registerOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
static

Register the options of the method.

◆ initialize()

void Bonmin::CbcDfsDiver::initialize ( BabSetupBase & b)

Initialize the method (get options)

◆ endSearch()

virtual void Bonmin::CbcDfsDiver::endSearch ( )
inlinevirtual

Don't know what this is yet?

Definition at line 267 of file BonDiver.hpp.

◆ setComparisonMode()

void Bonmin::CbcDfsDiver::setComparisonMode ( ComparisonModes newMode)

Changes the mode of comparison of the tree for "safety reasons" if the mode really changes we always finish the current dive and put all the node back onto the heap.

◆ getComparisonMode()

ComparisonModes Bonmin::CbcDfsDiver::getComparisonMode ( )
inline

get the mode of comparison of the tree.

Definition at line 274 of file BonDiver.hpp.

Member Data Documentation

◆ treeCleaning_

int Bonmin::CbcDfsDiver::treeCleaning_
protected

Flag to say that we are currently cleaning the tree and should work only on the heap.

Definition at line 281 of file BonDiver.hpp.

◆ dive_

std::list<CbcNode *> Bonmin::CbcDfsDiver::dive_
protected

List of the nodes in the current dive.

Definition at line 283 of file BonDiver.hpp.

◆ diveListSize_

int Bonmin::CbcDfsDiver::diveListSize_
protected

Record dive list size for constant time access.

Definition at line 285 of file BonDiver.hpp.

◆ divingBoardDepth_

int Bonmin::CbcDfsDiver::divingBoardDepth_
protected

Depth of the node from which diving was started (we call this node the diving board).

Definition at line 287 of file BonDiver.hpp.

◆ cutoff_

double Bonmin::CbcDfsDiver::cutoff_
protected

Last reported cutoff.

Definition at line 289 of file BonDiver.hpp.

◆ nBacktracks_

int Bonmin::CbcDfsDiver::nBacktracks_
protected

number of backtracks done in current dive.

Definition at line 291 of file BonDiver.hpp.

◆ maxDepthBFS_

int Bonmin::CbcDfsDiver::maxDepthBFS_
protected

Maximum depth until which we'll do a bredth-first-search.

Definition at line 295 of file BonDiver.hpp.

◆ maxDiveBacktracks_

int Bonmin::CbcDfsDiver::maxDiveBacktracks_
protected

Maximum number of backtrack in one dive.

Definition at line 297 of file BonDiver.hpp.

◆ maxDiveDepth_

int Bonmin::CbcDfsDiver::maxDiveDepth_
protected

Maximum depth to go from divingBoard.

Definition at line 299 of file BonDiver.hpp.

◆ mode_

ComparisonModes Bonmin::CbcDfsDiver::mode_
protected

Current mode of the diving strategy.

Definition at line 301 of file BonDiver.hpp.


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