Kelley is a Julia package that uses an acceleration of cutiing planes method created by J. E. Kelley, Jr. to solve convex optimization problem with linear objective function. Also, this package uses the HiGHS Optimizer for Linear Programming, from JuMP.
julia> Pkg.add("https://github.com/brunomattos1/Kelley.git")
julia> import Kelley
julia> using Kelley
Let
Then, minimize
Let
Now, minimize
Repeat, until
Remark 1: The subproblems minimization (
Remark 2: The algorithm creates a cut for each violated constraint, instead of creating only one cut, for the most violated constraint, as Kelley proposed.
You must create your constraints functions as a unique function
And your objective function
The call of the function is given by
optimize!(KelleyAlgorithm(), f, g, number of variables, lb, ub)
Where lb and ub are lower and upper bounds of the variables. You must pass the bounds as a vector of floats, e.g, lb=[0.0, 1.0], ub=[2.3, 3.14]. As default, the bounds are set to be -1e6 and 1e6.
The output gives the objective value and the approximated optimal solution.
The stop criterion is the following:
Let
Remark 3: If the model contains more than 10000 constraint, the algorithm deletes the 3000 furthest of the current solution. Note: We lost convergence.
Let
f(x)=return x[1]-x[2]
g(x)=return[
x[1]^2 + (x[2]^2)/4 - 1, #first constraint
x[1]^2/4 + x[2]^2 - 1 #second constraint
]
Then, we call the function using the lower bound and upper bound as default.
optimize!(KelleyAlgorithm(),f,g,2)
The solution, objective value and the final final form of the model can be seen using the following functions:
show_solution()
show_objective()
and
show_model()