Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Minotaur::ParPCBProcessor Class Reference

Default node processor used in solver for now. More...

#include <ParPCBProcessor.h>

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

Public Member Functions

 ParPCBProcessor ()
 Default constructor.
 
 ParPCBProcessor (EnvPtr env, EnginePtr engine, HandlerVector handlers_)
 Constructor with a given engine.
 
 ~ParPCBProcessor ()
 Destroy.
 
void addHeur (HeurPtr h)
 
bool foundNewSolution ()
 
Branches getBranches ()
 Find branches that will be used to branch at this node. More...
 
CutManagergetCutManager ()
 
ConstSolutionPtr getSolution ()
 
WarmStartPtr getWarmStart ()
 
void process (NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
 
void process (NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool, bool init, UIntVector timesUp, UIntVector timesDown, DoubleVector pseudoUp, DoubleVector pseudoDown, UInt nodesProc)
 Process a node. More...
 
void setCutManager (CutManager *cutman)
 
void writeStats (std::ostream &out) const
 Write statistics to a given output stream. More...
 
void writeStats () const
 Write statistics to our own logger. More...
 
- Public Member Functions inherited from Minotaur::NodeProcessor
 NodeProcessor ()
 Default constructor.
 
virtual ~NodeProcessor ()
 Destroy.
 
virtual void setBrancher (BrancherPtr brancher)
 Set the brancher that will be used with this node processor.
 
virtual void processRootNode (NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
 Process the root node. More...
 
virtual void process (NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)=0
 
virtual Branches getBranches ()=0
 Find branches that will be used to branch at this node. More...
 
virtual bool foundNewSolution ()=0
 
virtual WarmStartPtr getWarmStart ()=0
 
virtual BrancherPtr getBrancher ()
 Return brancher.
 
virtual void writeStats (std::ostream &) const
 Write statistics to a given output stream. More...
 
virtual void writeStats () const
 Write statistics to our own logger. More...
 
virtual void setCutManager (CutManager *)
 

Protected Member Functions

virtual bool isFeasible_ (NodePtr node, ConstSolutionPtr sol, SolutionPoolPtr s_pool, bool &should_prune)
 
virtual bool presolveNode_ (NodePtr node, SolutionPoolPtr s_pool)
 Presolve a node.
 
virtual void solveRelaxation_ ()
 Solve the relaxation.
 
virtual bool shouldPrune_ (NodePtr node, double solval, SolutionPoolPtr s_pool)
 
void separate_ (ConstSolutionPtr sol, NodePtr node, SolutionPoolPtr s_pool, SeparationStatus *status)
 Separate the given point from the node relaxation. More...
 
virtual void tightenBounds_ ()
 

Protected Attributes

Branches branches_
 Branches found by this processor for this node.
 
bool contOnErr_
 
CutManagercutMan_
 The cut manager.
 
double cutOff_
 If lb is greater than cutOff_, we can prune this node.
 
EnginePtr engine_
 Engine used to process the relaxation.
 
EngineStatus engineStatus_
 Status of the engine.
 
HandlerVector handlers_
 All the handlers that are used for this processor.
 
HeurVector heurs_
 Heuristics that can be called at each node.
 
LoggerPtr logger_
 Log.
 
int presFreq_
 
UInt numSolutions_
 How many new solutions were found by the processor.
 
RelaxationPtr relaxation_
 Relaxation that is processed by this processor.
 
ParNodeStats stats_
 Statistics.
 
WarmStartPtr ws_
 Warm-start information for start processing the children.
 
double oATol_
 Absolute tolerance for pruning a node on basis of bounds.
 
double oRTol_
 Relative tolerance for pruning a node on basis of bounds.
 
- Protected Attributes inherited from Minotaur::NodeProcessor
BrancherPtr brancher_
 What brancher is used for this processor.
 

Static Protected Attributes

static const std::string me_ = "ParPCBProcessor: "
 For logging.
 

Friends

class ParBranchAndBound
 
class ParQGBranchAndBound
 

Detailed Description

Default node processor used in solver for now.

PCBProcessor is a derived class of NodeProcessor. It is meant to solve LPs at each node. It is used in a simple MILP branch-and-bound. As a stop-gap measure, it is being used for MINLP branch-and-bound as well.

Member Function Documentation

◆ foundNewSolution()

bool ParPCBProcessor::foundNewSolution ( )
virtual

True if the node processor found at least one feasible solution while processing this node.

Implements Minotaur::NodeProcessor.

◆ getBranches()

Branches ParPCBProcessor::getBranches ( )
virtual

Find branches that will be used to branch at this node.

Implements Minotaur::NodeProcessor.

◆ getWarmStart()

WarmStartPtr ParPCBProcessor::getWarmStart ( )
virtual

Return the warm start information that will be used to start processing children.

Implements Minotaur::NodeProcessor.

◆ isFeasible_()

bool ParPCBProcessor::isFeasible_ ( NodePtr  node,
ConstSolutionPtr  sol,
SolutionPoolPtr  s_pool,
bool &  should_prune 
)
protectedvirtual

Check if the solution is feasible to the original problem. In case it is feasible, we can store the solution and update the upper bound. Additionally, if the solution is optimal for the current node, then the node can be pruned.

◆ process() [1/2]

void ParPCBProcessor::process ( NodePtr  node,
RelaxationPtr  rel,
SolutionPoolPtr  s_pool 
)
virtual

Process relaxation at the given node. If a solution is found, it must be added to the solution pool.

Implements Minotaur::NodeProcessor.

◆ process() [2/2]

void ParPCBProcessor::process ( NodePtr  node,
RelaxationPtr  rel,
SolutionPoolPtr  s_pool,
bool  init,
UIntVector  timesUp,
UIntVector  timesDown,
DoubleVector  pseudoUp,
DoubleVector  pseudoDown,
UInt  nodesProc 
)

Process a node.

Parameters
[in]initis true if pseudocosts have been initialized

◆ separate_()

void ParPCBProcessor::separate_ ( ConstSolutionPtr  sol,
NodePtr  node,
SolutionPoolPtr  s_pool,
SeparationStatus status 
)
protected

Separate the given point from the node relaxation.

Call each handler and generate cuts. Cuts could be local or global. Local cuts must be added to the node (not implemented yet). Global cuts must be added to a global pool (not implemented yet). Separation status is SepPrune if there is no further need to solve the subproblem. It is SepResolve if the relaxation needs to be resolved.

◆ setCutManager()

void ParPCBProcessor::setCutManager ( CutManager cutman)
virtual

Reimplemented from Minotaur::NodeProcessor.

◆ shouldPrune_()

bool ParPCBProcessor::shouldPrune_ ( NodePtr  node,
double  solval,
SolutionPoolPtr  s_pool 
)
protectedvirtual

Check if a node can be pruned either because the relaxation is infeasible or because the cost is too high.

◆ writeStats() [1/2]

void ParPCBProcessor::writeStats ( ) const
virtual

Write statistics to our own logger.

Reimplemented from Minotaur::NodeProcessor.

◆ writeStats() [2/2]

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

Write statistics to a given output stream.

Reimplemented from Minotaur::NodeProcessor.

Member Data Documentation

◆ contOnErr_

bool Minotaur::ParPCBProcessor::contOnErr_
protected

If true, we continue to search, if engine reports error. If false, we assume that the relaxation is infeasible when engine returns error.

◆ presFreq_

int Minotaur::ParPCBProcessor::presFreq_
protected

How frequently should node-presolve be called? If 1, then call at all nodes. If 0, then never. If 4, then every fourth node, etc.


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