Zaphod.jl (Zaphod is an ADMM/Proximal solver for the Homogeneous Self-Dual Embedding) is a simple implementation of an ADMM solver for conic programs interfacing with MathOptInterface (MOI).
Much like Zaphod Beeblebrox, its plan is to remain stupidely simple (following the KISS principle) and let its dependencies do all the work.
It is not meant to be the most efficient but rather to be a good example for learning how to write a solver for JuMP.
The implementation follows quite closely what's described in SCS paper.
The solver is quite similar to SCS and COSMO although SCS and COSMO should be much faster (as their goal is to be fast, not only simple) and they also support quadratic objective.
One important difference is that Zaphod uses MathOptSetDistances.
Therefore, any MOI.AbstractVectorSet
that satisfies the following 5 conditions is automatically supported:
MOI.dual_set
is implementedMathOptSetDistances.projection_on_set
is implementedMOI.Utilities.set_dot
is equivalent toLinearAlgebra.dot
(we could work around this similarly to how Dualization to scaleA'
andb'
of theQ
matrix equation (8) of the SCS paper but for the program to remain self-dual we would actually need to scale bothA'
andA
by the square root of the scaling so it's equivalent to bridging to the scaled version of the cones, see #2)- The set is included in the
SUPPORTED_CONE
Union
insrc/MOI_wrapper.jl
- The set is included in the
Cones
@product_of_sets
insrc/MOI_wrapper.jl
This was used for
- the Implementation of a solver in Julia tutorial in the algorithmic bootcamp of the TraDE-OPT Workshop on Algorithmic and Continuous Optimization in July 2022 and
- the How to write your own conic solver tutorial in the Mathematical Optimization in Julia with JuMP summer school of the 7th International Conference on Continuous Optimization (ICCOPT) in July 2022.
Zaphod.jl
is licensed under the MIT License.
Install Zaphod as follows:
import Pkg
Pkg.add(url="https://github.com/blegat/Zaphod.jl")
To use Zaphod with JuMP, use Zaphod.Optimizer
:
using JuMP, Zaphod
model = Model(Zaphod.Optimizer)
set_attribute(model, "max_iters", 600)
The Zaphod optimizer supports the following constraints and attributes.
List of supported objective functions:
List of supported variable types:
List of supported constraint types:
MOI.VectorAffineFunction{Float64}
inMOI.EqualTo{Float64}
MOI.VectorAffineFunction{Float64}
inMOI.Zeros
MOI.VectorAffineFunction{Float64}
inMOI.Nonnegatives
MOI.VectorAffineFunction{Float64}
inMOI.SecondOrderCone
MOI.VectorAffineFunction{Float64}
inMOI.ExponentialCone
MOI.VectorAffineFunction{Float64}
inMOI.DualExponentialCone
MOI.VectorAffineFunction{Float64}
inMOI.PowerCone
MOI.VectorAffineFunction{Float64}
inMOI.DualPowerCone
MOI.VectorAffineFunction{Float64}
inMOI.Scaled{MOI.PositiveSemidefiniteConeTriangle}
The list of options are
Option name | Default value |
---|---|
max_iters |
100 |
ϵ_primal |
1e-4 |
ϵ_dual |
1e-4 |
ϵ_gap |
1e-4 |
ϵ_unbounded |
1e-7 |
ϵ_infeasible |
1e-7 |