5

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?

Mason
  • 515
  • 4
  • 8
  • 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. – Sune Sep 21 '22 at 07:25

1 Answers1

7

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').

berkorbay
  • 341
  • 1
  • 3