在多次求解复杂模型时获得不同的解决方案 [英] Obtaining different solutions on solving a cplex model many times

查看:62
本文介绍了在多次求解复杂模型时获得不同的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用docplex编写的MIP模型和一个用cplex编写的解决方案池.我的模型实际上有数十亿个解决方案.我需要用一个特定的填充数(例如10,000)来多次(例如10次)求解该模型,但是我需要这些多重求解的解彼此完全不同.我如何用cplex做到这一点?是否有参数或方法?

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?

推荐答案

您可以对解决方案池使用分集过滤器,请参见

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.

另一种选择是使用现有的回调(或具有 CANDIDATE 上下文的通用回调)拒绝您已经找到的任何解决方案.

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

所有这些,我不清楚为什么您要从头开始多次解决 same 模型.您是否尝试过继续搜索?如果搜索由于解决方案限制而停止,并且您再次调用它,则它应从先前停止的位置继续.因此,它应该找到不同的解决方案.

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.

这篇关于在多次求解复杂模型时获得不同的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆