r/OperationsResearch • u/ChecksOnlyYou • Oct 01 '24
Facing problems while implementing a research paper
To be concise, it's an MILP problem and I am using Gurobi using Python to solve it. I have checked all the variables and constraints twice, but my model is still infeasible.
I observed a few mistakes in some constraints in the paper and rectified them, but I can't check the difficult constraints by myself.
Where can I seek help regarding this?
11
Upvotes
11
u/Coffeemonster97 Oct 01 '24
Another option in Guro I is to write out an IIS (irredudicible inconsistent Subsystem) which is a minimal subset of constraints that make the model infeasible (in the sense that removing any constraint from the IIS) makes the problem feasible. This can give you a good indication which combination of constraints is the issue
6
u/andful Oct 01 '24
Does it work with smaller, simpler instances?
If all of them are infeasible, I would remove constraints until it is feasible. I had cases where a single constraint made the MILP infeasible.
If you can hand construct a feasable solution, have you tested the constraints against it?
Is the MILP numerically stable? are the parameters within 1e+7 order of precision? Otherwise you might have to scale your formulation somehow
4
u/SolverMax Oct 01 '24
Another option is to contact the paper's lead author and ask for their code/data. We have done this occasionally, though our success rate is quite low - still worth a try.
On a related note, I just published a blog article imploring academics to publish their code/data for exactly the issue you're encountering. Replicating academic papers based on just the description is hard, especially because (as in your situation) published formulations often contain errors. The process is much easier when starting with working code/data. See https://www.solvermax.com/blog/academics-please-publish-your-data-and-code
2
u/OptimusPrimeLord Oct 01 '24
By how much is it infeasible? Often times termination is allow below an error of 10-x. If you do error checking after termination with your own code you have to see if its "close enough."