coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.11k stars 388 forks source link

Fail to read a solution from GLPK where its status is integer empty #287

Closed hysok2 closed 4 years ago

hysok2 commented 4 years ago

Hello,

I found that pulp fails to read a .sol file from GLPK when the status in the .sol file is INTEGER EMPTY. Here is the code that reproduces the error. test.py.txt

I think that the problem was that pulp did not treat the .sol file as a solution of MILP while actually it was MILP. To fix the problem, I believe isInteger should be true when the status in the .sol file is INTEGER EMPTY. That is, the list should include "INTEGER EMPTY".

Best,

Useful extra information

I'm opening this issue because:

I'm using PuLP on:

I'm using python version:

I installed PuLP via:

I have also:

pchtsp commented 4 years ago

Thanks for the issue.

I'm able to reproduce the issue.

I'm not sure your solution will work, though. Because the solution is indeed infeasible (and isInteger means a solution exists).

I'll check it further and add it as a test for the unittests when it's solved

pchtsp commented 4 years ago

You were right about adding the element to the list. I did not understand the meaning of isInteger. In fact it meant the problem was integer. Thanks again!