solver  1.0
Classes | Enumerations | Functions
SolverInterface.h File Reference

Solver-independent interface for solving Integer Linear Programming problems. More...

#include <iostream>
#include <string>
#include <vector>
#include "SolverConfig.h"
#include "ILPModel/ILPModel.h"
#include "Shared/Exceptions.h"
#include "Shared/NumericConstants.h"
+ Include dependency graph for SolverInterface.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SolutionILP
 Structure storing a solution of an Integer Linear Programming problem. More...
 

Enumerations

enum  Status {
  ILP_OPTIMAL, ILP_FEASIBLE, ILP_INFEASIBLE, ILP_UNBOUNDED,
  ILP_UNKNOWN
}
 Constants specifying whether a solution is optimal, feasible, infeasible, unbounded, or undefined, respectively.
 

Functions

std::string solverIdentification ()
 Returns an identification of the used solver, e.g. 'Gurobi 6.0.4'.
 
void initializeLocalEnvironments (int numberOfThreads)
 It enables the solver to initialize all the data structures (e.g. expensive to construct) required for flawless performance of multiple threads. More...
 
SolutionILP solveILP (const ILPModel &m, bool verbose, double gap=0.0, double timeLimit=0.0, int numberOfThreads=1, int threadId=0)
 Integer Linear Programming solver is called to solve the problem and the solution is returned. More...
 

Detailed Description

Solver-independent interface for solving Integer Linear Programming problems.

Author
Libor Bukata
Note
Cplex, Gurobi, and lp_solve are currently supported. However, other solvers can be easily added by implementing this interface, i.e. approx. 160 lines of code per solver.

Definition in file SolverInterface.h.

Function Documentation

void initializeLocalEnvironments ( int  numberOfThreads)

It enables the solver to initialize all the data structures (e.g. expensive to construct) required for flawless performance of multiple threads.

Parameters
numberOfThreadsNumber of concurrent threads.

Definition at line 40 of file GurobiSolver.cpp.

SolutionILP solveILP ( const ILPModel m,
bool  verbose,
double  gap = 0.0,
double  timeLimit = 0.0,
int  numberOfThreads = 1,
int  threadId = 0 
)

Integer Linear Programming solver is called to solve the problem and the solution is returned.

Parameters
mInteger Linear Programming problem to be solved.
verboseTrue if the solver should print some information to output, for multi-threading it must be disabled.
gapA solver is stopped if the relative gap from the best bound is achieved.
timeLimitTime limit of a solver, value 0.0 disables the time limit.
numberOfThreadsNumber of threads to be used concurrently.
threadIdThread id, possible values {0, ..., number of threads-1}.
Returns
The best feasible solution if found, otherwise infeasibility is indicated in the state of a solution.

Definition at line 39 of file CplexSolver.cpp.