Model optimal with continuous variables but infeasible with integer

Problems with modeling
Post Reply
SergioCS147
User
User
Posts: 2
Joined: 2 years ago

Model optimal with continuous variables but infeasible with integer

Post by SergioCS147 »

Hello!

I am working on an MIP whose continuous variables I want to make integer. With continuous variables I obtain an optimal solution and most (all but 2) of those variables are actually integers, even though they are continuous. I wanted to force the solution to be integer, so I made them positive integer variables with a suitable upper bound, but running the model this way makes it unfeasible. I see no restrictions that might create this unfeasibility, only an equality, but this equality is a sum of integer variables is an integer, which shouldn't cause any trouble.
User avatar
AndreSchnabel
User
User
Posts: 5
Joined: 3 years ago

Re: Model optimal with continuous variables but infeasible with integer

Post by AndreSchnabel »

Hey Sergio,

first: Did you force the integrality for all variables or only those which already happen to be integer in the optimal solution for the model with continuous variables? I assume the former for now.

Have you tried solving your model as "relaxed MIP" by replacing "mip" with "rmip" in the solve statement? If the corresponding relaxed mixed-integer problem can be solved to optimality again, you can be sure of the discreteness restrictions are the only cause of the infeasibility.

You can track down the cause of the infeasibility by letting your solver compute the "irreducible inconsistent set". Not all solvers offer this feature but if you happen to use e. g. CPLEX you can activate it by putting "optfile=1 solver=cplex" in the text field at the top (adjacent the green "run" triangle) of your GAMS Studio window and create a textfile "cplex.opt" containing just one line "IIS=1" in the same directory of your GAMS model file (*.gms). This will show you a minimal list of inconsistent equations.

Alternatively you could manually disable equations, bounds or variable-integralities and check which elements of your model are in conflict.

If you are willing to share your model (maybe after converting it into scalar format in order to omit confidential information, see https://www.gams.com/documents/convert/) we may be able to help you more directly in reestablishing feasibility.

Kind regards,
André
SergioCS147
User
User
Posts: 2
Joined: 2 years ago

Re: Model optimal with continuous variables but infeasible with integer

Post by SergioCS147 »

Hello André,

Thank you for your kind help. As it turns out, there were no conflicting restrictions. For some reason, the version I was using was unable to solve it. Using a more recent version there were no problems.

Best,
Sergio.
Post Reply