MipSolver

Declared in lemon/lp_base.h, in the group LP and MIP Solvers; the same class on the Doxygen site.

class MipSolver : public virtual LpBase

Common base class for MIP solvers.

This class is an abstract base class for MIP solvers. This class provides a full interface for set and modify an MIP problem, solve it and retrieve the solution. You can use one of the descendants as a concrete implementation, or the Lp default MIP solver. However, if you would like to handle MIP solvers as reference or pointer in a generic way, you can use this class directly.

Subclassed by CbcMip, CplexMip, GlpkMip, MipSkeleton

Set Column Type

enum ColTypes

Possible variable (column) types (e.g. real, integer, binary etc.).

Values:

enumerator REAL

= 0. Continuous variable (default).

enumerator INTEGER

= 1. Integer variable.

inline void colType( Col c , ColTypes col_type )

Sets the type of the given column to the given type.

inline ColTypes colType( Col c ) const

Gives back the type of the column.

Solve the MIP

inline SolveExitStatus solve()

SolveExitStatus.

Solve the MIP problem at hand

Returns:

The result of the optimization procedure. Possible values and their meanings can be found in the documentation of

Obtain the Solution

inline ProblemType type() const

The type of the MIP problem.

inline Value sol( Col c ) const

Return the value of the row in the solution.

Pre:

The problem is solved.

inline Value sol( const Expr & e ) const

Return the value of the expression in the solution.

Return the value of the expression in the solution, i.e. the dot product of the solution and the expression.

Pre:

The problem is solved.

inline Value solValue() const

The value of the objective function.

Returns:

  • INF or -INF means either infeasibility or unboundedness of the problem, depending on whether we minimize or maximize.

  • NaN if no primal solution is found.

  • The (finite) objective value if an optimal solution is found.

Public Types

enum ProblemType

The problem types for MIP problems.

Values:

enumerator UNDEFINED

= 0. Feasible solution hasn’t been found (but may exist).

enumerator INFEASIBLE

= 1. The problem has no feasible solution.

enumerator FEASIBLE

= 2. Feasible solution found.

enumerator OPTIMAL

= 3. Optimal solution exists and found.

enumerator UNBOUNDED

= 4. The cost function is unbounded. The Mip or at least the relaxed problem is unbounded.

Public Functions

virtual MipSolver * newSolver() const = 0

Allocate a new MIP problem instance.

virtual MipSolver * cloneSolver() const = 0

Make a copy of the MIP problem.

Protected Functions

virtual SolveExitStatus _solve() = 0
virtual ColTypes _getColType( int col ) const = 0
virtual void _setColType( int col , ColTypes col_type ) = 0
virtual ProblemType _getType() const = 0
virtual Value _getSol( int i ) const = 0
virtual Value _getSolValue() const = 0