5
$\begingroup$

I have a large MIP built with PuLP in python, and want to utilize the HiGHS Solver. However, PuLP does not have the option to use HiGHS as a solver. One option I am aware of would be to use PuLP to write an MPS file, and call HiGHS via command line on the MPS file. I wanted to avoid this as I am trying to develop everything within python. Another option would be to use scipy's optimize in which HiGHS is configured to be one of the solver options. However, it appears scipy requires the MIP to be in matrix form as an input, and does not support reading MPS files.

In general, Is there a better way to utilize open-source non-default solvers with the Python PuLP interface?

$\endgroup$
1
  • $\begingroup$ As a personal preference, I prefer to use Pyomo with CBC if it has to be open source. I am not sure whether HiGHS is supported by the Pyomo interface. $\endgroup$
    – Sune
    Sep 21 at 7:25

1 Answer 1

6
$\begingroup$

PuLP has an API for HiGHS but that version is not sent to pip yet.

For the time being, you should pip install PuLP from Github. See the command taken from their readme below. (ps. You might need to remove PuLP from pip first.)

python -m pip install -U git+https://github.com/coin-or/pulp

Then you can use 'HiGHS_CMD' inside pl.getSolver command. See this documentation for a full example (replace 'CPLEX_CMD' with 'HiGHS_CMD').

$\endgroup$
1
  • 1
    $\begingroup$ pip install highspy now works on MacOS and Linux $\endgroup$ Sep 23 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.