简体   繁体   English

在python中获得由GLPK求解器为LP计算的前10个次优解

[英]Getting top 10 sub-optimal solutions computed by GLPK solver for LP in python

I am trying to use GLPK for solving an LP problem.我正在尝试使用 GLPK 来解决 LP 问题。 My problem is the routing problem in a computer network.我的问题是计算机网络中的路由问题。 Given network topology and each link capacity and the traffic demand matrix for each source-destination pair in the network, I want to minimize maximum link utilization in the network.给定网络拓扑和每个链路容量以及网络中每个源-目的地对的流量需求矩阵,我想最小化网络中的最大链路利用率。 This is an LP problem and I know how to use GLPK to get the optimum solution.这是一个 LP 问题,我知道如何使用 GLPK 来获得最佳解决方案。

My problem is that I want to get the sub-optimal solutions also.我的问题是我也想获得次优解决方案。 Is there any way that I can get say top 10 suboptimal solutions by GLPK?有什么方法可以让我通过 GLPK 获得前 10 个次优解决方案?

Best最好的事物

For a pure LP (with only continuous variables), the concept of finding " next best " solutions is very difficult (just move an epsilon away, and you have another solution).对于纯 LP(只有连续变量),找到“下一个最佳”解决方案的概念非常困难(只需移开一个 epsilon,您就会有另一个解决方案)。 We can define this differently: find "next best" corner points (aka bases).我们可以对此进行不同的定义:找到“下一个最佳”角点(又名基数)。 This is not so easy to do, but there is a somewhat complex way by encoding bases using binary variables ( link ).这不是那么容易做到,但是通过使用二进制变量( link )编码基数有一种有点复杂的方法。

If the problem is actually a MIP (with binary variables) it is easier to find "next best" solutions.如果问题实际上是 MIP(带有二进制变量),则更容易找到“次优”解决方案。 Some advanced solvers have built-in facilities for this (called: solution pool ).一些高级求解器为此具有内置工具(称为:解决方案池)。 Note: glpk does not have this option.注意:glpk 没有这个选项。 Alternatively, we can also do this by adding a cut that forbids the best-found solution and then resolve ( link ).或者,我们也可以通过添加一个禁止最佳解决方案的切割然后解析( 链接)来做到这一点。 In this case we exploited some structure.在这种情况下,我们利用了一些结构。 A general cut for 0-1 variables is derived here . 此处导出 0-1 变量的一般切割。 This can also be done for general integer variables, but then things get a bit messy.对于一般的整数变量也可以这样做,但是事情会变得有点混乱。

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

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