|
Minotaur 0.4.1
Docs for developers
|
Simple multi-start node-processor for branch-and-bound. More...
#include <MsProcessor.h>


Public Member Functions | |
| MsProcessor (EnvPtr env) | |
| Default constructor. | |
| MsProcessor (EnvPtr env, EnginePtr engine, HandlerVector handlers_) | |
| Constructor with a given engine. | |
| ~MsProcessor () | |
| Destroy. | |
| bool | foundNewSolution () |
| Branches | getBranches () |
| Find branches that will be used to branch at this node. | |
| WarmStartPtr | getWarmStart () |
| void | process (NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool) |
| double * | getBoxCorner (UInt n, RelaxationPtr rel1, int threadid, int K) |
| double * | getFarBoxCorner (UInt n, RelaxationPtr rel1, int threadid, double *prev_opt, int K) |
| double * | getStartPointScheme1 (UInt n, RelaxationPtr rel1) |
| double * | getStartPointScheme2 (UInt n, RelaxationPtr rel1, int threadid, double radius, int numsols, double *prev_start_point) |
| double * | getStartPointScheme4 (UInt n, RelaxationPtr rel1, int threadid, double radius, int numsols, double *prev_start_point, double *prev_opt, double costhetalim) |
| double * | getStartPointScheme5 (UInt n, RelaxationPtr rel1, int threadid, double radius, double *prev_start_point, double *prev_opt, int K, double lambda) |
| double * | genInitialPoint (UInt n, RelaxationPtr rel) |
| double | InnerProduct (double b[], double c[], UInt n) |
| double | ENorm (double b[], UInt n) |
| double | EDist (double b[], double c[], UInt n) |
| void | par () |
| void | writeStats (std::ostream &out) const |
| Write statistics to a given output stream. | |
| void | writeStats () const |
| Write statistics to our own logger. | |
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. | |
| virtual BrancherPtr | getBrancher () |
| Return brancher. | |
| virtual void | setCutManager (CutManager *) |
Protected Member Functions | |
| virtual bool | isFeasible_ (NodePtr node, ConstSolutionPtr sol, SolutionPoolPtr s_pool, bool &should_prune) |
| virtual void | solveRelaxation_ () |
| Solve the relaxation. | |
| virtual void | solveRelaxation_ (EnginePtr e1) |
| Solve the relaxation. | |
| virtual bool | shouldPrune_ (NodePtr node, double solval, SolutionPoolPtr s_pool) |
Protected Attributes | |
| std::stack< Modification * > | relMods_ |
| Modifications done to NLP before solving it. | |
| Branches | branches_ |
| Branches found by this processor for this node. | |
| bool | contOnErr_ |
| 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. | |
| EnvPtr | env_ |
| Environment pointer. | |
| HandlerVector | handlers_ |
| All the handlers that are used for this processor. | |
| LoggerPtr | logger_ |
| Log. | |
| UInt | numSolutions_ |
| How many new solutions were found by the processor. | |
| UInt | numRestarts_ |
| Number of restarts to improve the first intial point. | |
| UInt | numThreads_ |
| Number of processing cores to be used by the processor. | |
| RelaxationPtr | relaxation_ |
| Relaxation that is processed by this processor. | |
| UInt | schemeId_ |
| Scheme id for generating initial point. | |
| MBPStats | stats_ |
| Statistics. | |
| WarmStartPtr | ws_ |
| Warm-start information for start processing the children. | |
Protected Attributes inherited from Minotaur::NodeProcessor | |
| BrancherPtr | brancher_ |
| What brancher is used for this processor. | |
Static Protected Attributes | |
| static const std::string | me_ = "MsProcessor: " |
| For logging. | |
Simple multi-start node-processor for branch-and-bound.
MsProcessor is a derived class of NodeProcessor. It is meant to solve a relaxation multiple times at each node using different starting points. It performs only pruning and branching in a node. Does not call any presolving or cutting.
|
virtual |
True if the node processor found at least one feasible solution while processing this node.
Implements Minotaur::NodeProcessor.
| double * MsProcessor::genInitialPoint | ( | UInt | n, |
| RelaxationPtr | rel | ||
| ) |
Generate a starting point and take a direction as the linear combination of active constraint gradients at that point; choose step length based on the function decrease along this direction and average constraint violation.
|
virtual |
Find branches that will be used to branch at this node.
Implements Minotaur::NodeProcessor.
| double * MsProcessor::getStartPointScheme2 | ( | UInt | n, |
| RelaxationPtr | rel1, | ||
| int | threadid, | ||
| double | radius, | ||
| int | numsols, | ||
| double * | prev_start_point | ||
| ) |
Generate a (re)starting point preferably within variable bounds outside a radius (for relaxations)
| double * MsProcessor::getStartPointScheme4 | ( | UInt | n, |
| RelaxationPtr | rel1, | ||
| int | threadid, | ||
| double | radius, | ||
| int | numsols, | ||
| double * | prev_start_point, | ||
| double * | prev_opt, | ||
| double | costhetalim | ||
| ) |
Generate a (re)starting point preferably within variable bounds outside a radius (for relaxations) in a conjugate direction
| double * MsProcessor::getStartPointScheme5 | ( | UInt | n, |
| RelaxationPtr | rel1, | ||
| int | threadid, | ||
| double | radius, | ||
| double * | prev_start_point, | ||
| double * | prev_opt, | ||
| int | K, | ||
| double | lambda | ||
| ) |
Generate a starting point as the convex combination of prev optimal and the farthest box corner from that point.
|
virtual |
Return the warm start information that will be used to start processing children.
Implements Minotaur::NodeProcessor.
|
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.
|
virtual |
Process relaxation at the given node. If a solution is found, it must be added to the solution pool.
Implements Minotaur::NodeProcessor.
|
protectedvirtual |
Check if a node can be pruned either because the relaxation is infeasible or because the cost is too high.
|
virtual |
Write statistics to our own logger.
Reimplemented from Minotaur::NodeProcessor.
|
virtual |
Write statistics to a given output stream.
Reimplemented from Minotaur::NodeProcessor.
|
protected |
If true, we continue to search, if engine reports error. If false, we assume that the relaxation is infeasible when engine returns error.