|
Minotaur 0.4.1
Docs for developers
|
A MultilinearHandler handles terms like 
#include <MultilinearHandler.h>


Public Member Functions | |
| MultilinearHandler (EnvPtr env, ProblemPtr problem) | |
| Default constructor. | |
| virtual | ~MultilinearHandler () |
| Destroy. | |
| bool | findOriginalVariable (ConstVariablePtr rv, ConstVariablePtr &ov) const |
| virtual void | getBranchingCandidates (RelaxationPtr rel, const DoubleVector &x, ModVector &mods, BrVarCandSet &cands, BrCandVector &gencands, bool &is_inf) |
| bool | isFeasible (ConstSolutionPtr, RelaxationPtr, bool &should_prune, double &inf_meas) |
| void | relax (RelaxationPtr relaxation, bool &isInfeasible) |
| void | relaxInitFull (RelaxationPtr, bool *) |
| void | relaxInitInc (RelaxationPtr, bool *) |
| void | relaxNodeFull (NodePtr, RelaxationPtr, bool *) |
| Create a relaxation for a node, building from scratch. | |
| void | relaxNodeInc (NodePtr, RelaxationPtr, bool *) |
| Create an incremental relaxation for a node. | |
| void | relaxNode (NodePtr node, RelaxationPtr relaxation, bool &isInfeasible) |
| std::map< std::vector< ConstVariablePtr >, ConstVariablePtr > | getRevMlterms () |
| std::map< ConstVariablePtr, std::vector< ConstVariablePtr > > | getMlterms () |
| std::map< ConstVariablePtr, UInt > | getMaxPow () |
| std::map< ConstVariablePtr, ConstVariablePair > | getBlterms () |
| std::map< ConstVariablePair, ConstVariablePtr > | getRevBlterms () |
| std::map< VarIntMap, ConstVariablePtr > | getMonomialterms () |
| std::map< ConstVariablePtr, ConstVariablePair > | getSqterms () |
| std::map< ConstVariablePair, ConstVariablePtr > | getRevSqterms () |
| std::vector< std::vector< ConstVariablePtr > > | getGroups () |
| std::vector< std::vector< ConstVariablePtr > > | getAllLambdas () |
| std::map< ConstVariablePtr, ConstVariablePtr > | getOriginalVariablesMap () |
| std::map< ConstVariablePtr, ConstVariablePtr > | getRevOriginalVariablesMap () |
| std::map< ConstVariablePtr, std::vector< ConstVariablePtr > > | getNewCopyVariables () |
| std::map< VarIntMap, ConstVariablePtr > | getMonomialTerms () |
| std::map< ConstVariablePair, ConstVariablePtr > | getRevBilinearTerms () |
| void | separate (ConstSolutionPtr, NodePtr, RelaxationPtr, CutManager *, SolutionPoolPtr, bool *, SeparationStatus *) |
| Can not return any cuts for this case. | |
| virtual ModificationPtr | getBrMod (BrCandPtr, DoubleVector &, RelaxationPtr, BranchDirection) |
| Get the modifcation that creates a given (up or down) branch. | |
| virtual Branches | getBranches (BrCandPtr cand, DoubleVector &x, RelaxationPtr rel, SolutionPoolPtr s_pool) |
| Return branches for branching. | |
| virtual SolveStatus | presolve (PreModQ *, bool *changed, Solution **) |
| Initial presolve. | |
| virtual bool | presolveNode (RelaxationPtr, NodePtr, SolutionPoolPtr, ModVector &, ModVector &) |
| Presolve the problem and its relaxation at a node. | |
| std::string | getName () const |
| Return the name of the handler. | |
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. | |
| virtual ConstraintVector::const_iterator | consBegin () const |
| virtual ConstraintVector::const_iterator | consEnd () const |
| virtual int | fixNodeErr (RelaxationPtr, ConstSolutionPtr, SolutionPoolPtr, bool &) |
| 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 | isNeeded () |
| Return true if this handler is needed for the problem. | |
| 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. | |
| virtual void | relaxInitFull (RelaxationPtr rel, SolutionPool *sp, bool *is_inf)=0 |
| Create root relaxation if doing full node relaxations. | |
| virtual void | relaxInitInc (RelaxationPtr rel, SolutionPool *sp, bool *is_inf)=0 |
| Create root relaxation if doing incremental node relaxations. | |
| 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. | |
| 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. | |
| 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. | |
| virtual void | writeStats (std::ostream &) const |
| Write statistics to ostream out. | |
Protected Attributes | |
| EnvPtr | env_ |
| Environment. | |
| ConstProblemPtr | problem_ |
| ProblemPtr | workingProblem_ |
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. | |
A MultilinearHandler handles terms like 
|
inline |
Return the lambda variables introduced for the Grouped Convex Hull relaxation
|
inline |
Retrun the blterms_
|
virtual |
Return branches for branching.
Get branches by branching on the given candidate. In the general scheme for branching, we store only bound changes, though we are also capable of storing other mods.
| [in] | cand | Candidate on which the brancher wants to branch. |
| [in] | x | The solution of the relaxation at the current node. |
| [in] | rel | The relaxation at the current node. |
| [in] | s_pool | Best feasible solutions found so far. |
Implements Minotaur::Handler.
|
virtual |
Both 
Implements Minotaur::Handler.
|
virtual |
Get the modifcation that creates a given (up or down) branch.
If one branch is pruned by the brancher (e.g. strong brancher), then we can apply the modifications of other branch to the relaxation without branching. This routine returns such a modification. This function is also called for obtaining modifications for strong branching on a candidate.
| [in] | cand | The candidate for which we want the modification. |
| [in] | x | The solution of relaxation at current node. |
| [in] | rel | The relaxation at current node. |
| [in] | dir | The Direction for which we want the modification, Up or Down?. |
Implements Minotaur::Handler.
|
inline |
Return the groups of variables that are made for the Grouped Convex Hull relaxation
|
inline |
Retrun the max_pow_
|
inline |
Return mlterms_
|
inline |
Retrun the monomial_terms__
|
inline |
Retrun the map of monomial terms
|
virtual |
Return the name of the handler.
Implements Minotaur::Handler.
|
inline |
Return the map between the original variables and the copy variables for its exponents
|
inline |
Return the map between the original variables and the variables in the relaxation
|
inline |
Return the map of bilinear terms (map of a variable pair and a substiture variable)
|
inline |
Retrun the rev_blterms_
|
inline |
Return rev_mlterms_
|
inline |
Return the REVERSE map between the original variables and the variables in the relaxation
|
inline |
Retrun the rev_sqterms_
|
inline |
Retrun the sqterms_
|
virtual |
Check if each multilinear constraint is satisfied. Stops on the first violated constraint.
Implements Minotaur::Handler.
|
inlinevirtual |
Initial presolve.
Do the initial presolve. For now we will assume that presolve modifies the given problem. We do not create a new problem. All modifications that require post-processing for getting the solution back are prepended to 'pre_mods' by the handler.
| [in] | pre_mods | A pointer to a queue of PreMod objects. Modifications made by the presolver must be prepended (not appended) to pre_mods. The order is important for post-solve. |
| [out] | changed | True if the presolve modified the problem. |
| [out] | sol | Optimal solution found by the handler, if any. The status must be SolvedOptimal if and only if sol is created. |
Implements Minotaur::Handler.
|
inlinevirtual |
Presolve the problem and its relaxation at a node.
Presolve the problem and its relaxation at a given node. Bound propagation and other simple modifications can be made in this function. It is called after the node relaxation is setup but before it is solved. Both the problem and its relaxation are presolved. Changes to the problem are stored in the tree. Changes to the relaxation are optional and may or may not be stored in the tree.
| [in] | rel | Relaxation at the current node. |
| [in] | node | Current node. |
| [in] | s_pool | Pool of solutions. |
| [in] | p_mods | Unused. Modifications to the problem that must be stored in this node so that they are applied to all descendant nodes as well. All modifications must be appended not prepended. |
| [out] | r_mods | Modifications to the relaxation that must be stored in this node so that they are applied to all descendant nodes as well. All modifications must be appended not prepended. This may be unnecessary in certain algorithms. |
Implements Minotaur::Handler.
|
inlinevirtual |
Create a relaxation for a node, building from scratch.
Create a relaxation of the constraints. Either this method, or relaxNodeInc should be called at each node. Here, we only make minor modifications to the same relaxation.
| [in] | node | is the node for which relaxation is to be created. |
| [in] | rel | is the relaxation that is being constructed. Do not allocate or re-allocate space for it. Just add new variables or constraints to it. |
| [out] | is_inf | is true if the node can be pruned. |
Implements Minotaur::Handler.
|
inlinevirtual |
Create an incremental relaxation for a node.
Create a relaxation of the constraints. Either this method, or nodeRelaxFull relax should be called at root node. Usually we only make minor modifications to the same relaxation.
| [in] | node | is the node for which relaxation is to be created. |
| [in] | rel | is the relaxation that is being constructed. Do not allocate or re-allocate space for it. Just add new variables or constraints to it. |
| [out] | is_inf | is true if the node can be pruned. |
Implements Minotaur::Handler.