False Positive of Model being Infeasible, maybe about exponential constraints
Awaiting user inputfrom gurobipy import GRB
import gurobipy as gp
def solve_from_ilpfile(filename):
# Create a new model
m = gp.read(filename)
# Optimize model
m.optimize()
# Print solution
if m.status != GRB.INFEASIBLE:
print('Optimal objective: %g' % m.objVal)
m.write("output.sol")
else:
print('Optimization was stopped with status %d' % m.status)
return m
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("filename", help="input ilp file", default="iis.ilp.txt")
args = parser.parse_args()
res = solve_from_ilpfile(args.filename)
print(res)
-
Hi Lei,
Could you please update to Gurobi version 12 and try again.
If you are not able to upgrade to version 12, please try setting the FuncNonlinear parameter to 1.
This will tell Gurobi to treat the \(\exp\) function as a nonlinear term and not via a piecewise-linear approximation. Fore more details, please refer to the documentation about Solution strategies for nonlinear models.
This model, involving exponetial constraints, should have obvious feasible solution according to my observation.
Are you able to construct one such feasible solution? If yes, then please try providing it via a MIPStart, see How do I use MIP start?
You could try removing portions of other constraints (not the \(\exp\) one) and see whether the model still remains infeasible. This would be useful to construct a smaller version of your infeasible model, which might be easier to analyze.
If nothing of the above helps, could you please share your original model?
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment