[AMPL 25071] Variable declared as Integer/ Results is fractional

Dear team,

I am new to AMPL softwares. I am trying to solve a MINLP problem using gurobi. However, the outcome of the integer variable is sometimes fractional numbers.

Is it a common case for AMPL solvers to obtain fractional outcomes for integer variables?
One the other hand, how can we relax this integer variable? In the case of relaxation is there any impact on the global optimal solution if available?

Attached are my scripts in case that it is necessary to help me fix this issue.

Best Regards,
Fidele

(attachments)

Computercafee_2024_12_09.mod (5.84 KB)
Computercafee_2024_12_09.run (406 Bytes)
Computercafee_2024_12_09.dat (9.28 KB)

I see just one integer variable in your model:

var CVE integer >= 0;

But when I solve your problem using include Computercafee_2024_12_09.run; the value of CVE in the results is integer:

ampl: include Computercafee_2024_12_09.run;
........
Gurobi 12.0.0: optimal solution; objective 51263455.89
3121 simplex iterations
3 branching nodes
.......
ampl: option display_precision 0;
ampl: display CVE;
CVE = 4

(By setting option display_precision 0; I am asking display to use the maximum precision possible, to be sure the result value is exactly 4.)

I also get this result with Gurobi version 11, though it uses a different algorithm.

The integer variable can be relaxed by use of the .relax suffix, like this:

let CVE.relax := 1;
solve;

Then CVE has a fractional result value, and the maximal objective value is higher:

Gurobi 12.0.0: optimal solution; objective 51440779.46
5172 simplex iterations
3 branching nodes
.......
ampl: option display_precision 0;
ampl: display CVE;
CVE = 4.339090190246878

Can you post an example (including the files) where CVE is supposed to be integer, but it is fractional in the result?