We can see that while the starting value is set for the variable, it is not set for the constraint. So SCS starts from scratch.
Indeed, the objective is bridges with Objective.SlackBridge and then Constraint.QuadtoSOC into a RotatedSecondOrderCone constraint that SCS supports.
However, no ConstraintDualStart or ConstraintPrimalStart will be set to this constraint by set_start_values!
What should be done is to set a ConstraintDualStart of -1.0 to and a ConstraintPrimalStart of 0.0 to the quadratic constraint.
These should get transformed into the correct dual and primal starting values of the RotatedSecondOrderCone using the values of the VariablePrimalStart.
I have experimented with a way to fix it in the copy_dual.jl file of https://github.com/jump-dev/DiffOpt.jl/pull/231
The idea is to define new attributes that serve as objective dual and primal starting values.
The objective dual starting values kind of make sense.
In the lagrangian, we have objective - sum dual * constraint_primal. So if the dual of the objective was -1, we would just have - sum dual * ... with no special case. So the dual of the objective is no too shocking so I called it ObjectiveDualStart.
For the primal start it's doesn't make much sense outside of the context of the slack bridge so I called it ObjectiveSlackGapPrimalStart.
When they are set to any ModelLike, they are ignored by default unless it's CachingOptimizer which passes it down to the optimizer or AbstractBridgeOptimizer which passes it to the objective bridge.
I think we should add this to MOI and use it from JuMP.set_start_values(model)
While working on https://github.com/jump-dev/DiffOpt.jl/pull/231, I found out that there might be some unexpected behavior to
We can see that while the starting value is set for the variable, it is not set for the constraint. So SCS starts from scratch. Indeed, the objective is bridges with
Objective.SlackBridge
and thenConstraint.QuadtoSOC
into aRotatedSecondOrderCone
constraint that SCS supports. However, noConstraintDualStart
orConstraintPrimalStart
will be set to this constraint byset_start_values
! What should be done is to set aConstraintDualStart
of-1.0
to and aConstraintPrimalStart
of0.0
to the quadratic constraint. These should get transformed into the correct dual and primal starting values of theRotatedSecondOrderCone
using the values of theVariablePrimalStart
.I have experimented with a way to fix it in the
copy_dual.jl
file of https://github.com/jump-dev/DiffOpt.jl/pull/231 The idea is to define new attributes that serve as objective dual and primal starting values. The objective dual starting values kind of make sense. In the lagrangian, we haveobjective - sum dual * constraint_primal
. So if the dual of the objective was-1
, we would just have- sum dual * ...
with no special case. So the dual of the objective is no too shocking so I called itObjectiveDualStart
. For the primal start it's doesn't make much sense outside of the context of the slack bridge so I called itObjectiveSlackGapPrimalStart
. When they are set to anyModelLike
, they are ignored by default unless it'sCachingOptimizer
which passes it down to the optimizer orAbstractBridgeOptimizer
which passes it to the objective bridge.I think we should add this to MOI and use it from
JuMP.set_start_values(model)