8
$\begingroup$

I should note that I am very new to Gurobi so apologies if this is obvious. I am working on a project for a class to maximize profit on a theoretical flight network by deciding which routes to fly at what time and with what type of plane using a linear program. However, I keep running into a problem where there aren't any feasible solutions, but it doesn't seem like there should be interfering constraints from what I can tell. I used a loop to add all of the constraints, and I suspect the problem lies with the way I set the loop up. Is there a way to output a list of all the added constraints? It would be a very helpful way to troubleshoot.

$\endgroup$
  • 1
    $\begingroup$ Welcome to OR.SE. Gurobi has some nice videos and tutorials for beginners which can be useful. you could check your loop definition using these materials. Would you see them? (E.g. this or this links) . Also, the answer that @Marco mentioned is very helpful. $\endgroup$ – A.Omidi Mar 9 at 5:35
6
$\begingroup$

Sometimes computing an IIS helps addressing the source of the infeasibility in the model.

Example Usage:

model.computeIIS()
model.write("model.ilp")

https://www.gurobi.com/documentation/9.0/refman/py_model_computeiis.html https://www.gurobi.com/documentation/9.0/examples/diagnose_and_cope_with_inf.html

| improve this answer | |
$\endgroup$
4
$\begingroup$

what I typically do for debugging purposes is to output the model to a file in a "readable" format like LP format using

model.write("myfile.lp")

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.