-
Notifications
You must be signed in to change notification settings - Fork 87
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
MOI.get
on attribute where is_set_by_optimizer = true
and TerminationStatus = OPTIMIZE_NOT_CALLED
#2352
Comments
I don't know if I fully understand the issue. Do you have a reproducible example? What attribute do you want to query if the problem hasn't been set? If you don't call If you want |
I think the question boils down to choosing the appropriate status. The problem I see with
PS: An example would look like: # Create the model
model = Model(
# Use ToQUBO in compilation mode
() -> ToQUBO.Optimizer(nothing)
)
# Add the variables
@variable(model, 0 <= x[1:2] <= 1)
# Add the objective
@objective(model, Min, sum(x .^ 2))
# Add the global constraint
@constraint(model, alpha, sum(x) >= 0.5)
# Compile the QUBO model
optimize!(model)
get_attribute(alpha, ToQUBO.Attributes.ConstraintEncodingPenalty()) # Error! |
Yes, this should work. |
You could also consider that the error is that there was no solver attached. I think it's more important to have the |
Is there anything actionable left to do here? This seems like it can be fixed in ToQUBO, not in MOI. |
@odow I think this is indeed very specific to our use case, so I don't think it's even something that is missing from the docs. Maybe, for ToQUBO and other reformulators/meta-solvers a And yes, the question was answered and this issue looks ready to be closed, thanks! |
I think |
On the series of querying attributes with our meta-solver/reformulator I encountered a corner case when retrieving attributes after reformulation without an inner optimizer.
Basically, we have an operation mode in psrenergy/ToQUBO.jl where a call to
optimize!
without an optimizer will just reformulate the problem to the QUBO form, e.g.,instead of the usual
The problem is that the
OPTIMIZE_NOT_CALLED
status prevents attribute retrieval for cases whereis_set_by_optimizer = true
.I couldn't find any other suitable status for this case besides
OTHER_ERROR
which is kind of misleading since there was no error to begin with.Note: Using
optimize!
is not necessary, we could be using something likereformulate!
orcompile!
but this makes no big difference in the issue.The text was updated successfully, but these errors were encountered: