Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting starting values #96

Open
PaioPaio opened this issue Oct 11, 2023 · 5 comments
Open

Support setting starting values #96

PaioPaio opened this issue Oct 11, 2023 · 5 comments

Comments

@PaioPaio
Copy link

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.

@blegat
Copy link
Member

blegat commented Oct 11, 2023

Sure, let's do it then :) Note that Mosek does not support starting values. SCS/COSMO do support it though

@votroto
Copy link
Contributor

votroto commented Mar 14, 2024

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.

@blegat
Copy link
Member

blegat commented Mar 21, 2024

It's not the same as QCQP, it should work for QCQP after #115

@votroto
Copy link
Contributor

votroto commented Mar 22, 2024

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.

@blegat
Copy link
Member

blegat commented Mar 25, 2024

@votroto #119 should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants