MIP with python speed vs MIP with C++ speed

478 views
Skip to first unread message

abdullah makkeh

unread,
Feb 15, 2016, 6:44:20 AM2/15/16
to Gurobi Optimization
Currently running and MIP with high number of variables. Knowing that MIP is NP-hard problem. I expected it to be slow.

Considering to use C++ instead of python.

How much Gurobi is faster when solving MIP using C++ instead of python?

Tobias Achterberg

unread,
Feb 15, 2016, 8:24:31 AM2/15/16
to gur...@googlegroups.com
Gurobi itself is not faster with C++ than with Python. Whatever API you use, the
Gurobi-internal algorithms are implemented in C. The API is just a thin layer
around our C interface. And since the combinatorial explosion (why MIP is
NP-hard) happens in the tree search inside the internal MIP algorithm, the API
does not matter in this regard.

In terms of speed, the API is only important for model construction, solution
extraction, and if you are using a callback function. But typically, if you are
using your language in the right way and are not solving thousands of tiny and
really easy MIPs, then this difference should be negligible.

Sometimes, garbage collector languages like Java or Python have disadvantages
for huge models in terms of memory efficiency.


Regards,

Tobias
Reply all
Reply to author
Forward
0 new messages