Software
Solving optimization problems with complementarity constraints
Surprisingly, there are not many software packages that can handle complementarity constraints directly.
- Within the realm of free software, I am only aware of PATH solver. Well, it is not open source and it is not issued under any classical free and open source license. It can be interfaced from Matlab and Julia (and AMPL and GAMS, which are not relevant for our course). For Matlab, compiled mexfiles can be downloaded. For Julia, the solver can be interfaced directly from the popular JuMP package (choosing the PATHSolver.jl solver), see the section on Complementarity constraints and Mixed complementarity problems in JuMP manual.
When restricted to Matlab, there are several options, all of them commercial:
- Optimization Toolbox for Matlab does not offer a specialized solver for complementarity problems. The
fmincon
function can only handle it as a general nonlinear constraint g_1(x)g_2(x)=0, \, g_1(x) \geq 0, \, g_2(x) \geq 0. - Tomlab toolbox has some support for complementarity constraints.
- Knitro solver (by Artelys) has some support for complementarity constraints.
- YALMIP toolbox supports definining the complementarity constraints through the command complements:
F = complements(w >= 0, z >= 0)
. By default, it converts the problem into the format suitable for a mixed-integer solver. If Knitro is available, it can be interfaced.
Gurobi does not seem to support complementarity constraints.
Mosek supports disjunctive constraints, within which complementarity constraints can be formulated. But they are then approached using a mixed-integer solver.
Modeling and simulation of dynamical systems with complementarity constraints
Within the modeling and simulation domains, there are two free and open source libraries that can handle complementarity constraints, mainly motivated by nonsmooth dynamical systems: