[Couenne] [HELP]- An AMPL model solved by couenne

Pietro Belotti petr.7b6 at gmail.com
Mon Jan 12 18:22:42 EST 2015


Dear Ying,

Couenne does not handle the min operator (yet), so that min {}
quantity in your model needs to change. However, it seems this can be
done rather easily: the min() operator is used when Com_status[j]=3,
which corresponds to Posi_status[j]=1, for which Comscore[j] is taken
with positive sign (and has nonnegative weight in the objective).
Therefore, you could introduce a new variable as follows:

var z;

subject to def_z {i in N_class, j in ATTRIBUTE: Com_status[j] == 3}: z
<= ComService[i,j];

and then change the definition of ComScore as follows:

var ComScore {j in ATTRIBUTE} =
    if Com_status[j]==1 then sum {i in N_class} ComService[i,j]
        else if Com_status[j]==2 then (prod {i in N_class} ComService[i,j])
            else if Com_status[j]==3 then z
                    else sum  {i in N_class} ComService[i,j] /5;

and you should be able to obtain an optimal solution to the problem.
As for the near-integrality of the solution, many solvers treat values
such as -1e-16 as nearly integer, since it's very close to zero.

Pietro


On Mon, Jan 12, 2015 at 11:11 AM, 霍瑛 <huoying at nuaa.edu.cn> wrote:
> Dear All,
>
> I have an AMPL model that can would be solved by using couenne.
>
> The files are "randA.dat 5-10-1.mod". The error message is "couenne:
> ANALYSIS TEST: ERROR: unknown operator".
>
> I know I may use operators that are not supported by Couenne from
> "http://list.coin-or.org/pipermail/couenne/2012-June/000304.html"
>
> I tried many times, and after I delete the "min" operator. The new files are
> "randA.dat 5-10.mod 5-10.run", and it can be solved by couenne.
>
> couenne: Optimal
> use [*] :=
>  3   1
> 15   1
> 29   1
> 36   1
> 40  -2.22045e-16
> 46   1
> ;
>
> But I need to solve the old problem (the one with the min operator), is
> there another method for this?
>
> Besides, for the new problem (without the min operator), we set the variable
> to be binary: "var use {i in N_candidate} binary;".
> But the above result "40  -2.22045e-16"  is not an integer. Why? And how can
> I always get the binary result?
>
>
>
> Thank you very much!
>
> Ying Huo
>
>
> _______________________________________________
> Couenne mailing list
> Couenne at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/couenne



More information about the Couenne mailing list