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

Abstract base class to manage cuts in the relaxation. More...

#include <CutManager.h>

Inheritance diagram for Minotaur::CutManager:
Inheritance graph
[legend]

Public Member Functions

 CutManager ()
 Empty constructor.
 
virtual ~CutManager ()
 Destroy.
 
virtual void addCut (CutPtr c)=0
 Add a cut to be managed by the cut manager. More...
 
virtual void addCutToPool (CutPtr c)=0
 Add a cut to the pool managed by the cut manager. More...
 
virtual ConstraintPtr addCut (ProblemPtr p, FunctionPtr f, double lb, double ub, bool direct_to_rel, bool never_del)=0
 Add a cut. More...
 
virtual void addCuts (CutVectorIter cbeg, CutVectorIter cend)=0
 Add a cut to be managed by the cut manager. The cut is not added to the problem by this function (See separate() for it). More...
 
virtual size_t getNumCuts () const =0
 Get the total number of cuts available to the manager. More...
 
virtual size_t getNumEnabledCuts () const =0
 Get the total number of cuts currently enabled, i.e., added to the relaxation. More...
 
virtual size_t getNumDisabledCuts () const =0
 Get the total number of cuts currently not enabled. More...
 
virtual size_t getNumNewCuts () const =0
 Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate(). More...
 
virtual std::vector< ConstraintPtrgetPoolCons ()=0
 
virtual void nodeIsBranched (NodePtr, ConstSolutionPtr, int)
 Update information on a node which is branched. More...
 
virtual void nodeIsProcessed (NodePtr)
 Update information when a node is processed. More...
 
virtual void postSolveUpdate (ConstSolutionPtr sol, EngineStatus e_status)=0
 
virtual void separate (ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *n_added)=0
 Separate a given point using the cuts in the storage. More...
 
virtual void updatePool (ProblemPtr, ConstSolutionPtr)
 Update information of the cuts in the pool. More...
 
virtual void updateRel (ConstSolutionPtr, ProblemPtr)
 Update information about cuts in the relaxation. More...
 
virtual void write (std::ostream &out) const =0
 Write cuts to output. More...
 
virtual void writeStats (std::ostream &out) const =0
 Write statistics to output. More...
 

Detailed Description

Abstract base class to manage cuts in the relaxation.

The CutManager class is meant to `‘manage’' the cutting planes generated by different cut generators and handlers. By manage we mean:

  1. Removing cuts if they become inactive.
  2. Adding cuts from storage if violated.
  3. Adding newly generated cuts.
  4. Keeping a list of constraints that are cuts. This class is not meant to generate cuts (a job of CutGenerator) or even store them (CutStorage).

Member Function Documentation

◆ addCut() [1/2]

virtual void Minotaur::CutManager::addCut ( CutPtr  c)
pure virtual

Add a cut to be managed by the cut manager.

Parameters
[in]cCut pointer to be added. Do not change a cut after it is added.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ addCut() [2/2]

virtual ConstraintPtr Minotaur::CutManager::addCut ( ProblemPtr  p,
FunctionPtr  f,
double  lb,
double  ub,
bool  direct_to_rel,
bool  never_del 
)
pure virtual

Add a cut.

Parameters
[in]pProblem to add a cut to
[in]fFunction of the cut
[in]lbLower bound
[in]ubUpper bound
[in]direct_to_relWhether add the cut directly to rel
[in]never_delWhether the cut should always remain in the pool
Returns
A pointer to the constraint added to rel

Implemented in Minotaur::SimpleCutMan, Minotaur::CutMan2, Minotaur::CutMan1, and Minotaur::ParCutMan.

◆ addCuts()

virtual void Minotaur::CutManager::addCuts ( CutVectorIter  cbeg,
CutVectorIter  cend 
)
pure virtual

Add a cut to be managed by the cut manager. The cut is not added to the problem by this function (See separate() for it).

Parameters
[in]cbeg'Begin' iterator of the vector of cuts to be added.
[in]cend'End' iterator of the vector of cuts to be added.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ addCutToPool()

virtual void Minotaur::CutManager::addCutToPool ( CutPtr  c)
pure virtual

Add a cut to the pool managed by the cut manager.

Parameters
[in]cCut pointer to be added.

Implemented in Minotaur::ParCutMan.

◆ getNumCuts()

virtual size_t Minotaur::CutManager::getNumCuts ( ) const
pure virtual

Get the total number of cuts available to the manager.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ getNumDisabledCuts()

virtual size_t Minotaur::CutManager::getNumDisabledCuts ( ) const
pure virtual

Get the total number of cuts currently not enabled.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ getNumEnabledCuts()

virtual size_t Minotaur::CutManager::getNumEnabledCuts ( ) const
pure virtual

Get the total number of cuts currently enabled, i.e., added to the relaxation.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ getNumNewCuts()

virtual size_t Minotaur::CutManager::getNumNewCuts ( ) const
pure virtual

Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate().

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ nodeIsBranched()

virtual void Minotaur::CutManager::nodeIsBranched ( NodePtr  ,
ConstSolutionPtr  ,
int   
)
inlinevirtual

Update information on a node which is branched.

Parameters
[in]NodePtrbranched node.
[in]ConstSolutionPtrsolution of the lp solve in the node.
[in]intnumber of children

◆ nodeIsProcessed()

virtual void Minotaur::CutManager::nodeIsProcessed ( NodePtr  )
inlinevirtual

Update information when a node is processed.

Parameters
[in]NodePtrnode which has already been processed

◆ postSolveUpdate()

virtual void Minotaur::CutManager::postSolveUpdate ( ConstSolutionPtr  sol,
EngineStatus  e_status 
)
pure virtual

Updates information about the cuts after problem is solved. Also removes cuts from relaxation and/or the storage.

Parameters
[in]solSolution from previous solve.
[in]e_statusStatus of the engine

Implemented in Minotaur::CutMan1, Minotaur::ParCutMan, Minotaur::SimpleCutMan, and Minotaur::CutMan2.

◆ separate()

virtual void Minotaur::CutManager::separate ( ProblemPtr  p,
ConstSolutionPtr  sol,
bool *  separated,
size_t *  n_added 
)
pure virtual

Separate a given point using the cuts in the storage.

Parameters
[in]solSolution that needs to be separated.
[out]separatedTrue if solution is separated by cuts. False otherwise.
[out]n_addedThe number of cuts added by this routine to the problem.

Implemented in Minotaur::SimpleCutMan, Minotaur::CutMan1, Minotaur::ParCutMan, and Minotaur::CutMan2.

◆ updatePool()

virtual void Minotaur::CutManager::updatePool ( ProblemPtr  ,
ConstSolutionPtr   
)
inlinevirtual

Update information of the cuts in the pool.

Parameters
[in]problemPointer to the relaxation problem
[in]solSolution of the LP solve
[in]nodeNode in which information gets updated

Reimplemented in Minotaur::CutMan2.

◆ updateRel()

virtual void Minotaur::CutManager::updateRel ( ConstSolutionPtr  ,
ProblemPtr   
)
inlinevirtual

Update information about cuts in the relaxation.

Parameters
[in]solSolution of the LP solve
[in]problemPointer to the relaxation problem

Reimplemented in Minotaur::CutMan2.

◆ write()

virtual void Minotaur::CutManager::write ( std::ostream &  out) const
pure virtual

Write cuts to output.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.

◆ writeStats()

virtual void Minotaur::CutManager::writeStats ( std::ostream &  out) const
pure virtual

Write statistics to output.

Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.


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

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