Page 1 of 1

Having trouble with GAMS

Posted: Wed Aug 23, 2017 4:09 pm
by MAHMOUDRayan
Hello,
Good time.

I wrote a source code, but I can not solve with the GAMS software and I encounter the following messages:

Integer infeasible
CPLEX error 1217: No solution exists
MIP status (119) is integer infeasible or unbounded

This project is simple and should be solved by this powerful software.
I searched a lot to solve this problem, but I did not get any results.
This project is important to me.
Help me please. I do not know where the problem can be?

I've added the project as an attachment.
Thanks.

Re: Having trouble with GAMS

Posted: Wed Aug 23, 2017 9:19 pm
by yanzhiping
You can set solver to Cplex.

Code: Select all

Option mip =cplex;
BCCf1.optfile = 1;
BCCf2.optfile = 2;
creat 2 option files cplex.opt/cplex.op2. cplex.opt is for BCCf1, and cplex.op2 is for BCCf2.
In cplex.opt,
writelp BCCf1.lp
In cplex.op2,
writelp BCCf2.lp
after you get the lp files, test them only for a single iteration.
if they are still infeasible.
use cplex to check the infeasibility.
run cplex in command line of your computer,

Code: Select all

cplex
read BCCf1.lp
tools conflict
then it will give your the minimum number of conflict constraints.

Hope it works for you!

Re: Having trouble with GAMS

Posted: Sat Aug 11, 2018 1:59 pm
by MAHMOUDRayan
Hello,
thank you.
Sorry... .
But I could not solve the problem. Unfortunately, I do not know exactly where to put the solution that you have been told. Please guide me further.

Re: Having trouble with GAMS

Posted: Mon Aug 13, 2018 7:11 am
by bussieck
Hi,

I can help you with getting the various analysis tools the solvers offer to run, but you need to analyze the output and modify the model yourself. There are three ways of analyzing infeasibilities that I find helpful:

1) Since you are convinced that the model has a feasible point, provide it in the variable attribute .l (x.l = ...;) before the solve, turn the equation listing all on (option limrow=1e9;) and solve. Check the equation listing for INFES in the equation listing to see where your "feasible" solution is actually infeasible.

2) Automatic relaxation. You can find a minimal relaxation of your infeasible model by allowing bounds and constraints to be violated. You can give different weights to the bounds and constraints and even do not allow to violate some bounds and constraint. This all can be accomplished by adding slack variables to your model and the slacks into the objective with different weights. Some solver, like Cplex, have an option to do this automatically (see https://www.gams.com/latest/docs/S_CPLE ... RELAXATION).

3) Use the conflict refiner (suggested by the previous answer). Just supply the "iis yes" in an option file and look at the listing file to get the smallest set of constraints and bounds that make the problem infeasible. In your case the set is rather larger and hence the tool is not that useful.

You find a nice write-up by Bruce McCarl about how to deal with infeasible models in the 40th issues of his newsletter in chapter 3: https://www.gams.com/fileadmin/communit ... news40.pdf.

I modified your GAMS program so it stops in the first iteration. No point in solving hundreds of models when you are debugging. I also create the necessary option files as part of the program.

-Michael