Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking for model feasibility following solve #238

Closed
jGaboardi opened this issue Jun 1, 2022 · 0 comments
Closed

checking for model feasibility following solve #238

jGaboardi opened this issue Jun 1, 2022 · 0 comments

Comments

@jGaboardi
Copy link
Member

Following up from #237, we should probably be checking to the solution status following a .solve() attempt. This is because pulp does not raise an exception when model is not solved. However, a status code can be retrieved through the status attribute following a solution attempt:

LpStatus key string value numerical value
LpStatusOptimal "Optimal" 1
LpStatusNotSolved "Not Solved" 0
LpStatusInfeasible "Infeasible" -1
LpStatusUnbounded "Unbounded" -2
LpStatusUndefined "Undefined" -3

Basically, we'll want to check the status and raise an exception (or at the very least a warning) if the status is anything but 1. See here for a gist demonstrating an example.

cc @qszhao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants