ERGO-Code / HiGHS

Linear optimization software
MIT License
916 stars 171 forks source link

Inconsistent behavior between the CBC and HiGHS #1027

Closed SolverMax closed 1 year ago

SolverMax commented 1 year ago

I'm puzzled by inconsistent behavior between the CBC and HiGHS solvers.

Given the attached model, CBC returns the correct optimal solution of 15, while HiGHS fails with an error: "ValueError: Error when adding rows". The choice of solver is specified on line 3.

The HiGHS error occurs on line 30. However, if we comment out line 30 and uncomment line 31, then HiGHS works correctly.

When using HiGHS, why is it necessary to use pyo.value(Model.ShelfHeights[s]) rather than just Model.ShelfHeights[s] like we can with CBC (and GLPK)?

Pyomo version 6.4.3 HiGHS version 1.4.0 HiGHS_test.txt

odow commented 1 year ago

This seems like it is a bug in the Pyomo wrapper of HiGHS, rather than HiGHS the solver itself?

Perhaps open an issue there: https://github.com/Pyomo/pyomo/issues

jajhall commented 1 year ago

Indeed, as @odow says, this looks like an error in Pyomo. The ability to call HiGHS from Pyomo is pretty new, so there may well have been limited testing

SolverMax commented 1 year ago

Thanks, I've opened an issue at https://github.com/Pyomo/pyomo/issues/2656

SolverMax commented 1 year ago

Transferred to Pyomo project.