bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-glpk] Binary Variable GLPK for Java


From: Andrew Makhorin
Subject: Re: [Bug-glpk] Binary Variable GLPK for Java
Date: Wed, 24 Jul 2013 12:40:30 +0400

> We are using GLPK Simplex Optimizer v4.47 for Java, and we are stuck
> on a problem whose variables should be binary but they act like float.
> Here is some code:
> 
> for (LinkedList<Rota> rotas : rotasVeiculos) {
>             for (k = 1; k <= rotas.size(); k++) {
>                 GLPK.glp_set_col_name(mip, i, "X" + (j) + "-"+(k));
>                 GLPK.glp_set_col_kind(mip, i, GLPKConstants.GLP_BV);
>                 i++;
>             }
>             j++;
> }
> 
> We have already tried to change the kind for IV(Integer Variable) and
> set the Bounds to min 0 and max 1, but we got the same result.
> 
> Here some results we got for these variables:
> 
> X1-10680      5.551115123125778E-17
> X1-111385     1.9721522630525295E-31
> X1-122911     0.5
> X2-525                0.5
> X3-9          0.499999
> X3-17                 1.0
> X3-3139       2.2204460492502534E-18
> X3-3594       5.9164567891575885E-31
> X4-111385     1.0
> X5-808                0.4999999
> 

Please make sure that: i) you solve your instance with glp_intopt, and
ii) you obtain solution components with glp_mip_col_val. Thanks.


Andrew Makhorin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]