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

ScalarQuadraticFunction not supported with SCIP and QCQP. #120

Closed
votroto opened this issue Mar 27, 2024 · 1 comment · Fixed by #121
Closed

ScalarQuadraticFunction not supported with SCIP and QCQP. #120

votroto opened this issue Mar 27, 2024 · 1 comment · Fixed by #121

Comments

@votroto
Copy link
Contributor

votroto commented Mar 27, 2024

Ehm... Hello again ^_^

Issue

This works:

using JuMP, PolyJuMP, SCIP

m = Model(SCIP.Optimizer)

@variable(m, x >= 0)
@variable(m, y >= 0)
@variable(m, xx)

@constraint(m, xx == x*x)
@constraint(m, x + y == 1)

@objective(m, Min, xx*x + y)

optimize!(m)

but changing the optimizer to

m = Model(() -> PolyJuMP.QCQP.Optimizer(SCIP.Optimizer()))

fails with

LoadError: MathOptInterface.UnsupportedAttribute{MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarQuadraticFunction{Float64}}}: Attribute MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarQuadraticFunction{Float64}}() is not supported by the model.

any ideas? Is this a SCIP issue?

Versions

  • PolyJuMP: tested with the version from pkg, and the latest 119 patch from github master)
  • Julia: 1.10.0

Same results setting it manually, of course

aff = MOI.ScalarAffineTerm(1.0, MOI.VariableIndex(y))
qua = MOI.ScalarQuadraticTerm(1.0, MOI.VariableIndex(xx), MOI.VariableIndex(x))
sqf = MOI.ScalarQuadraticFunction([qua], [aff], 0.0)
set_objective_function(m, sqf)
@votroto votroto changed the title ScalarQuadraticFunction is not supported with SCIP. ScalarQuadraticFunction not supported with SCIP and QCQP. Mar 27, 2024
@blegat
Copy link
Member

blegat commented Mar 27, 2024

Thanks for the thorough testing ^^ This is because SCIP needs to bridge quadratic objective into quadratic functions but because the bridges are applied before QCQP it decides to bridge it into polynomial function which is then transformed into QCQP by the QCQP optimizer but because there is no bridge after the QCQP optimizer, it fails

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

Successfully merging a pull request may close this issue.

2 participants