Hello all,
I just started using AMPL, Gurobi and CPLEX yesterday.
I wrote the following model:
set LINKS = 1 .. 4 ;
param g{j in LINKS} >=0 ;
var b {LINKS} >=0 ;
var a {LINKS} binary ;
minimize noc: sum {j in LINKS} g[j]*b[j];
subject to thresh {j in LINKS}: a[j]*g[j]*b[j] >= 4;
And the following data file:
param: g :=
1 2
2 3
3 4
4 5 ;i then run this in AMPL, and these are my results:
ampl: reset; model ../models/net_simple.txt; data ../data/simple_net.txt; solve;
Gurobi 5.0.1: optimal solution; objective 15.99998243
10 simplex iterations
No dual variables returned.
ampl:
ampl:
ampl: display b;
b [*] :=
1 1.99999
2 1.33333
3 1
4 0.8
;
ampl: display a;
a [*] :=
1 1
2 1
3 1
4 1
;
ampl: option solver cplex;
ampl:
ampl: reset; model ../models/net_simple.txt; data ../data/simple_net.txt; solve;
CPLEX 12.5.0.0: IBM ILOG CPLEX Optimization Studio Commercial Edition ÿ
optimal integer solution; objective 15.99999998
11 MIP simplex iterations
0 branch-and-bound nodes
No basis.
ampl:
ampl: display b;
b [*] :=
1 2
2 1.33333
3 1
4 0.8
;
ampl: display a;
a [*] :=
1 1
2 1
3 1
4 1
;
ampl:
So why did Gurobi give me a solution that included an answer of b[1] = 1.9999, instead of 2 which is apparently the correct answer?
And does anyone know why the objective reached was 15.99999, and not 16 (Which is the obviously correct answer)?
Even in CPLEX, which figured out that b[1]=2, it still misscalculated the objective. Is there a way to fix this?
and what does "No dual variables returned." mean?
Is there a book i can read that discusses MIP in combination to AMPL/Gurobi ?
Thanks
--
---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
gurobi+un...@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.