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

More granular support of SOS1 and SOS2 #227

Closed
ValentinKaisermayer opened this issue May 3, 2024 · 3 comments
Closed

More granular support of SOS1 and SOS2 #227

ValentinKaisermayer opened this issue May 3, 2024 · 3 comments

Comments

@ValentinKaisermayer
Copy link

I have some solver-agnostic code where I already check:

MOI.supports_constraint(JuMP.backend(model), MOI.VectorOfVariables, MOI.SOS1{Float64})

But this does not work here, since Cbc does support them.

Why are SOS1 and SOS2 constraints supported

function MOI.supports_constraint(
::Optimizer,
::Type{MOI.VectorOfVariables},
::Type{<:Union{MOI.SOS1{Float64},MOI.SOS2{Float64}}},
)
return true
end

when the solver states

"There are known correctness issues using Cbc with SOS " *
"constraints and no binary variables.",

Is there a way of not supporting them just for non-binary variables.

@blegat
Copy link
Member

blegat commented May 3, 2024

Unfortunately, the way supports communicates is constraint-wise so there is no way to communicate that a SOS constraint with non-binary variables is not supported. The only way would be to have different sets for SOS constraints with binary and non-binary. Alternatively, the Cbc solver could also correctly handle these cases

@odow
Copy link
Member

odow commented May 3, 2024

Is there a way of not supporting them just for non-binary variables.

No. Just don't use Cbc. Use HiGHS instead.

@odow
Copy link
Member

odow commented May 3, 2024

Closing as a duplicate of #151. I don't want to complicate MOI by adding more complexity to how we manage supports_constraint.

Our options are:

  • Do nothing.
  • Build and distribute un-released master version of Cbc and required dependencies
  • Do something like adding a binary variable to the end of each SOS constraint.

@odow odow closed this as completed May 3, 2024
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