简体   繁体   English

如何在CPLEX中获得MIP的多种最佳解决方案?

[英]How to get multiple optimal solutions for MIP in CPLEX?

I constructed a Mixed Integer LP using CPLEX Python API and also a brute force checking program (which solves an LP) using MATLAB. 我使用CPLEX Python API构建了一个Mixed Integer LP,并使用MATLAB构建了一个强力检查程序(它解决了LP)。 I found that for a particular random example that I created, brute force checking finds 2 optimal solutions ie same objective value. 我发现,对于我创建的特定随机示例,强力检查找到2个最优解,即相同的目标值。 Let's call them A and B. However, CPLEX only finds one of them, for example A. 我们称它们为A和B.但是,CPLEX只找到其中​​一个,例如A.

So I tried to set different values for these parameters: 所以我试着为这些参数设置不同的值:

model.parameters.mip.pool.capacity
model.parameters.mip.pool.intensity
model.parameters.mip.limits.populate
model.parameters.mip.pool.absgap
model.parameters.mip.pool.replace

and finally called model.populate_solution_pool() . 最后调用了model.populate_solution_pool() This gives me solution B but it does not find A. Are there other ways to find more than 1 optimal solutions? 这给了我解决方案B但它没有找到A.还有其他方法可以找到超过1个最优解决方案吗?

Perhaps you can: 也许你可以:

  • Find one optimal solution 找到一个最佳解决方案
  • Add a term to your objective function that penalizes that solution 在您的目标函数中添加一个惩罚该解决方案的术语
  • Check to see if there's another feasible solution that matches the value (to tolerance) of the previously found optimal solution. 检查是否有另一个可行的解决方案与先前找到的最佳解决方案的值(容差)相匹配。 If so, repeat. 如果是,请重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM