Using CBC solver with Pyomo for windows users

1,138 views
Skip to first unread message

Banda Ya

unread,
Feb 4, 2020, 5:30:24 PM2/4/20
to Pyomo Forum
I thought I should share with others how to set up the CBC solver with Pyomo (if you are using windows), as it took me a while to work out.

First of all the command below only works if you using linux or osx:

conda install -c conda-forge coincbc

Windows users need to get the binaries for the CBC solver. The easiest way to get latest binaries for the CBC solver is from the AMPL website: https://ampl.com/products/solvers/open-source/

(Note: The binaries available from Coin-or website seems quite out of date: https://www.coin-or.org/download/binary/CoinAll/)

Select 32-bit Windows or 64-bit Windows as appropriate. This will download it as a zip file

Extract the file into the folder you keep Python scripts or Jupyter notebooks for use with Pyomo. 

That's all. You can use the CBC solver like any other solvers.

 

luis gustavo cordero bautista

unread,
Apr 19, 2020, 5:33:31 PM4/19/20
to Pyomo Forum
hey brother, I installed glpk and ipopt. What is the difference with the CBC? why did you decide to install it?
I am a week into this pyomo programming.
I have an issue with data that I used in AMPL but I cant figure out how to translate to pyomo. Could you help me? thanks


This is AMPL
param: N: Pd  Qd     SMAXGD   fpgdm  fpgdM:=
# Nó kW kVAr  
0 0 0         0       0       0
1 100 60        0       0       0

Banda Ya

unread,
Apr 20, 2020, 9:38:39 AM4/20/20
to Pyomo Forum
CBC is another solver for LP and MILP. I find it better than GLPK. 

Someone on this group should be able to help you with converting AMPL code to Pyomo. 

luis gustavo cordero bautista

unread,
Apr 20, 2020, 12:39:00 PM4/20/20
to Pyomo Forum
Hi Banda, 

I downloaded cbc from AMPL, it contains cbc.exe and licence.txt. 
The way I am using Python is as follows 
1. I installed python from anaconda.org
2. I created an environment for python 3.6 C:\Users\User\anaconda3\envs\luidienv36pyomopysp\
3. I installed pyomo, pyomo.extras, pyomo.solvers (here it offers glpk ipopt)

4. I want to install cbc solver, so I am following your instruction, should I put cbc.exe and licence.txt into this path C:\Users\User\anaconda3\envs\luidienv36pyomopysp\Scripts.  (is it correct?) If so, I did, I wrote into cmd>cbc
                                                                                                                                                            (luidienv36pyomopysp) C:\Users\User>cbc
                                                                                                                                                             Welcome to the CBC MILP Solver
                                                                                                                                                             Version: 2.10.3
                                                                                                                                                             Build Date: Dec 15 2019

                                                                                                                                                             CoinSolver takes input from arguments ( - switches to stdin)
                                                                                                                                                             Enter ? for list of commands or help
                                                                                                                                                             Coin:
5. this means that I can use for solver('cbc') rigth? 

thanks.


On Tuesday, February 4, 2020 at 7:30:24 PM UTC-3, Banda Ya wrote:
Reply all
Reply to author
Forward
0 new messages