CONOPT#

A proven choice for highly nonlinear problems, CONOPT’s efficient and reliable multi-method architecture handles a broad range of models. Specialized techniques achieve feasibility quickly, while powerful preprocessing tools reduce problem size and suggest formulation improvements.

Product Page | Features | Options | Changes

Download CONOPT | Start a CONOPT Trial Now!

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 conopt # install CONOPT

# 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="conopt", conopt_options="option1=value1 option2=value2")

Learn more about what we have to offer to implement and deploy Optimization in Python.

AMPL APIs give access to AMPL from a programming language:

ampl: option solver conopt; # change the solver
ampl: option conopt_options 'option1=value1 option2=value2'; # specify options
ampl: solve; # solve the problem

Features#

Algorithms#

Generalized reduced gradient (local)

CONOPT is an active-set method (GRG with SLP and SQP phases, flg_slpmode, flg_sqpmode); it returns local optima, and it treats integer variables as continuous. Limits: maxftime (seconds), iterlim. flg_convex=1 declares the model convex.

Modeling with MP expressions#

MP expressions: logic, counting, complementarity (MP2NL)

Natively, CONOPT solves smooth nonlinear models with continuous 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.

The CONOPT driver includes the MP2NL bridge: set mp2nl=1 in conopt_options. MP’s own options (cvt:..., sol:chk:...) then go into the AMPL option mp_options.

CONOPT is a continuous solver: it relaxes the binary variables that MP uses for logical constraints, and the result can violate the logic (MP’s solution check then reports it). Use it for constructs that need no binaries, such as complementarity with a smooth reformulation (cvt:compl=1 or 2); use an MINLP solver for models with logic.

ampl.solve(solver="conopt", conopt_options="mp2nl=1", mp_options="cvt:compl=1")
ampl: option solver conopt;
ampl: option conopt_options 'mp2nl=1';
ampl: option mp_options 'cvt:compl=1';
ampl: solve;

More: Meta-driver MP2NL.

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;

CONOPT 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

Changelog#