[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] un reduced filed
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] un reduced filed |
Date: |
Sun, 07 Nov 2010 14:14:57 +0300 |
> > Do you mean that the lp file produced by glpsol contains zero
> > coefficients (except cases I mentioned in my previous mail)? If so, it
> > is a bug, not a feature. Please post me an example. Thanks.
>
> Heh, since GLPK is not the only solver that does this, I had assumed it
> was something I didn't understand. (Gurobi also leaves the
> zero-coefficient terms in.) I'm somewhat relieved to know that perhaps
> I /did/ understand it. I'm a relative weakling/noob to the OR world.
>
> Here's an LP file that recreates the 0-coefficient terms that I'm
> seeing. (Note that I'm aware that the LP file is horribly put
> together.) With this example file, GLPK appears to leave 0-coefficient
> terms not only in the objective function, but also in later constraints.
>
> http://cygnus.ce.ncsu.edu/~kevin/tmp/leaves_zero_coeffs.lp.xz [27KiB]
This is a fragment from an lp file generated by glpsol 4.44:
Minimize
obj: + PeriodCost(2010) + PeriodCost(2015) + PeriodCost(2020)
+ PeriodCost(2025) + PeriodCost(2030) + PeriodCost(2035)
+ PeriodCost(2040) + 0 xu(geo,2020,2015) + 0 xu(geo,2025,2015)
+ 0 xu(geo,2030,2015) + 0 xu(geo,2035,2015) + 0 xu(geo,2040,2015)
+ 0 xu(geo,2030,2025) + 0 xu(geo,2035,2025) + 0 xu(geo,2040,2025)
. . .
The zero terms appear because corresponding columns are empty, i.e.
corresponding structural variables have zero coefficients in the
objective as well as in all constraint rows. Cplex lp format does not
allow to define variables separately out of objective/constraint rows,
so the only way to keep such variables in the model is to include them
in some row (for example, in the objective row, as glpk does) with zero
coefficients.
Btw, specifying huge upper bounds, which obviously cannot be active, for
example:
Bounds
curr_capacity(peak,2030) free
0 <= xc(gt_p,2010) <= 1e+50
0 <= xc(gt_p,2015) <= 1e+50
0 <= xc(gt_p,2020) <= 1e+50
. . .
is not a good idea. It would be much better to leave such variables
non-negative just by removing them from the bounds section.
> P.S. Where is the repository? All I see on the gnu.org page is the
> release tarballs. I would like to check out the HEAD from time to time.
Glpk has no repository, because its development is not based on a cvs
technology.