We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(13)
我个人发现 GLPK 比 LP_SOLVE 更好(即更快)。 它支持各种文件格式,另一个优点是它的库接口,可以与您的应用程序顺利集成。
I personally found GLPK better (i.e. faster) than LP_SOLVE. It supports various file formats, and a further advantage is its library interface, which allows smooth integration with your application.
对 COIN-OR 的另一个认可。 我们发现线性优化器组件(Clp)非常强大,并且通过一些分析可以很好地调整混合整数组件(Cbc)。 我们与 LP-Solve 和 GLPK 进行了比较。
对于真正棘手的问题,商业解决方案是最佳选择。
Another endorsement for COIN-OR. We found that the linear optimiser component (Clp) was very strong, and the mixed integer component (Cbc) could be tuned quite well with some analysis. We compared with LP-Solve and GLPK.
For really tough problems, a commercial solver is the way to go.
尝试 SCIP 求解器。 我已经用它来解决超过 300K 变量的 MILP 问题,并且性能良好。 其MILP性能比GLPK好很多。 Gurobi 对于 MILP 问题也具有出色的性能(通常比 SCIP(2011 年 5 月)更好),但如果您不是学术用户,它可能会很昂贵。 Gurobi 将使用多核来加速求解器。
Try the SCIP solver. I have used it for MILP problems with over 300K variables with good performance. Its MILP performance is much better than GLPK. Gurobi has also excellent performance for MILP problems (and typically better than SCIP (May 2011)), but it might be costly if you are not an academic user. Gurobi will use multicores to speed up the solver.
如果我是您,我会尝试使用多求解器接口,例如 Osi (C++) 或 PuLP (python),这样您只需编写一次代码,即可使用多个求解器对其进行测试。
如果你要解决的整数程序很大,我会推荐Python而不是C++,因为你的代码会看起来更干净,并且99%的时间都花在求解器上。
相反,如果问题很小,那么将问题从 python 内存复制到求解器(来回)的时间就不再被忽视:在这种情况下,您可以使用编译语言来尝试一些显着的性能改进。
但如果问题极其巨大,那么编译语言将再次获胜,因为内存占用将大致除以 2(Python 中没有问题的副本)。
If I were you, I would try to use a multi-solver interface such as Osi (C++) or PuLP (python) so that you can write your code once, and test it with many solvers.
If the integer programs you are going to solve are huge, I would recommend python over C++, because you code will look cleaner and 99% of the time will be spent in the solver.
If, on the contrary, the problems are small, then the time for copying the problems from python's memory to the solver (back and forth) is not to be neglected anymore: in that case you may experiment some noticeable performance improvements using a compiled language.
But if the problems are overwhelmingly enormous, then compiled languages are going to win again, because the memory footprint will be roughly divided by 2 (no copy of the problem in python).
您是否尝试过
lp_solve
? 对于 Java,以下问题中还有一些其他建议:Have you tried
lp_solve
? There were also some other suggestions in the following questions, for Java:我建议查看 COIN 项目。
COIN OR
这里有很多好的求解器,包括 ipOPT
对于非线性问题和一些
混合整数求解器也是如此。
I recommend checking out the COIN project.
COIN OR
Many good solvers here, including ipOPT
for nonlinear problems and a couple
mixed integer solvers as well.
Scip 还不错!
Scip is not bad!
尽管这可能不是您想听到的,但商业求解器 CPLEX 和 Gurobi 与开源求解器之间存在着数光年的差距。
尽管如此,你可能很幸运,你的模型可以很好地与 GLPK、Coin 等一起工作,但总的来说,开源解决方案远远落后于商业求解器。 如果情况不同,没有人会支付 12.000 美元购买 Gurobi 许可证,甚至不会支付更多费用购买 CPLEX 许可证。
在过去的几年里,我见过很多很多对于开源求解器来说太困难的模型。 相信我...
这并不是大小的问题,而是数字难度的问题。
Although this is maybe not what you want to hear, but there are light-years between the commercial solvers CPLEX and Gurobi on the one hand and open source solvers on the other hand.
Nevertheless you can be lucky and your model works fine with GLPK, Coin or the like, but in general open source solutions are way behind the commercial solvers. If it was different, no one would pay 12.000$ for a Gurobi license and even more for a CPLEX license.
In the past years I have seen many, many models that were just to difficult for the open source solvers. Believe me...
It's not so much a question of size, but of numeric difficulty.
我很惊讶没有人提到 MIPCL (http://www.mipcl-cpp.appspot。 com/index.html)。 该求解器声称是 LGPL 许可下的开源(来源:http://www.mipcl- cpp.appspot.com/licence.html),因此它也适合在非开源应用程序中使用。 但真正开源所缺少的是求解器本身的源代码。
Hans Mittelmann 最近(2017 年 9 月 10 日)做了混合整数线性规划基准测试:http://plato.asu .edu/ftp/milpc.html(您可能还有兴趣查看概述页面http ://plato.asu.edu/bench.html 或他演讲的幻灯片: http://plato.asu.edu/talks/informs2017.pdf)。
在具有 12 个线程和 2 小时时间限制的混合整数线性编程基准中,MIPCL 成功解决了 79 个实例。 只有商业求解器 CPLEX、Gurobi 和 XPRESS 在给定约束下能够求解更多问题(分别为 86 或 87 个实例)。
此外,就所选性能指标(再次使用 12 个线程)而言,MIPCL 比基准 SCIP 衍生产品(FSCIPC、FSCIPS)和开源求解器 CBC 更快。 同样,只有商业求解器 CPLEX、Gurobi 和 XPRESS 在性能方面显着优于 MIPCL。
I am surprised that nobody has mentioned MIPCL (http://www.mipcl-cpp.appspot.com/index.html). This solver claims to be open source under LGPL license (source: http://www.mipcl-cpp.appspot.com/licence.html), thus it is also suitable to be used in non-open-source applications. But what is missing to be really open source is the source code of the solver itself.
Hans Mittelmann very recently (10 Sep 2017) did Mixed Integer Linear Programming Benchmark: http://plato.asu.edu/ftp/milpc.html (you might also be interested in looking at the overview page http://plato.asu.edu/bench.html or the slides of his talk: http://plato.asu.edu/talks/informs2017.pdf).
In the Mixed Integer Linear Programming Benchmark with 12 threads and a time limit of 2 hours MIPCL managed to solve 79 instances. Only the commercial solvers CPLEX, Gurobi and XPRESS managed to solve more under the given constraints (86 or 87 instances, respectively).
Also in terms of the chosen performance metric (again using 12 threads) MIPCL is faster than the benchmarked SCIP derivates (FSCIPC, FSCIPS) and the open source solver CBC. Again only the commercial solvers CPLEX, Gurobi and XPRESS outcompete MIPCL significantly in terms of performance.
100k 变量是一个大问题。 许多开源库不能很好地处理这么多变量。 据我所知,lp_solve 仅针对大约 30k 变量进行了测试。 使用商业系统可能是您唯一的选择。
100k variables is a large problem. Many of the open-source libraries do not function well with that many variables. From what I've read lp_solve has only been tested for around 30k variables. Using the commercial system may be your only choice.
我已经使用 DICOPT 和 NEOS 服务器 (http://www. neos-server.org/neos/solvers/minco:DICOPT/GAMS.html)来解决大型(大约 1k 个变量和 1k 个约束)混合整数非线性程序,并发现它非常出色。
对于我的问题,DICOPT 比 Neos 服务器 BARON/KNITRO/LINDO/SBB 等上列出的其他 MINLP 求解器做得好得多。
向 NEOS 提交作业有一定的限制,它有点麻烦,但免费访问强大的商业求解器更有效比弥补它。
I have used DICOPT using the NEOS server (http://www.neos-server.org/neos/solvers/minco:DICOPT/GAMS.html) to solve large (approx 1k variables and 1k constraints) mixed integer non-linear programs and found it excellent.
For my problem DICOPT did much better than the other MINLP solvers listed on the neos server BARON/KNITRO/LINDO/SBB etc.
There are certain constraints to submitting jobs to NEOS and it is slightly cumbersome but the free access to a powerful commercial solver more than makes up for it.
我将在已经很好的答案中添加以下内容。
虽然正如其他人指出的那样,商业求解器比免费替代方案更快、更强大,但重要的是要考虑您可以接受多少最优性差距。 对于具有许多整数变量的大问题,如果您可以接受 1% 甚至更大的最优性差距(默认值往往约为 0.01% 或更小),您可能会获得更快的求解时间。
当然,如果您要解决的问题 1% 相当于数百万美元,这是不可接受的 - 因此存在顶级求解器的市场。 (Gurobi 与免费求解器的一些比较此处
)会同意其他人的观点,即使用生成独立于求解器的问题文件(例如 *.mps、*.lp 文件)的平台是值得的,因为您可以尝试其他求解器。 我正在使用 PuLP 并找到它,以及免费的 COIN_CBC 求解器,非常棒。 尽管仅限于许多整数变量的问题。
I'll add the following to the already excellent answers.
Whilst, as others have pointed out, commercial solvers are much faster and more capable than the free alternatives it's important to consider how much of an optimality gap you can accept. For large problems with many integer variables you may get much faster solve-times if you can accept 1% or even greater optimality gap (defaults tend to be around 0.01% or less).
Of course if you are solving a problem where 1% translates into millions of dollars this is not acceptable - hence the market for top-notch solvers. (Some comparisons of Gurobi to free solvers here)
I would agree with others that using a platform that generates solver-independent problem files (such as *.mps, *.lp files) is worthwhile as you can then try out other solvers. I'm using PuLP and am finding it, and the free COIN_CBC solver, excellent. Although limited for problems with many integer variables.
不是开源的,但如果您拥有 Microsoft 学术联盟许可证,Microsoft Solver Foundation (MSF ) 包含企业版。 Gurobi 对于学术目的也是免费的,我在论文研究中使用了它。
Not open source, but if you have a Microsoft Academic Alliance license, the Microsoft Solver Foundation (MSF) enterprise edition is included. Gurobi is also free for academic purposes, I've used it in my thesis research.