[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Incomplete output when using "--cuts" option
From: |
glpk xypron |
Subject: |
Re: [Help-glpk] Incomplete output when using "--cuts" option |
Date: |
Fri, 15 Oct 2010 22:18:27 +0200 |
Hello Greg,
> and a constraint where kcoversi >= inuse -- which should force koversi to
> take on values of only 0 or 1 without being declared binary.
This is only true if kcoversi is in the objective, e.g.
minimize obj :
sum{(k,i) in CurCoverage} kcoversi[k,i];
E.g. inuse = 0, kcoversi = 0.8 satisfies above constraint. The
objective may force kcoversi to 0.
> printf{(k,i) in CurCoverage: kcoversi[k,i] >0}: "%f, %f, %f\n", k, i,
> kcoversi[k,i];
the solution of GLPK is only calculated to limited accuracy. Hence
if the precise solution is kcoversi = 0, you might get a value of
-1e-08 or +1e-08. If you expect kcoversi to be either 0 or 1, I suggest
to use
printf{(k,i) in CurCoverage: kcoversi[k,i] > 0.5}: "%f, %f, %f\n", k, i,
kcoversi[k,i];
If your problem should be, that above printf statement did not report
a value of kcoversi > 0.5, please, provide the following information
needed to reproduce the problem
- operating system
- version of GLPK
- command line used
- example file
If you do not want to share the example file with the whole list, just
send it to me only.
Best regards
Xypron
-------- Original-Nachricht --------
> Datum: Fri, 15 Oct 2010 15:40:48 -0400
> Von: Greg Gruber <address@hidden>
> An: address@hidden
> Betreff: [Help-glpk] Incomplete output when using "--cuts" option
> Hello,
>
> I am using the standalone glpsol solver to solve a MIP. I had been using
> it
> with the "--cuts" option, but noticed a strange problem. My model
> includes
> a binary variable indexed over a large set. Like this:
>
> set CurCoverage dimen 2;
> .
> .
> .
> var kcoversi {(k,i) in CurCoverage} >=0, <= 1;
> var inuse {c in Combinations} binary;
>
> and a constraint where kcoversi >= inuse -- which should force koversi to
> take on values of only 0 or 1 without being declared binary.
>
> After I solve the model, I want to see which values of kcoversi are = 1,
> so
> I have an output statement like this:
>
> printf{(k,i) in CurCoverage: kcoversi[k,i] >0}: "%f, %f, %f\n", k, i,
> kcoversi[k,i];
>
> when I solve without the "--cuts" option, everything works fine. When I
> solve with the "--cuts" option, I get the same result for the objective,
> but
> when I use the printf command to display for which values of CurCoverage
> is
> kcoversi=1 (as above), it is missing a small number of tuples. If I just
> display all values of kcoversi, the correct results are displayed.
>
> Any ideas?
>
> thanks,
> Greg
>
> --
--
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl