-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
[docs] fix benders_decomposition.jl #3532
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3532 +/- ##
==========================================
- Coverage 98.25% 98.18% -0.08%
==========================================
Files 37 37
Lines 5563 5561 -2
==========================================
- Hits 5466 5460 -6
- Misses 97 101 +4 ☔ View full report in Codecov by Sentry. |
@@ -266,7 +266,7 @@ function my_callback(cb_data) | |||
return | |||
end | |||
cut = @build_constraint(θ >= ret.obj + -ret.π' * A_1 * (x .- x_k)) | |||
MOI.submit(model, MOI.LazyConstraint(cb_data), cut) | |||
MOI.submit(lazy_model, MOI.LazyConstraint(cb_data), cut) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should look at why this didn't error. It should have...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this might be an issue with GLPK, not with JuMP. Thanks for looking.
GLPK callbacks are weird |
I think the output in your figure is normal. There are multiple "Terminating with the optimal solution", because this is a callback function, which will be called frequently during solving, and the solver's terminating criterion doesn't depend on user's callback function. As for the Jumping up - Jumping down lower bound, this is also reasonable because the problem is changing during solving. The puzzling point is why GLPK can return the right answer, even if you submit to But it should be fine after revising. I agree with the new callback function. |
Actually I would prefer to use a solver-dependent callback. (For example, I would refer to Gurobi.jl directly when I have a need) |
I don't understand why GLPK calls so many times: |
I thought there might be no one who is more familiar with this than you, because it seems that you are the main contributer of GLPK.jl.🥲 From my point of view, the Therefore, I think the name This adapted version of TSP callback code (using MOI without JuMP) might be a comparison. Solver is Gurobi, the problem is larger and the counter reaches https://github.com/WalterMadelim/p8f.jl/blob/main/src/TSP_GRB_callback.jl |
Yes 😄 I meant this as "given I understand exactly how it works, it is confusing that it is called so many times." |
Closes #3531
Thanks for catching this @WalterMadelim. I'm surprised that it didn't error!