Support setting starting values
Hello :)
I've seen this old thread on discourse https://discourse.julialang.org/t/warm-start-mosek-in-a-linear-polynomial-optimization-problem/90478 and since there wasn't an open issue I obliged. I'm planning to translate a bit of MATLAB code which I've written using SOSTOOLS to Julia using SumOfSquares.jl. In particular the code uses an iterative algorithm to approximate the RAS of a non-linear system. It would be nice to be able to warm start the SOS optimization at each iteration using the polynomial obtained from the previous step.
Sure, let's do it then :) Note that Mosek does not support starting values. SCS/COSMO do support it though
Is this still broken? For the QCQP this can be quite important too -- along with propagating the start values of monomials to the lifted variables.
It's not the same as QCQP, it should work for QCQP after https://github.com/jump-dev/PolyJuMP.jl/pull/115
Are you sure? Compare Gurobi's output on the projection done by hand
using JuMP, PolyJuMP, Gurobi
m = Model(Gurobi.Optimizer)
@variable(m, x >= 0, start=1/sqrt(3))
@variable(m, y >= 0, start=1-start_value(x))
@variable(m, xx, start=start_value(x)*start_value(x))
@constraint(m, xx == x*x)
@constraint(m, x + y == 1)
@objective(m, Min, xx*x + y)
optimize!(m)
versus the current implementation
m = Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer()))
@variable(m, x >= 0, start=1/sqrt(3))
@variable(m, y >= 0, start=1-start_value(x))
@constraint(m, x + y == 1)
@objective(m, Min, x*x*x + y)
optimize!(m)
The first one explicitly writes Loaded user MIP start with objective 0.6151 , while the second one does not.
I believe it would be necessary to track the variables in the QCQP.Optimizer though, as the variables get copied to the model after final_touch. That might not be the worst thing, maybe the polyvar/moivar maps should be kept in the optimizer too, instead of the ScalarPolynomialFunction objects.
@votroto https://github.com/jump-dev/PolyJuMP.jl/pull/119 should fix this