-
Notifications
You must be signed in to change notification settings - Fork 115
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
CBC MILP Solver returns "Infeasible" status, but lpsolve in R gives "feasible" #608
Comments
Does not look like an error in Cbc - but in the pulp interface. Have you tried a more recent version of pulp? Running cbc 2.10.3 on python_1.mps looks fine bin/cbc /tmp/python_1.mps -ratiogap 0.05 -allowablegap 0.05 -maximize -solve command line - ../bin/cbc /tmp/eeeeee/python_1.mps -ratiogap 0.05 -allowablegap 0.05 -maximize -solve (default strategy 1) |
@jjhforrest Thank you very much for your quick reply, Dr. Forrest. My One minor information - I ran |
I know very little about pulp, but I downloaded pulp. Ran it from pulp as
Output - command line - /home/john/pulp/pulp/apis/../solverdir/cbc/linux/64/cbc /tmp/c3527ebbb1414f418780894de32fc856-pulp.mps max basisin /tmp/lp.bas timeMode elapsed branch basisout /tmp/lp.bas printingOptions all solution /tmp/c3527ebbb1414f418780894de32fc856-pulp.sol (default strategy 1) 1 |
@jjhforrest Thank you so much. It is indeed weird, because I replicated your step and still got var2, prob2 = pulp.LpProblem.fromMPS("/Users/MyName/Downloads/python_1.mps",pulp.LpMaximize) |
The differences start at the Presolve step of CBC. Mine was Presolve 193 (-180) rows, 289 (-123) columns and 1011 (-1049) elements compared to yours: Presolve 195 (-178) rows, 289 (-123) columns and 1031 (-1029) elements The 0th iteration showed a huge discrepancy in terms of result. So weird. Is this due to the FACT that you ran 'cbc' on Linux, while I ran it on Windows 10 (64-bit)? |
@jjhforrest Hi Dr. Forrest, I am wondering if you have some time to think about the potential sources of the discrepancy? I tried turning off the |
It seems to me that fromMPS is broken. If I do writeMPS on a small miplib problem like enigma, I can see that some of RHS values are missing. If I edit file so that only one RHS value per line it works. With MARKER INTORG in file pulp thinks problem is integer - if BV in bounds then it thinks it is a continuous problem. |
@jjhforrest Good morning, thank you very much for your further investigation. Didn't your second test above with Please help give the below |
@jjhforrest @dpo @chmduquesne Could either of you help give these problems ( Infeasible1.mps file - Output from CBC
Infeasible2.mps file - Output from CBC:
Infeasible3.mps file - Output from CBC solver
If I use |
I have tried several solvers which all say infeasible. Take Infeasible2.mps - if I look at rows _C29 and _C585 G _C29 L _C585 |
@jjhforrest Thank you so much for your help on trying different solvers. Did you still get 'Infeasible' status with Infeasible1.mps AND Infeasible3.mps files with those different solvers? Because if that is the case, the problem now is actually with the Another question though: how were you able to identify those two identical constraints? Going through the |
Other solvers say infeasible. On Infeasible2.mps clp with loglevel 3 gives Problem is infeasible due to row 584, -1.797693134862316e+308 710 |
Do the other solvers say the same thing for Infeasible1.mps and Infeasible3.mps? I am trying to reinforce why the two packages |
@jjhforrest Do you have any ways to read this '.lp' file into Python and call CBC solver to solve it? This '.lp' file is generated by R, but my thorough inspection shows that it is mathematically equivalent to the LP in 'Infeasible2.mps' file. |
@tkralphs Thank you. |
@jjhforrest Hi Dr. Forrest, I figured out the above problem by turning off the @tkralphs Have you ever tested your |
I am currently encountering a very weird issue with the
PULP_CBC_CMD
solver viapulp
package in Python (CBC MILP Solver version 2.10.3). Despite playing around with the parameter optionsgapAbs
andfracGap
, I had no way to make the CBC MILP solver to avoid running intoinfeasible
status. However, the optimization model is actually feasible (the model is an LP problem, with all variables being continuous between 0 and 1), as it was solved quickly and easily vialpsolve
package in R. I then compared the two models and could confirm that they are identical (so, the part of building the model in 2 languages is fine). I am wondering if anyone could help me figure out how to fix this incorrect issue?Attached is the model in
.lp
and.mps
format, exported from both Python and R (you can see the filename to determine which one is exported from Python). I also include the.txt
log file given by the CBC run. I also compute the values of the constraints as well as their corresponding slacks below:log.txt
Downloads.zip
The text was updated successfully, but these errors were encountered: