在 linux 上解决整数程序的任何好工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10667330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Any good tools to solve integer programs on linux?
提问by mageta
Are there any good tools to solve integer programs on Linux?
有没有什么好的工具可以在 Linux 上解决整数程序?
I have a small problem that I want to compute to save time :D. It is kind of a subset sum problem. I have a list of around 20 Integer-Values and I want to compute the subset with the smallest sum that satisfies a certain minimum. You could formulate this with a integer program... something like
我有一个小问题,我想计算以节省时间:D。这是一种子集求和问题。我有一个大约 20 个整数值的列表,我想计算满足某个最小值的最小总和的子集。你可以用一个整数程序来制定这个......像
\sum_{i=1}^{n} w*x -> min
with
和
\sum_{i=1}^{n} w*x >= c with x \in \{0,1\}
Or is there an other good way to do this?
或者有其他好的方法可以做到这一点?
采纳答案by Ali
I would try either GLPKor SCIP.
They have their own modeling language, GLPK has GNU MathProg and SCIP has ZIMPL, so you can conveniently code your LP problem.
他们有自己的建模语言,GLPK 有 GNU MathProg,SCIP 有 ZIMPL,所以你可以方便地编码你的 LP 问题。
GNU MathProg has the advantage of being compatible with AMPL. Thus, you could try the student version of AMPL with CPLEX or Gurobi with your GNU MathProg model. Keep in mind that AMPL, CPLEX and Gurobi are commercial software.
GNU MathProg 的优点是与AMPL兼容。因此,您可以尝试使用 CPLEX 或 Gurobi 使用 GNU MathProg 模型的学生版 AMPL。请记住,AMPL、CPLEX 和 Gurobi 是商业软件。
回答by Julian
You could try gnu octave - its a subset of matlab
您可以尝试 gnu 八度 - 它是 matlab 的一个子集
回答by Hakan Serce
Try Lindo/Lingo. They are not free, but you can try them.
试试Lindo/Lingo。它们不是免费的,但您可以尝试一下。
They allow you to specify your problem in a very neat mathematical way.
它们允许您以非常简洁的数学方式指定您的问题。
回答by Ram Narasimhan
I wanted to add one more option to the GLPK suggestions that @Ali has made. I suggest that anyone interested in solving LPs/IPs also look into the optimization packages that the R Language offers.
我想在@Ali 提出的 GLPK 建议中再添加一个选项。我建议任何对解决 LP/IP 感兴趣的人也可以查看 R 语言提供的优化包。
If you already know and use R, then it is just a matter of downloading the right package. And even if you don't, this is a good way to get introduced to R, which is really taking off in the analytics space.
如果您已经知道并使用 R,那么只需下载正确的软件包即可。即使你不这样做,这也是了解 R 的好方法,它在分析领域真正起飞。
This vignetteis very good way to know which R packages are relevant. For you, RSymphonyor Rglpkmight be the ones to start with.
回答by MSt
Have you tried to do that with LibreOffice CalcSolver?
您是否尝试过使用LibreOffice CalcSolver做到这一点?
Microsoft Solver Foundationon Mono Framework could also do the job for you if you know C#.
如果您了解 C#,Mono Framework 上的Microsoft Solver Foundation也可以为您完成这项工作。