First and second order mixed integer nonlinear programming algorithms
Description
There are 2 first and second order MINLP solvers available in Nonconvex:
- Juniper.jl with Ipopt.jl as a sub-solver.
NonconvexJuniper.jlallows the use of the branch and bound algorithm inJuniper.jlusing theJuniperIpoptAlgstruct. - Pavito.jl with Ipopt.jl and Cbc.jl as sub-solvers.
NonconvexPavito.jlallows the use of the sequential polyhedral outer-approximations algorithm inPavito.jlusing thePavitoIpoptCbcAlgstruct.
Juniper + Ipopt
Quick start
Given a model model and an initial solution x0, the following can be used to optimize the model using Juniper and Ipopt.
using Nonconvex
Nonconvex.@load Juniper
alg = JuniperIpoptAlg()
options = JuniperIpoptOptions()
result = optimize(model, alg, x0, options = options)Juniper is an optional dependency of Nonconvex, so you need to load it in order to use it. Note that the integer constraints must be specified when defining variables. See the problem definition documentation for more details.
Construct an instance
To construct an instance of the Juniper + Ipopt algorithm, use:
alg = JuniperIpoptAlg()Options
The options keyword argument to the optimize function shown above must be an instance of the JuniperIpoptOptions struct when the algorihm is a JuniperIpoptAlg. To specify options use, keyword arguments in the constructor of JuniperIpoptOptions, e.g:
options = JuniperIpoptOptions(first_order = false, linear_constraints = true, subsolver_options = IpoptOptions(), atol = 1e-4)There are 3 important and special options you can pass to the optimizer:
first_order:trueby default. Whenfirst_orderistrue, the first order Ipopt algorithm will be used. And when it isfalse, the second order Ipopt algorithm will be used.linear_constraints:falseby default. Whenlinear_constraintsistrue, the Jacobian of the constraints will be computed and sparsified once at the beginning. When it isfalse, dense Jacobians will be computed in every iteration.subsolver_options: an instance ofIpoptOptionsto be used in the Ipopt sub-solver.
All the other options to Juniper can be found in the Juniper documentation.
Pavito + Ipopt + Cbc
Quick start
Given a model model and an initial solution x0, the following can be used to optimize the model using Juniper and Ipopt.
using Nonconvex
Nonconvex.@load Pavito
alg = PavitoIpoptCbcAlg()
options = PavitoIpoptCbcOptions()
result = optimize(model, alg, x0, options = options)Pavito is an optional dependency of Nonconvex, so you need to load it in order to use it. Note that the integer constraints must be specified when defining variables. See the problem definition documentation for more details.
Construct an instance
To construct an instance of the Pavito + Ipopt + Cbc algorithm, use:
alg = PavitoIpoptCbcAlg()Options
The options keyword argument to the optimize function shown above must be an instance of PavitoIpoptCbcOptions struct when the algorithm is a PavitoIpoptCbcAlg. To specify options, use keyword arguments in the constructor of JuniperIpoptOptions or PavitoIpoptCbcOptions, e.g:
options = PavitoIpoptCbcOptions(first_order = false, subsolver_options = IpoptOptions(), timeout = 120.0)There are 2 important and special options you can pass to the optimizer:
first_order:trueby default. Whenfirst_orderistrue, the first order Ipopt algorithm will be used. And when it isfalse, the second order Ipopt algorithm will be used.subsolver_options: an instance ofIpoptOptionsto be used in the Ipopt sub-solver.
All the other options to Pavito can be found in the Pavito documentation.