BONMIN#
The COIN Bonmin solver (BONMIN) is an experimental open-source C++ code for solving general MINLP (Mixed Integer NonLinear Programming) problems of the form:
min f(x)
s.t. g_L <= g(x) <= g_U
x_L <= x <= x_U
x_i in Z for all i in I and,
x_i in R for all i not in I.
where f(x): R^n --> R, g(x): R^n --> R^m are twice continuously differentiable functions and I is a subset of {1,..,n}.
The algorithms in Bonmin are exact when the functions f and g are convex; in the case where f or g or both are non-convex they are heuristics.
Learn More | Features | Options
How to use it#
How to install using amplpy:
# Install Python API for AMPL:
$ python -m pip install amplpy --upgrade
# Install AMPL & solver modules:
$ python -m amplpy.modules install bonmin # install BONMIN
# Activate your license (e.g., free ampl.com/ce or ampl.com/academia licenses):
$ python -m amplpy.modules activate <your-license-uuid>
How to use:
from amplpy import AMPL
ampl = AMPL()
...
ampl.solve(solver="bonmin", bonmin_options="option1=value1 option2=value2")
Learn more about what we have to offer to implement and deploy Optimization in Python.
ampl: option solver bonmin; # change the solver
ampl: option bonmin_options 'option1=value1 option2=value2'; # specify options
ampl: solve; # solve the problem
Resources#
Features#
Algorithms#
Algorithms
bonmin.algorithm: B-BB (NLP-based branch-and-bound, default), B-OA
(outer approximation), B-QG (Quesada-Grossmann), B-Hyb (hybrid),
B-Ecp, B-iFP. Exact for convex models, heuristic otherwise. Time
limit: bonmin.time_limit. Ipopt options (for the NLP subproblems) are
also accepted.
ampl: option bonmin_options 'bonmin.algorithm=B-OA bonmin.time_limit=60';
Modeling with MP expressions#
MP expressions: logic, counting, complementarity (MP2NL)
Natively, Bonmin solves smooth nonlinear models with continuous and integer variables. MP’s expressions (==>, or, atmost, count, alldiff, piecewise-linear terms, …) and complements are not part of its native model type: through MP2NL, MP reformulates them into it first.
Call MP2NL as the solver and name Bonmin inside it; MP’s options go into mp2nl_options, Bonmin’s own into bonmin_options.
MP reformulates logic with binary variables, which Bonmin handles as integer variables.
ampl.solve(solver="mp2nl", mp2nl_options="solver=bonmin cvt:compl=1")
ampl: option solver mp2nl;
ampl: option mp2nl_options 'solver=bonmin cvt:compl=1';
ampl: solve;
More: Meta-driver MP2NL.
Solver options#
Full list of solver options:
Retrieving solutions#
The outcome of the last optimization is stored in the AMPL parameter solve_result_num and the relative message in
solve_result.
display solve_result_num, solve_result;
BONMIN solve result codes:
Solve result table (AMPL default ranges)
0- 99 solved: optimal for an optimization problem, feasible for a satisfaction problem
100-199 solved? solution candidate returned but error likely
200-299 infeasible
300-399 unbounded
400-499 limit
500-999 failure, no solution returned