Nonconvex.jl
is an umbrella package over implementations and wrappers of a number of nonconvex constrained optimization algorithms and packages making use of automatic differentiation. Zero, first and second order methods are available. Nonlinear equality and inequality constraints as well as integer and nonlinear semidefinite constraints are supported. A detailed description of all the algorithms and features available in Nonconvex
can be found in the documentation.
JuliaNonconvex
organizationThe JuliaNonconvex
organization hosts a number of packages which are available for use in Nonconvex.jl
. The correct package is loaded using the Nonconvex.@load
macro with the algorithm or package name. See the documentation for more details. The following is a summary of all the packages in the JuliaNonconvex
organization.
Package | Description | Tests | Coverage |
---|---|---|---|
Nonconvex.jl | Umbrella package for nonconvex optimization | ||
NonconvexCore.jl | All the interface functions and structs | ||
NonconvexMMA.jl | Method of moving asymptotes implementation in pure Julia | ||
NonconvexIpopt.jl | Ipopt.jl wrapper | ||
NonconvexNLopt.jl | NLopt.jl wrapper | ||
NonconvexPercival.jl | Percival.jl wrapper (an augmented Lagrangian algorithm implementation) | ||
NonconvexJuniper.jl | Juniper.jl wrapper | ||
NonconvexPavito.jl | Pavito.jl wrapper | ||
NonconvexSemidefinite.jl | Nonlinear semi-definite programming algorithm | ||
NonconvexMultistart.jl | Multi-start optimization algorithms | ||
NonconvexBayesian.jl | Constrained Bayesian optimization implementation | ||
NonconvexSearch.jl | Multi-trajectory and local search methods | ||
NonconvexAugLagLab.jl | Experimental augmented Lagrangian package | ||
NonconvexUtils.jl | Some utility functions for automatic differentiation, history tracing, implicit functions and more. | ||
NonconvexTOBS.jl | Binary optimization algorithm called "topology optimization of binary structures" (TOBS) which was originally developed in the context of optimal distribution of material in mechanical components. | ||
NonconvexMetaheuristics.jl | Metaheuristic gradient-free optimization algorithms as implemented in Metaheuristics.jl . |
||
NonconvexNOMAD.jl | NOMAD algorithm as wrapped in the NOMAD.jl . |
Nonconvex.jl
is a Julia package that implements and wraps a number of constrained nonlinear and mixed integer nonlinear programming solvers. There are 3 focus points of Nonconvex.jl
compared to similar packages such as JuMP.jl
and NLPModels.jl
:
To install Nonconvex.jl
, open a Julia REPL and type ]
to enter the package mode. Then run:
add Nonconvex
Alternatively, copy and paste the following code to a Julia REPL:
using Pkg; Pkg.add("Nonconvex")
To load and start using Nonconvex.jl
, run:
using Nonconvex
using Nonconvex
Nonconvex.@load NLopt
f(x) = sqrt(x[2])
g(x, a, b) = (a*x[1] + b)^3 - x[2]
model = Model(f)
addvar!(model, [0.0, 0.0], [10.0, 10.0])
add_ineq_constraint!(model, x -> g(x, 2, 0))
add_ineq_constraint!(model, x -> g(x, -1, 1))
alg = NLoptAlg(:LD_MMA)
options = NLoptOptions()
r = optimize(model, alg, [1.0, 1.0], options = options)
r.minimum # objective value
r.minimzer # decision variables
A summary of all the algorithms available in Nonconvex
through different packages is shown in the table below. Scroll right to see more columns and see a description of the columns below the table.
Algorithm name | Is meta-algorithm? | Algorithm package | Order | Finite bounds | Infinite bounds | Inequality constraints | Equality constraints | Semidefinite constraints | Integer variables |
---|---|---|---|---|---|---|---|---|---|
Method of moving asymptotes (MMA) | ❌ | NonconvexMMA.jl (pure Julia) or NLopt.jl |
1 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Primal dual interior point method | ❌ | Ipopt.jl |
1 or 2 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
DIviding RECTangles algorithm (DIRECT) | ❌ | NLopt.jl |
0 | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
Controlled random search (CRS) | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Multi-Level Single-Linkage (MLSL) | Limited | NLopt.jl |
Depends on sub-solver | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
StoGo | ❌ | NLopt.jl |
1 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
AGS | ❌ | NLopt.jl |
0 | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
Improved Stochastic Ranking Evolution Strategy (ISRES) | ❌ | NLopt.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
ESCH | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
COBYLA | ❌ | NLopt.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
BOBYQA | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
NEWUOA | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Principal AXIS (PRAXIS) | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Nelder Mead | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Subplex | ❌ | NLopt.jl |
0 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
CCSAQ | ❌ | NLopt.jl |
1 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
SLSQP | ❌ | NLopt.jl |
1 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
TNewton | ❌ | NLopt.jl |
1 | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
Shifted limited-memory variable-metric | ❌ | NLopt.jl |
1 | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
Augmented Lagrangian in NLopt |
Limited | NLopt.jl |
Depends on sub-solver | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Augmented Lagrangian in Percival |
❌ | Percival.jl |
1 or 2 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Multiple trajectory search | ❌ | NonconvexSearch.jl |
0 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
Branch and bound for mixed integer nonlinear programming | ❌ | Juniper.jl |
1 or 2 | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Sequential polyhedral outer-approximations for mixed integer nonlinear programming | ❌ | Pavito.jl |
1 or 2 | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Evolutionary centers algorithm (ECA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Differential evolution (DE) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Particle swarm optimization (PSO) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Artificial bee colony (ABC) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Gravitational search algorithm (GSA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Simulated annealing (SA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Whale optimization algorithm (WOA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Machine-coded compact genetic algorithm (MCCGA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Genetic algorithm (GA) | ❌ | Metaheuristics.jl |
0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Nonlinear optimization with the MADS algorithm (NOMAD) | ❌ | NOMAD.jl |
0 | ✅ | ✅ | ✅ | Limited | ❌ | ✅ |
Topology optimization of binary structures (TOBS) | ❌ | NonconvexTOBS.jl |
1 | Binary | ❌ | ✅ | ❌ | ❌ | Binary |
Hyperband | ✅ | Hyperopt.jl |
Depends on sub-solver | ✅ | ❌ | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver |
Random search | ✅ | Hyperopt.jl |
Depends on sub-solver | ✅ | ❌ | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver |
Latin hypercube search | ✅ | Hyperopt.jl |
Depends on sub-solver | ✅ | ❌ | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver |
Surrogate assisted optimization | ✅ | NonconvexBayesian.jl |
Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver |
Log barrier method for nonlinear semidefinite constraint handling | ✅ | NonconvexSemidefinite.jl |
Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | Depends on sub-solver | ✅ | Depends on sub-solver |
The following is an explanation of all the columns in the table:
NLopt
have a "Limited" meta-algorithm status because they can only be used to wrap algorithms from NLopt
.Nonconvex
wraps all these packages using a consistent API while allowing each algorithm to be customized where possible and have its own set of options.TOBS
algorithm which only supports binary decision variables so an entry of "Binary" is used instead of true/false.TOBS
algorithm which only supports binary decision variables so an entry of "Binary" is used instead of true/false.A beginner? The easiest way to contribute is to read the documentation, test the package and report issues.
An impulsive tester? Improving the test coverage of any package is another great way to contribute to the JuliaNonconvex
org. Check the coverage report of any of the packages above by clicking the coverage badge. Find the red lines in the report and figure out tests that would cover these lines of code.
An algorithm head? There are plenty of optimization algorithms that can be implemented and interfaced in Nonconvex.jl
. You could be developing the next big nonconvex semidefinite programming algorithm right now! Or the next constraint handling method for evolutionary algorithms!
A hacker? Let's figure out how to wrap some optimization package in Julia in the unique, simple and nimble Nonconvex.jl
style.
A software designer? Let's talk about design decisions and how to improve the modularity of the ecosystem.
You can always reach out by opening an issue.
If you use Nonconvex.jl for your own research, please consider citing the following publication: Mohamed Tarek. Nonconvex.jl: A Comprehensive Julia Package for Non-Convex Optimization. 2023. doi: 10.13140/RG.2.2.36120.37121.
@article{MohamedTarekNonconvexjl,
doi = {10.13140/RG.2.2.36120.37121},
url = {https://rgdoi.net/10.13140/RG.2.2.36120.37121},
author = {Tarek, Mohamed},
language = {en},
title = {Nonconvex.jl: A Comprehensive Julia Package for Non-Convex Optimization},
year = {2023}
}