-
Notifications
You must be signed in to change notification settings - Fork 62
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
Change the default behavior of lazy constraints #340
Comments
Take note of the large warning in the JuMP documentation: https://jump.dev/JuMP.jl/stable/callbacks/#Available-solvers-1 You should only submit a lazy constraint if the current solution is infeasible. Thus, your callback should be function lazy_cut_callback(cb_data)
if callback_value(x) < 0.0
con = JuMP.@build_constraint(x >= 0.0)
MOI.submit(model, MOI.LazyConstraint(cb_data), con)
end
end Closing since this is expected behavior. |
Hi, I'm using LazyConstraintCallback in cplex via java with the following code and I'm getting a fatal error at runtime. Could you let me know what's causing this and how to fix it?
}
|
Hi @4YHa! Unfortunately, you are asking your question at the wrong place: this repo only contains the Julia wrapper for CPLEX, there is nothing about Java here. It is not affiliated with IBM. You can try on the official forum (https://community.ibm.com/community/user/ai-datascience/communities/community-home) or on Stack Exchange (https://or.stackexchange.com/). |
@dourouc05 Thank you very much for your answer. |
Did you solve this problem?I got a same bug.Could you share some about this? |
Currently, every time a constraint is added within a lazy cut callback, the MIP solution at the corresponding integer feasible node is removed from the solution space. There are circumstances where a feasible integer solution may be used to construct a cut that does not necessarily cut off that solution. I've found that the latter (expected) behavior is present in Gurobi.jl but not CPLEX.jl.
I expect this is being caused by the use of
CPXcallbackrejectcandidate
here, which automatically classifies the integer solution as infeasible within CPLEX. I'm not familiar enough with the C interface of CPLEX to suggest an alternative, but I'm hoping this can be addressed. Below is a small example that will result in infeasibility even though the lazy constraint that is being added should be inconsequential.The text was updated successfully, but these errors were encountered: