Solving an SDP repeatedly where the matrix data changes in each repetition

I’d benchmark it first. You can also improve things by formulating the model close to the form that Mosek expects.

Use print_active_bridges(model) to see how we’re reformulating. Here’s a tutorial: Example: ellipsoid approximation · JuMP

You probably need something like this:

model = Model(Mosek.Optimizer)
@variable(model, X[1:m, 1:m], PSD)
@variable(model, y[1:n])
@variable(model, Z[1:m, 1:m], PSD)
@constraint(model, c_con, X + sum(y[i] * A[i] for i in 1:m) + B .== Z)

You could also benchmark doing something like:

for i in 1:m
    set_normalized_coefficient.(c_con, y[i], A_new[i])
end
set_normalized_rhs.(c_con, -B_new)

Note that you need -B because JuMP will move it to the right-hand side.

1 Like