You crossposted the question on stackoverflow here:
https://stackoverflow.com/questions/62564754/how-to-use-callbacks-with-cplexapi-in-rFrom that it seems that you only want to have a list of alternative solutions. This can be done with the CPLEX solution pool. Alex described how to access the solution pool in OPL.
Unfortunately, it seems that the solution pool functions are not exported in the cplexAPI package. You may want to contact the authors to ask them to do that.
There is however a workaround: Every solution in the pool is also installed as a MIP starts. So right after the solve completes, you can use the writeMIPstartsCPLEX() function to write all MIP starts into a single file to disk. Or you can use the MIP starts query functions to directly query those MIP starts from R. When doing this, you may want to set parameter
CPX_PARAM_WRITELEVEL to 1 so that all variables are included in the MIP start.
------------------------------
Daniel Junglas
------------------------------
Original Message:
Sent: Sun June 28, 2020 12:36 PM
From: Inês Soares
Subject: callbacks help!
Hi Daniel,
Many thanks for the suggestion. I will try to contact them.
Alternatively to cplexAPI, I also tried to solve the problem by writing the MIP model in OPL (which can be used in R by external call), but I also could not implement neither the callbacks nor another alternative strategy able of getting a set of internal feasible solutions of the branch and bound tree (not only the optimal solution of the MIP model). OPL is an IBM product, right? In that case, can you help me?
Best,
Inês Soares
------------------------------
Inês Soares
Original Message:
Sent: Fri June 26, 2020 01:01 AM
From: Daniel Junglas
Subject: callbacks help!
I am not sure this is the best place to ask your question. cplexAPI is not an official IBM product. You may want to contact the authors/maintainers of that project. Or ask them to answer here :-)
------------------------------
Daniel Junglas
Original Message:
Sent: Wed June 24, 2020 05:43 PM
From: Inês Soares
Subject: callbacks help!
I am using the cplexAPI package of R to solve mixed-integer problems in the cplex environment. I have already successfully written the problem, getting the final optimal solution, and now I would like to get the internal solutions of the branch and bound tree. I guess that I must use the callbacks, but I do not know how to implement it in R. For the other functions/instructions, many examples can be found in the tutorial of the cplexAPI for R. However, no example exists for the callbacks. Could anyone help me?
Many thanks,
Inês Soares
------------------------------
Inês Soares
------------------------------
#DecisionOptimization