List of all members | Public Member Functions | Protected Member Functions
ipo::SCIPOracle Class Reference

Detailed Description

An oracle for the convex hull of the solutions returned by the SCIP instance. The computed floating-point solutions are turned into rational ones using rational-reconstruction techniques. This may in principle lead to infeasible solutions, in particular if continuous solutions are present. To produce correct solutions one may use a MixedIntegerProgramCorrectorOracle that postprocesses the solutions.

An instance is either constructed from a SCIP instance or from a MIP.

#include <ipo/scip_oracles.h>

+ Inheritance diagram for ipo::SCIPOracle:

Public Member Functions

 SCIPOracle (const std::string &name, SCIP *originalSCIP, const std::shared_ptr< OracleBase > &nextOracle=NULL)
 Constructs a SCIP oracle with given name, optionally associated to nextOracle. More...
 
 SCIPOracle (const std::string &name, const std::shared_ptr< MixedIntegerSet > &mixedIntegerSet, const std::shared_ptr< OracleBase > &nextOracle=NULL)
 Constructs a SCIP oracle with given name in given space. More...
 
virtual ~SCIPOracle ()
 Destructor.
 
virtual void setFace (const LinearConstraint &newFace=completeFace())
 Restricts the oracle to the face defined by newFace. More...
 
- Public Member Functions inherited from ipo::OracleBase
const std::string & name () const
 Returns the name of the oracle. More...
 
const Spacespace () const
 Returns the ambient space. More...
 
std::size_t heuristicLevel () const
 Returns the heuristic level of this oracle. More...
 
void maximize (OracleResult &result, const soplex::VectorRational &objective, const ObjectiveBound &objectiveBound=ObjectiveBound(), std::size_t minHeuristic=0, std::size_t maxHeuristic=std::numeric_limits< std::size_t >::max())
 Runs the oracle to maximize the dense rational objective. More...
 
void maximize (OracleResult &result, const Vector &objective, const ObjectiveBound &objectiveBound=ObjectiveBound(), std::size_t minHeuristic=0, std::size_t maxHeuristic=std::numeric_limits< std::size_t >::max())
 Runs the oracle to maximize the sparse rational objective. More...
 

Protected Member Functions

std::shared_ptr< MixedIntegerSetconstructFromSCIP (SCIP *originalSCIP)
 Runs the oracle to maximize the dense rational objective. More...
 
- Protected Member Functions inherited from ipo::MIPOracleBase
 MIPOracleBase (const std::string &name, const std::shared_ptr< OracleBase > &nextOracle=NULL)
 Constructs the oracle. More...
 
virtual ~MIPOracleBase ()
 Destructor. More...
 
void initialize (const std::shared_ptr< MixedIntegerSet > &mixedIntegerSet)
 Initializes the oracle for the given mixedIntegerSet. More...
 
virtual std::size_t maximizeImplementation (OracleResult &result, const soplex::VectorRational &objective, const ObjectiveBound &objectiveBound, std::size_t minHeuristic, std::size_t maxHeuristic, bool &sort, bool &checkDups)
 Initializes the LP and solver. More...
 
virtual void separatePoint (const soplex::VectorRational &point, soplex::LPRowSetRational &cuts)
 Method that can add lazy inequalities that cut off a given point. More...
 
virtual void separateRay (const soplex::VectorRational &ray, soplex::LPRowSetRational &cuts)
 Method that can add lazy inequalities that cut off a given ray. More...
 
- Protected Member Functions inherited from ipo::OracleBase
 OracleBase (const std::string &name, const std::shared_ptr< OracleBase > &nextOracle=NULL)
 Constructs an oracle with given name, optionally associated to nextOracle. More...
 
void initializeSpace (const Space &space)
 Initializes datastructures that require the oracle's ambient space. More...
 
virtual std::size_t maximizeController (OracleResult &result, const soplex::VectorRational &objective, const ObjectiveBound &objectiveBound, std::size_t maxHeuristic, std::size_t minHeuristic, bool &sort, bool &checkDups)
 Wrapper method that calls the oracle's implementation. More...
 
virtual const LinearConstraintcurrentFace ()
 Returns the current face. More...
 

Constructor & Destructor Documentation

ipo::SCIPOracle::SCIPOracle ( const std::string &  name,
SCIP *  originalSCIP,
const std::shared_ptr< OracleBase > &  nextOracle = NULL 
)

Constructs a SCIP oracle with given name that is optionally associated to nextOracle. The ambient space is equal defined via the originalSCIP instance (and must be equal to that of nextOracle). The oracle is implemented by calling SCIP on a copy of the given originalSCIP instance.

ipo::SCIPOracle::SCIPOracle ( const std::string &  name,
const std::shared_ptr< MixedIntegerSet > &  mixedIntegerSet,
const std::shared_ptr< OracleBase > &  nextOracle = NULL 
)

Constructs a SCIP oracle with given name that is optionally associated to nextOracle. The ambient space is equal to that of nextOracle and of the space of the given mixedIntegerSet. The oracle is implemented by calling SCIP in order to solve mixed-integer programs over the mixedIntegerSet.

Member Function Documentation

virtual void ipo::SCIPOracle::setFace ( const LinearConstraint newFace = completeFace())
virtual

Restricts the optimization oracle to the face $ F $ of $ P $ defined by newFace. For newFace equal to NULL we define $ F := P $.

This implementation adds an equation to the underlying SCIP instance.

Reimplemented from ipo::MIPOracleBase.

std::shared_ptr<MixedIntegerSet> ipo::SCIPOracle::constructFromSCIP ( SCIP *  originalSCIP)
protected

Runs the optimization oracle to maximize the given dense rational objective over the current face $ F $ (see setFace()) and returns result. If maxHeuristic is less than thisHeuristic() or if the objective value requested by objectiveBound is not exceeded, then the call must be forwarded to the next oracle.

Parameters
resultAfter the call, contains the oracle's answer.
objectiveObjective vector $ c \in \mathbb{Q}^n $ to be maximized.
objectiveBoundObjective value $ \gamma $ that should be exceeded.
maxHeuristicRequested maximum heuristic level.
minHeuristicRequested minimum heuristic level.

This implementation calls SCIP and reconstructs rational solutions from the returned floating-point ones.