This library includes:
- CMake wrappers for mathematical optimization solvers.
- A mixed-integer linear programming modeler
- A box-constrained nonlinear programming modeler (for Lagrangian relaxations)
The goal of the modelers are:
- Minimize the modeler's overhead
- Run multiple solvers while writing the model's code once and ensuring that the model passed to each solver is the same
- Keep access to all the direct API features of the solvers
- Minimize the quantity of code to integrate a new solver
- Provide some features to help model debugging
They are not designed to be as user-friendly as possible. And switching solver requires a bit more lines of code than changing a string.
Milp modeler examples:
- Multiple-choice knapsack
- Set covering
- Generalized assignment
- Clique, stable
- Knapsack with conflicts
- Graph coloring
- Shop scheduling, positional model, disjunctive model
CMake integration example:
# Fetch fontanf/mathoptsolverscmake.
set(MATHOPTSOLVERSCMAKE_USE_CLP ON)
FetchContent_Declare(
mathoptsolverscmake
GIT_REPOSITORY https://github.com/fontanf/mathoptsolverscmake.git
GIT_TAG ...)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../mathoptsolverscmake/")
FetchContent_MakeAvailable(mathoptsolverscmake)
...
target_link_libraries(MyProject_my_target PUBLIC
MathOptSolversCMake::clp)