Hello Sir,
Could you please help me check what is the error in my optimization model? The solver displays the output such as:
ampl: reset;
ampl: model Practicemodel.mod;
ampl: data Practicemodel.dat;
ampl: option solver gurobi;
ampl: option gurobi_options ‘nonconvex=2’;
ampl: solve;
Presolve eliminates 2590 constraints and 2268 variables.
Substitution eliminates 66 variables.
Adjusted problem:
515 variables:
146 nonlinear variables
369 linear variables
853 constraints; 2286 nonzeros
92 nonlinear constraints
761 linear constraints
332 equality constraints
521 inequality constraints
1 nonlinear objective; 149 nonzeros.
Gurobi 10.0.1: qp:nonconvex=2
Gurobi 10.0.1: infeasible problem
621 simplex iterations
1 branching nodes
suffix dunbdd OUT;
ampl: reset;
ampl: model Practicemodel.mod;
ampl: data Practicemodel.dat;
ampl: option show_stats 1;
ampl: option gurobi_options ‘outlev=1 nonconvex=2’;
ampl: solve;
Presolve eliminates 2590 constraints and 2268 variables.
Substitution eliminates 66 variables.
Adjusted problem:
515 variables:
146 nonlinear variables
369 linear variables
853 constraints; 2286 nonzeros
92 nonlinear constraints
761 linear constraints
332 equality constraints
521 inequality constraints
1 nonlinear objective; 149 nonzeros.
Gurobi 10.0.1: tech:outlev=1
qp:nonconvex=2
Gurobi 10.0.1: infeasible problem
621 simplex iterations
1 branching nodes
suffix dunbdd OUT;
ampl:
Attached is my model.
Practicemodel.mod (10.4 KB)
Practicemodel.dat (2.21 KB)
When you see “Gurobi 10.0.1: infeasible problem” it means Gurobi has determined that your problem has no feasible solution: there is no way to assign values to the variables that are within the variables’ bounds and that also satisfy all of the constraints. This may be due to an error in your model. Or it may be that your data simply doesn’t permit a feasible solution; for example, some capacities may be too low to permit all demands to be met.
There is no simple and general way to deal with an error like this; you may need to study the model for a while before you can understand the cause of the infeasibility. It is possible to suggest some good ways to get started, however.
As an initial troubleshooting step, it is often helpful to use AMPL’s expand command to see see whether AMPL generated the constraints that you expected. By itself, expand; shows all of the constraints. If there are many of them, you can use, for example, expand C1; to expand all of the constraints that have a particular name. Also you can write, for instance, expand >listing.txt; or expand C1 >listing.txt; to send all of the output to the file listing.txt.
You should also consider using AMPL’s drop and restore commands to narrow your search for the cause of the infeasibility. If you drop some constraints and the resulting problem is still infeasible, then you don’t need to consider the dropped constraints in looking for the cause of infeasibility. By trying a series of drops, you may be able to determine that infeasibility is being caused by only a small subset of the constraints.
To get more help with diagnosing the infeasibility, you can ask Gurobi to compute an irreducible infeasible subset. For more on this topic, search “IIS” at https://groups.google.com/group/ampl, and also see the discussion of “infeasibility diagnosis” in chapter 14 of the AMPL book (https://ampl.com/BOOK/CHAPTERS/17-solvers.pdf#page=25).