[Help-glpk] Fixed values in Variable statement

2008-07-02 Thread Luiz M. M. Bettoni

Hi all,

I'm trying to specify fixed values to some variables in an array using = 
expression (see 4.3 Variable statement in GMPL Reference). Something 
like this:

   set MySet;
   set MySubset within MySet;
   var X {i in MySet} = if i in MySubset then 0 else binary;

or, similarly:
   var X {i in MySet diff MySubset}, binary;
   var X {i in MySubset} = 0;

How can i do this in GMPL?

Thanks,
Bettoni


___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] Fixed values in Variable statement

2008-07-02 Thread Andrew Makhorin
 I'm trying to specify fixed values to some variables in an array using =
 expression (see 4.3 Variable statement in GMPL Reference). Something
 like this:
 set MySet;
 set MySubset within MySet;
 var X {i in MySet} = if i in MySubset then 0 else binary;

 or, similarly:
 var X {i in MySet diff MySubset}, binary;
 var X {i in MySubset} = 0;

 How can i do this in GMPL?

*All* elemental variables in the array of variables can be fixed as
follows:

var x{...} = numeric expression ;

However, to fix *some* elemental variables you should use correspodning
equality constraints, for example:

s.t. fpp{i in MySubset}: x[i] = 0;

This is normal, because such constraints will be removed by the mip
preprocessor.



___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] Solve then add rows then presolve: Can I maintain basis?

2008-07-02 Thread Andrew Makhorin
 If I keep the presolver on, the basis information from the previous
 solve is lost and the 2-phase primal algorithm kicks off from scratch
 (instead of the dual simplex using the previous basis).  If I turn the
 presolver off, I know my problem is bigger than it needs to be, but
 the dual simplex does kick in starting with the previously optimal
 basis.  So I guess my question is:  is there a way to use the
 presolver AND supply an initial basic solution?

No, the lp presolver does not use the current basis information,
so you should disable it on performing re-optimization.

   If not, is there a
 mathematical/algorithmic reason this isn't possible?

There is not much sense to do that, because re-optimization needs
much less iterations. Besides, in that case the lp presolver could not
remove redundant basic rows and redundant non-basic columns.

    If so, I'd be
 interested in hearing it because it will probably change my approach
 (and understanding) of my problem.  My understanding from the glpk
 code is that the presolver uses a copy of the original problem to
 perform all of it transformations and then the solution to the
 presolved problem is translated back to the original problem when the
 simplex completes.

Correct.

 This transformation must interfere with any basis
 that the original problem had, thus eliminating it I suppose?  Hope
 all of these questions make sense.

 I'll gladly supply more info if it's helpful.  Thanks in advance for
 any insights.





___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk