coin-or / coin-or/pulp

Add status code for early termination with feasible solution

Open
#568 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.5k
Forks
432
PR merge metrics
No merged PRs in 30d

Description

Describe the new feature
--------------------------

I'd like to request a status code for when solvers are terminated early with a feasible, possibly suboptimal solution.

For some MIP problems, it is common practice to terminate the solution when a "good enough" feasible solution is found. This is typically done using a time limit or a callback function.

PuLP does not have a status code that represents this. When the solve process is terminated early, the PuLP status code is `LpStatusNotSolved` whether or not a feasible solution was found. This is ambiguous, and it makes it difficult for the user to write code that can handle early termination.

This feature has been discussed before (e.g. in #382 ), but I can't find any indication that it's been implemented. The discussion mentions that `status` should be equal to `1` (`LpOptimal`) when at least one solution is found, but this is not the case for the SCIP solver in PuLP version 2.6.

Additional info
---------------
Please answer these questions before submitting your feature request.

#### Is your feature request related to an issue? Please include the issue number.

Yes, related to #382 .

#### Does this feature exist in another product or project? Please provide a link.

Gurobi gives more detailed status codes when the solve process is terminated (see [this link](https://www.gurobi.com/documentation/9.5/refman/optimization_status_codes.html))

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the earlier discussion in #382 and the SCIP solver status handling referenced in the issue. Determine how PuLP should distinguish early termination with a feasible solution from termination without one, and define the expected status behavior before checking whether other solver integrations need the same treatment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.