-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cbc is not sending settings to Clp for the LP solve (with interactive or C++ API) #512
Comments
There are separate parameters for the log level of Cbc itself and the log level of the LP solver. To change the log level for the LP solver, use the parameter
So I guess the issue you are having with passing tolerance parameters is something unrelated. If you give me some idea of what you're doing (what parameters are being set and not passed, etc.), I can at least try to point to where those parameters should be passed in the code (or perhaps see that they are not). |
Thank you for the quick response! That's good to know regarding the log level, though as you noted that's not my real issue. The parameters that I'm trying to pass to Clp are PrimalTolerance and DualTolerance. In slightly older versions of Cbc, I was able to set these 2 parameters and they had the desired effect on the LP (Clp). However, in the latest version, this stopped working. |
Could you specify a particular version of Cbc where this worked? Are you suggesting that it worked for previous releases in the 2.10 series or in previous stable versions altogether (2.9 or earlier)? |
Yes, this worked fine back in v2.10.3. |
FWIW, Cbc.jl used a patched version of 2.10.3 that meant we never went through Clp for LPs. We're now back on mainline in 2.10.5, which is why these issues cropped up. The |
Thank you for the explanation @odow ! This makes so much more sense now. It sounds like the solution is to find the name of the setting in Cbc, if it exists, to actually change the LP primal and dual tolerances since these are no longer affected by the names I sent before, which were presumably Clp attributes, not Cbc attributes. @tkralphs Do you know what the setting names would be for Cbc to change the primal and dual tolerances for the inner LP problem solver? |
I have also come across a similar problem where the "seconds" attribute appears to be ignored in the inner LP. I don't have an MWE yet. |
This still seems to be an issue on To reproduce Ian's I put the MPS files, CLI instances, and solutions in gists here (failing to pass seconds) and here (successfully passing seconds in) Reproducing the resulting solutions here to show the difference: Without constraining to integers, the optimization ignores the time limit and goes through the optimization
Constraining the optimization to integers, the optimization obeys the time limit and terminates immediately
|
@SBuercklin, thanks for the thorough bug report. I guess this is more of a feature than a bug. I believe that Cbc doesn't ever interrupt the LP solver (Clp), which is part of the reason why the solution process doesn't always exit at exactly the time limit. It exits after the last LP solve that results in exceeding the time limit. In other words, the code can only exit from within the Cbc part of the code, not within Clp. When there are no integer variables, Cbc detects that the problem is an LP and simply passes it to Clp, which never has a time limit for its computations when called from Cbc. In both cases, the LP relaxation is being solved to optimality before exiting, the difference is probably just that in the case of an integer program, the computation is actually terminated early because it would otherwise move on to the branch-and-bound, but in the case of being passed to Clp, the computation is completed after exiting from the LP solve, so the status isn't that the problem is being stopped on time---it was actually solved to optimality. But this is all without really digging into the code. |
Thanks @tkralphs, that makes sense. Is there a list of attributes or options that are forwarded to Clp? We're still encountering an issue where dualTolerance and primalTolerance do not seem to be forwarded to Clp. I will work on reproducing a MWE for that directly in the meantime |
I don't think there is a list, but it should not be too difficult to figure out by looking through |
If you just search Lines 980 to 992 in 0713c30
But they don't seem to be mentioned anywhere else. It should be easy to allow. |
Actually, I spoke too quickly. I had put aside the refactoring effort and it's been long enough that I've probably forgotten a few things. Both |
@tkralphs, I appreciate your help. This was cropping up in the Julia interface and we've been trying to reduce it to a MWE for a while. We finally got it down by exporting a larger model that we giving us issues, and it appears that the issue we're running into is either a problem with I've opened an issue with a MWE here, and the MWE seems to definitively show it's not happening in the CLI, but someone else will need to determine exactly where the bug is coming from. |
The call to the C interface happens here, where the parameter name and value (converted to a string) are passed into the C wraper The actual C call happens here to |
I confirmed that this is a problem in the C API, not the Julia package: jump-dev/Cbc.jl#211 (comment) But @SBuercklin has a bigger problem: their model is poorly scaled, which I guess is why they're wanting to tighten the primal/dual tolerances. |
With a file called
file.lp
having contents:If I run Cbc 2.10.8 interactively and try to set logLevel to 0, it does not mute logging in Clp:
This was noted as an issue that affects the Julia interface to Cbc: jump-dev/Cbc.jl#168.
My true issue is that the settings for PrimalTolerance and DualTolerance also are not being passed down to Clp for the LP, but it was a little tougher to make an MWE to show that, so I stuck with the logLevel example. This is causing a problem for a problem I have where tolerances end up making a big difference.
The text was updated successfully, but these errors were encountered: