Obtaining different solutions on solving a cplex model many times

喜你入骨 提交于 2021-02-11 17:38:43

问题


I have an MIP model written with docplex and a solution pool written with cplex. My model has billions of solutions in reality. I need to solve this model several times (10 for example) with a certain populate number (10,000 for example) but I need the solutions of these multiple solves to be entirely different than each other. How can I achieve that with cplex? Is there a parameter or a approach for it?


回答1:


You can use a diversity filter for the solution pool, see CPLEX > User's Manual for CPLEX > Discrete optimization > Solution pool: generating and keeping multiple solutions > Filtering the solution pool and also the reference documentation for the callable library function CPXXaddsonpooldivfilter() which explains in detail how the filter is evaluated. This can only be done if all your variables are binary.

Another option is to add a no-good cut for each solution you have already found.

Yet another option is to use an incumbent callback (or the generic callback with CANDIDATE context) to reject any solution that you already found.

All this being said, I am not clear why you want to solve the same model multiple times from scratch. Did you try to just continue the search? If the search stops due to a solution limit and you call it again, then it should continue where it previously stopped. So it should find different solutions.

Also, if you want to get thousands of solutions then I wonder what you do with those solutions. Maybe it can help to install or adjust an objective function that aims for certain solutions. Using different objective functions can only drive diversity of the solutions.



来源:https://stackoverflow.com/questions/63781282/obtaining-different-solutions-on-solving-a-cplex-model-many-times

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!