且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Windows 10 的 pyomo 的 SolverFactory 中使用“cbc"

更新时间:2023-11-23 20:48:55

您将需要单独安装 cbc 以便将其用作可调用库.我认为***的外观是在这里:

https://github.com/coin-or/Cbc/blob/master/README.md

该自述文件讨论了Windows安装.(我使用mac ...任何一条路径都有些颠簸,但可行)

您可能仍然需要从二进制文件中构建它...不太确定...我在这里不太有经验,也许其他人可以继续学习.

I have been trying to use 'cbc' solver in pyomo as following:

import pyomo.environ as pe

solver = pe.SolverFactory('cbc')

result = solver.solve(m)

Currently, I have been relying on the embedded solver with pyomo installation, which is 'glpk', and I have found that 'cbc' can do better job in many circumstances.

I am using: python 3.XX

Anaconda environment

Windows 10

Pyomo (installed via Conda)

It would be great to upgrade the ability of pyomo by using advanced solver!

You will need to install cbc separately so that it can be used as a callable library. I think the best place to start to look is here:

https://github.com/coin-or/Cbc/blob/master/README.md

That readme file talks about windows installation. (I use mac...either path is a bit bumpy, but doable)

you may still need to build it from binaries...not too sure... I'm not too experienced here, maybe others can pile on.