I am new to AMPL. I am trying to solve an MINLP problem using Couenne.
I tried to solve my problem by looking at the manual and writing mod file, and it generated some results, but the result does not make sense.
I wonder (1) what I have done wrong, and (2) how I can know that the solution is invalid (because it seemed like it was generating results okay).
Below is my mod file.
var n0 >= 2 <= 111 integer;
var x0 >= 1 <= 110 integer;
var n1 >= 2 <= 3 integer;
var x1 >= 1 <= 2 integer;
minimize obj: (111/x0)*(3/x1);
subject to c1: 28416*x0 + 4*x1 <= 262144;
subject to c2: x0*n0 == 111;
subject to c3: x1*n1 == 3;
I am not sure if this is allowed, but I wanted x0 and x1 to be an integer whose integer multiple is 111 and 3, respectively (i.e., x0 in {1, 3, 37, 111} and x1 in {1,3}), hence introduced n0 and n1 and put c2 and c3.
And below is the output log from AMPL. Seemed like something was working, but it wasn't.
==================================
ampl: model wrong2.mod
ampl: option solver couenne;
ampl: solve;
Couenne 0.5.7 -- an Open-Source solver for Mixed Integer Nonlinear Optimization
Mailing list:
cou...@list.coin-or.orgInstructions:
http://www.coin-or.org/Couennecouenne:
ANALYSIS TEST: NLP0012I
Num Status Obj It time Location
NLP0014I 1 OPT 8.9999999 17 0.008
Couenne: new cutoff value 9.0000000000e+00 (0.016 seconds)
Loaded instance "/tmp/
at7601.nl"
Constraints: 2
Variables: 4 (4 integer)
Auxiliaries: 6 (2 integer)
Coin0506I Presolve 0 (-2) rows, 0 (-10) columns and 0 (-4) elements
Clp0000I Optimal - objective value 9
Clp0032I Optimal objective 9 - 0 iterations time 0.002, Presolve 0.00
Clp0000I Optimal - objective value 9
Cbc0012I Integer solution of 9 found by Couenne Rounding NLP after 0 iterations and 0 nodes (0.00 seconds)
NLP Heuristic: NLP0014I 2 OPT 9 0 0
no solution.
Cbc0001I Search completed - best objective 9, took 0 iterations and 0 nodes (0.00 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Clp0000I Optimal - objective value 9
"Finished"
Linearization cuts added at root node: 2
Linearization cuts added in total: 2 (separation time: 0s)
Total solve time: 0s (0s in branch-and-bound)
Lower bound: 9
Upper bound: 9 (gap: 0.00%)
Branch-and-bound nodes: 0
couenne: Optimal
ampl: display x0
ampl? ;
x0 = 37
ampl: display x1;
x1 = 1
ampl: display obj.result;
obj.result = solved
====================================
As you can see, the solution of x0=37, x1=1 does not meet the constraint c1 (
28416*x0 + 4*x1 <= 262144;
).
However, (1) I am not sure why it is wrong (is my .mod file flawed?), and (2) how I should know if the result is valid or not (it says obj.result == solved!).
Any help or pointers would be highly appreciated.
Thank you!