How to use 'cbc' in pyomo's SolverFactory in Windows 10

不羁岁月 提交于 2020-07-10 10:26:46

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/62645255/how-to-use-cbc-in-pyomos-solverfactory-in-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!