dirkschumacher / rcbc

COIN-OR branch and cut (CBC) bindings for R
https://dirkschumacher.github.io/rcbc/
Other
19 stars 5 forks source link

Pass control argumnets with rcbc #33

Open DSoot opened 4 years ago

DSoot commented 4 years ago

I have tried to get the first feasible solution from my model but the limit parameters suggested in https://projects.coin-or.org/CoinBinary/export/1059/OptimizationSuite/trunk/Installer/files/doc/cbcCommandLine.pdf seem to not be recognized by the ROI. This is what i get Warning message: In ROI::ROI_solve(op, solver, ...) : the control arguments c("MAXN", "SEC") are not available in solver 'cbc'

I thought i found the solution here https://cvxr.rbind.io/cvxr_examples/cvxr_parameters/ but it turns to be a demo of how ROI ignores invalid parameters parsing. What I actually seek is a set parameters which are capable to reduce the search and branch'n'cut iterations. Any suggestions?

multiduplikator commented 4 years ago

If you want to pass parameters to cbc via ROI you should use the control = apporach, like this:

ROI_solve(op_model, solver = "cbc", control = list("maxn" = 600, "sec" = 60))

Note the small letters instead of CAPS.

Interestingly, it still throws the error about MAXN but respects the node limit:

...
maxNodes was changed from 2147483647 to 600
seconds was changed from 1e+100 to 60

Result - Stopped on node limit
...
Warning message:
In ROI::ROI_solve(op, solver, ...) :
  the control argument "maxn" is not available in solver 'cbc'