-
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
[FileFormats.LP] support indicator constraints #2354
Comments
What is the original output of Our LP file format does not support indicator constraints, so it'll be getting reformulated somehow. |
shell> cat test.lp
minimize
obj:
subject to
c1: 1 x + 1 x3 = 0
Bounds
x free
x3 free
Binary
y
SOS
c1_1: S1:: x3:0.4 y:0.6
End |
So this reformulates your indicator constraint as an SOS1 constraint. when you do the negation, it tries to instead reformulate as a big-M MIP, which it can't do because We could improve the error message, but this seems like it is working as expected. |
It looks like CPLEX and Gurobi support indicators
https://www.gurobi.com/documentation/11.0/refman/lp_format.html
But I'm not in a rush to add support for this. Why is it useful? |
Using a SOS reformulation is fine. When the negation is used, it can be reformulated as:
It is useful when examining a model file since the .LP format is more understandable than an MOF file (wether that is supporting the indicator constraint directly or using a reformulation) |
I get that we can reformulate the indicator constraint a different way. But the current bridge supports only
But this is unrelated to the file format issue.
But in this case the model you are examining is not the same as the model you wrote down. It seems like you're really asking for tools to make MOF files more understandable. But if you're looking for a readable output, then you could just |
So to give some context, I have some .lp files for some models (made by someone else) that I am trying to implement myself (develop the general model so that it can be solved on different input datasets). When I develop my version of the model, I use JuMP to compare my model with the one in the .lp file and find the differences between the two. However, these models get big and thus |
You can open("model.txt") do io
print(io, model)
end But oh, reverse engineering a model from the LP file does not sound like fun. |
Yes, writing to a text file is a good idea. Thanks. Haha...yeah... |
The following works:
However if the indicator constraint is changed to
@constraint(model, !y => {x == 0})
, writing the LP file fails:The text was updated successfully, but these errors were encountered: