-
-
Notifications
You must be signed in to change notification settings - Fork 423
Description
Details for the issue
What did you do?
HiGHS solver offers an option, mip_max_improving_cols, to terminate early based on the number of improving solutions observed thus far. I was able to use the option via pulp's solverParams argument:
model.solve(solver=pulp.HiGHS(mip_max_improving_sols = 1))
What did you expect to see?
I expected to see a feasible solution after the solver has executed.
What did you see instead?
Although the output available showed that the problem was feasible, after solving, I saw a key error as pulp did not recognize the status code produced by the highspy library:
if obj_value == float(inf) and status in (
HighsModelStatus.kTimeLimit,
HighsModelStatus.kIterationLimit,
):
return (
constants.LpStatusNotSolved,
constants.LpSolutionNoSolutionFound,
)
else:
> return status_dict[status]
^^^^^^^^^^^^^^^^^^^
E KeyError: <HighsModelStatus.kSolutionLimit: 16>
.venv/lib/python3.13/site-packages/pulp/apis/highs_api.py:517: KeyErrorI suspect this is because the latest version of PuLP does not include the highspy key. It looks as though PuLP covers many of the other status codes. I'm currently using highspy 1.12.
Thank you for your work on this project. Please let me know if additional information is needed.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
- Windows: ( version: ___ )
- Linux: ( distro: ___ )
- Mac OS: ( version: ___ )
- Other: ___
I'm using python version:
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- [x ] Other: 3.13.5
I installed PuLP via:
- pypi (python -m pip install pulp)
- github (python -m pip install -U git+https://github.com/coin-or/pulp)
- [ x] Other: uv
Did you also
- [x ] Tried out the latest github version: https://github.com/coin-or/pulp
- Searched for an existing similar issue: https://github.com/coin-or/pulp/issues?utf8=%E2%9C%93&q=is%3Aissue%20