使用python cplex解决方案池获取独特的解决方案

问题描述

我有一个MILP模型,尝试使用cplex python API解决。我需要获得多个解决方案。问题是,当我从cplex池中获得50个解决方案时,这些解决方案非常相似。在获得这些解决方案之前,如何在不增加新约束的情况下以某种方式改组并尽可能获得彼此不同的解决方案?

解决方法

您可以为此使用解决方案池过滤器。使用分集滤波器,可以确保解决方案足够不同。但是,这些过滤器仅适用于二进制变量。

您可以在solution pool documentationsolution pool reference documentation中找到更多详细信息。可以在C库参考文档herehere中找到有关过滤器功能的详细信息。

该用户手册还提供了有关使用另一种策略查找多样化解决方案的示例。参见CPLEX > User's Manual for CPLEX > Discrete optimization Solution pool: generating and keeping multiple solutions > Parameters of the solution pool > Example: diverse solutions through replacement parameter

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...