David Doria - 7 months ago 70

Python Question

When I add a particular constraint to my problem, the LpStatus of the problem after solving changes to "Undefined" (without this constraint, it was "Optimal"). At the top of this page, the possibilities of the return status are shown, but it doesn't seem to explain what they mean. Can anyone explain what an "undefined" status means? It it something like a syntax error in specifying the constraint?

Answer

There are five status codes that can be returned from a solver in PuLP:

- Optimal
- Not Solved
- Infeasible
- Unbounded
- Undefined

Optimal solution exists and is found.

Is the default setting before a problem has been solved.

The problem has no feasible solution.

The cost function is unbounded.

Feasible solution hasn't been found (but may exist).

They seem to be a mapping of the status codes from GPLK.

Most of the information comes from reading the source and this resource

Source (Stackoverflow)