Minotaur 0.4.1
Docs for developers
Public Member Functions | List of all members
Minotaur::KnapCovHandler Class Reference

#include <KnapCovHandler.h>

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

Public Member Functions

 KnapCovHandler ()
 Default constructor.
 
 KnapCovHandler (EnvPtr env, ProblemPtr problem)
 Constructor.
 
 ~KnapCovHandler ()
 Destroy.
 
void relaxInitFull (RelaxationPtr, SolutionPool *, bool *)
 Does nothing. More...
 
void relaxInitInc (RelaxationPtr, SolutionPool *, bool *)
 Does nothing. More...
 
void relaxNodeFull (NodePtr, RelaxationPtr, bool *)
 Does nothing. More...
 
void relaxNodeInc (NodePtr, RelaxationPtr, bool *)
 Does nothing. More...
 
bool isFeasible (ConstSolutionPtr sol, RelaxationPtr relaxation, bool &should_prune, double &inf_meas)
 
void separate (ConstSolutionPtr, NodePtr, RelaxationPtr, CutManager *cutman, SolutionPoolPtr, ModVector &p_mods, ModVector &r_mods, bool *, SeparationStatus *status)
 
virtual void getBranchingCandidates (RelaxationPtr, const DoubleVector &, ModVector &, BrVarCandSet &, BrCandVector &, bool &)
 Does nothing. More...
 
virtual ModificationPtr getBrMod (BrCandPtr, DoubleVector &, RelaxationPtr, BranchDirection)
 Does nothing. More...
 
virtual Branches getBranches (BrCandPtr, DoubleVector &, RelaxationPtr, SolutionPoolPtr)
 Does nothing. More...
 
SolveStatus presolve (PreModQ *, bool *, Solution **)
 Does nothing. More...
 
virtual bool presolveNode (RelaxationPtr, NodePtr, SolutionPoolPtr, ModVector &, ModVector &)
 Does nothing. More...
 
std::string getName () const
 Return the name of the handler. More...
 
void writeStats (std::ostream &) const
 Show statistics. More...
 
UInt KC_knaps ()
 
UInt KC_cuts ()
 
UInt KC_extended ()
 
UInt KC_simple ()
 
UInt KC_gns ()
 
UInt KC_singlectwo ()
 
double KC_time ()
 
- Public Member Functions inherited from Minotaur::Handler
 Handler ()
 Default constructor.
 
virtual ~Handler ()
 Destroy.
 
virtual void addConstraint (ConstraintPtr newcon)
 Add constraint to be handled by this handler. More...
 
virtual ConstraintVector::const_iterator consBegin () const
 
virtual ConstraintVector::const_iterator consEnd () const
 
virtual int fixNodeErr (RelaxationPtr, ConstSolutionPtr, SolutionPoolPtr, bool &)
 
virtual Branches getBranches (BrCandPtr cand, DoubleVector &x, RelaxationPtr rel, SolutionPoolPtr s_pool)=0
 Return branches for branching. More...
 
virtual void getBranchingCandidates (RelaxationPtr rel, const DoubleVector &x, ModVector &mods, BrVarCandSet &cands, BrCandVector &gencands, bool &is_inf)=0
 find branching candidates. More...
 
virtual ModificationPtr getBrMod (BrCandPtr cand, DoubleVector &x, RelaxationPtr rel, BranchDirection dir)=0
 Get the modifcation that creates a given (up or down) branch. More...
 
virtual std::string getName () const =0
 Return the name of the handler. More...
 
bool getStrongerMods (RelaxationPtr rel, NodePtr node, SolutionPoolPtr s_pool, ModVector &p_mods, ModVector &r_mods)
 do node presolve to get mods for stronger branching All params are presolveNode params.
 
virtual bool isFeasible (ConstSolutionPtr sol, RelaxationPtr rel, bool &should_prune, double &inf_meas)=0
 Check if a solution is feasible. More...
 
virtual bool isNeeded ()
 Return true if this handler is needed for the problem. More...
 
virtual SolveStatus presolve (PreModQ *pre_mods, bool *changed, Solution **sol)=0
 Initial presolve. More...
 
virtual bool presolveNode (RelaxationPtr rel, NodePtr node, SolutionPoolPtr s_pool, ModVector &p_mods, ModVector &r_mods)=0
 Presolve the problem and its relaxation at a node. More...
 
virtual bool postSolveRootNode (RelaxationPtr, SolutionPoolPtr, ConstSolutionPtr, ModVector &, ModVector &)
 At the root node post solve the problem and its relaxation. LP based bound tightening (OBBT) is employed here after filtering variables for which no OBBT is required. More...
 
virtual void relaxInitFull (RelaxationPtr rel, SolutionPool *sp, bool *is_inf)=0
 Create root relaxation if doing full node relaxations. More...
 
virtual void relaxInitInc (RelaxationPtr rel, SolutionPool *sp, bool *is_inf)=0
 Create root relaxation if doing incremental node relaxations. More...
 
virtual void relaxNodeFull (NodePtr node, RelaxationPtr rel, bool *is_inf)=0
 Create a relaxation for a node, building from scratch. More...
 
virtual void relaxNodeInc (NodePtr node, RelaxationPtr rel, bool *is_inf)=0
 Create an incremental relaxation for a node. More...
 
virtual void removeCuts (RelaxationPtr, ConstSolutionPtr)
 
virtual void separate (ConstSolutionPtr sol, NodePtr node, RelaxationPtr rel, CutManager *cutman, SolutionPoolPtr s_pool, ModVector &p_mods, ModVector &r_mods, bool *sol_found, SeparationStatus *status)=0
 add cuts to separate a given point. More...
 
virtual void setModFlags (bool mod_prob, bool mod_rel)
 Tell the handler whether the problem will be modified or the relaxation will be modified or both. These modifications will be saved in the tree as well. More...
 
virtual void simplePresolve (ProblemPtr, SolutionPoolPtr, ModVector &, SolveStatus &status)
 
void undoStrongerMods (ProblemPtr p, RelaxationPtr rel, ModVector &p_mods, ModVector &r_mods)
 Undo Modifications made during stronger branching. More...
 
virtual void writeStats (std::ostream &) const
 Write statistics to ostream out. More...
 

Additional Inherited Members

- Protected Attributes inherited from Minotaur::Handler
ConstraintVector cons_
 
bool modProb_
 If true, modify the original (or transformed) problem.
 
bool modRel_
 If true, modify the relaxation of original (or transformed) problem.
 

Detailed Description

KnapCovHandler class considers knapsack cover cuts in the problem. It generates the cuts and manages them.

Member Function Documentation

◆ getBranches()

virtual Branches Minotaur::KnapCovHandler::getBranches ( BrCandPtr  ,
DoubleVector &  ,
RelaxationPtr  ,
SolutionPoolPtr   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ getBranchingCandidates()

virtual void Minotaur::KnapCovHandler::getBranchingCandidates ( RelaxationPtr  ,
const DoubleVector &  ,
ModVector &  ,
BrVarCandSet &  ,
BrCandVector &  ,
bool &   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ getBrMod()

virtual ModificationPtr Minotaur::KnapCovHandler::getBrMod ( BrCandPtr  ,
DoubleVector &  ,
RelaxationPtr  ,
BranchDirection   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ getName()

std::string KnapCovHandler::getName ( ) const
virtual

Return the name of the handler.

Implements Minotaur::Handler.

◆ isFeasible()

bool KnapCovHandler::isFeasible ( ConstSolutionPtr  sol,
RelaxationPtr  relaxation,
bool &  should_prune,
double &  inf_meas 
)
virtual

Check if solution is feasible. Checks all the constraints if they are satisfied by the given solution.

Implements Minotaur::Handler.

◆ KC_knaps()

UInt Minotaur::KnapCovHandler::KC_knaps ( )
inline

Updates the handler statistics by using returned information form cover cut generator.

◆ presolve()

SolveStatus Minotaur::KnapCovHandler::presolve ( PreModQ *  ,
bool *  ,
Solution **   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ presolveNode()

virtual bool Minotaur::KnapCovHandler::presolveNode ( RelaxationPtr  ,
NodePtr  ,
SolutionPoolPtr  ,
ModVector &  ,
ModVector &   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ relaxInitFull()

void Minotaur::KnapCovHandler::relaxInitFull ( RelaxationPtr  ,
SolutionPool ,
bool *   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ relaxInitInc()

void Minotaur::KnapCovHandler::relaxInitInc ( RelaxationPtr  ,
SolutionPool ,
bool *   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ relaxNodeFull()

void Minotaur::KnapCovHandler::relaxNodeFull ( NodePtr  ,
RelaxationPtr  ,
bool *   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ relaxNodeInc()

void Minotaur::KnapCovHandler::relaxNodeInc ( NodePtr  ,
RelaxationPtr  ,
bool *   
)
inlinevirtual

Does nothing.

Implements Minotaur::Handler.

◆ separate()

void KnapCovHandler::separate ( ConstSolutionPtr  sol,
NodePtr  ,
RelaxationPtr  rel,
CutManager cutman,
SolutionPoolPtr  ,
ModVector &  p_mods,
ModVector &  r_mods,
bool *  ,
SeparationStatus status 
)
virtual

We need separation for this handler to generate the knapsack cover cuts. A set of knapsack cover cuts will be generated.

Implements Minotaur::Handler.

◆ writeStats()

void KnapCovHandler::writeStats ( std::ostream &  ) const
virtual

Show statistics.

Reimplemented from Minotaur::Handler.


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