For the test files you have provided, even though CPLEX reports
CPLEX 12.7.0.0: optimal integer solution; objective 0.03214
the solution returned by CPLEX is not actually feasible, as can see by displaying the smallest slack value:
ampl: print min {i in 1.._ncons} _con[i].slack;
-0.9812740339744828
In fact CPLEX is finding a feasible solution for the problem that AMPL is sending it, but AMPL is not sending CPLX the problem that you intended. The trouble is that you have constraints like
ampl: expand hac31[4,5];
subject to hac31[4,5]:
-l[4] - l[5] - 1e+06*yhac3[4,5] <= -0.832666;
Given the values to which you have fixed l[4] and l[5], this constraint amounts to just a bound on a zero-one variable: yhac3[4,5] >= 8.22456e-07. The default setting of option presolve_inteps 1e-6 causes this constraint to "Eliminated by presolve" as you can see by using "solexpand" to see what was sent to the solver:
ampl: solexpand hac31[4,5];
subject to hac31[4,5]: # Eliminated by presolve.
-1e+06*yhac3[4,5] <= -0.822456;
If you set, say, "option presolve_inteps 1e-8;" then AMPL's presolve phase will give you a lot of error messages,
presolve, constraint hac13[4,5]:
all variables eliminated, but upper bound = -6.17414 < 0
presolve, constraint hac13[3,4]:
all variables eliminated, but upper bound = -5.7993 < 0
presolve, constraint hac13[2,5]:
all variables eliminated, but upper bound = -6.38833 < 0
presolve, constraint hac13[2,4]:
all variables eliminated, but upper bound = -6.11661 < 0
presolve, constraint hac13[2,3]:
all variables eliminated, but upper bound = -6.046 < 0
9 presolve messages suppressed.
which are basically telling you that no feasible solution to your problem is possible. Alternatively if you set "option presolve 0;" then the problem will be sent to CPLEX which will report "integer infeasible".
So it seems your problem really is infeasible. To avoid all this trouble, don't use such a large value of M. In a constraint like
l[i] + l[j] <= PI - theta[i] - theta[j] + yhac1[i,j]*M
you can use any M that is >= the largest possible value of (l[i] + l[j]) - (PI - theta[i] - theta[j]) in a feasible solution -- so you can use a much smaller number than 1000000. Even when I set M = 100000, AMPL's presolve reports no feasible solution possible even when presolve_inteps is left at its default value. But it is a good practice not to make M a great deal larger than necessary; I have written more about this in a blog post called The Big M.
Bob Fourer
am...@googlegroups.com
the solution returned by CPLEX is not actually feasible, as can see by displaying the smallest slack value:
ampl: print min {i in 1.._ncons} _con[i].slack;
-0.9812740339744828
So it seems your problem really is infeasible.