coin-or / coin-or/pulp

SCIP_PY reporting inexistent solution

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

Description

Details for the issue
--------------------

#### What did you do?

##### ... HARD PROBLEM THAT TAKES MANY SECONDS TO SOLVE

prob.solve(lp.SCIP_PY(**{
"msg": True,
'options': [
'limits/time', 4
]
}))
print('Status', prob.status)
print("Translated Status:", LpStatus[prob.status])
##### Reports:
###### Status 1
###### Translated Status: Optimal

Meanwhile internally:

status = scip_to_pulp_status[solutionStatus]
print(f'{solutionStatus=} {status=}')

##### Reports: solutionStatus='timelimit' status=0

num_solutions = lp.solverModel.getNSols()
print(f'=====> {num_solutions=}')

###### Reports: =====> num_solutions=0

#### What did you expect to see?

If number of solutions is 0 and the solver returns timelimit reached pulp should not report 'optimal' and allow access to model (that does not meet the constraints)

#### What did you see instead?
You can access a model that does not obey the constraints

Useful extra information
-------------------------

The info below often helps, please fill it out if you're able to. :)

#### What operating system are you using?

- [X] Windows: ( _version:11)

#### I'm using python version:

- [ X] 3.12

#### I installed PuLP via:

- [X] pypi (python -m pip install pulp)

#### Did you also

- [x] I'm submitting a tentative PR that should fix this issue

Contributor guide

Open the contributing guide

Research direction

Start at the SCIP_PY solver path where solutionStatus is translated to the PuLP status, then inspect how solverModel.getNSols() is handled after a time limit. Done means a time-limited solve with zero solutions is not reported as Optimal and does not expose an invalid model.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.