I'm implementing a model that uses a small 10-50MB data file. However,
because of the model, AMPL uses up much more than 10-50MB when reading
in the data. Is there a way to overcome this?
I'm trying to use the .lazy directive to throw out numerous
constraints when processing the data, but I am struggling with the
syntax necessary to specify it in my model file. The constraint I'm
trying to make lazy is:
subject to allow_two_and_three_cycles {(i,j,k) in TRIPLES}:
e[i,j]+e[j,k] <= 1+e[k,i];
How do I make it lazy within this declaration? I understand how to
make it lazy elsewhere (once parameters have been set I can write:
suffix lazy IN; let {(i,j,k) in TRIPLES}
allow_two_and_three_cycles[i,j,k].lazy := 1;), but I need to be able
to do it before I feed AMPL any data...
Specifying some constraints to be lazy constraints will not reduce the amount of memory needed in AMPL. All of the lazy constraints still need to be generated and sent to CPLEX. If there are any memory savings, they will occur in CPLEX when it is able to work with smaller linear equation systems.
Is there something about your particular problem that suggests you can "throw out numerous constraints when processing the data"? Possibly this will lead to some other approach to reducing AMPL's memory requirements. Also try looking at question 3.6 at www.ampl.com/FAQ for some suggestions for diagnosing memory needs.
> -----Original Message----- > From: ampl@googlegroups.com [mailto:ampl@googlegroups.com] On Behalf Of > rgarcia > Sent: Sunday, April 20, 2008 6:29 PM > To: AMPL Modeling Language > Subject: [AMPL 1751] Memory issues and the .lazy directive
> Hi,
> I'm implementing a model that uses a small 10-50MB data file. However, > because of the model, AMPL uses up much more than 10-50MB when reading > in the data. Is there a way to overcome this?
> I'm trying to use the .lazy directive to throw out numerous > constraints when processing the data, but I am struggling with the > syntax necessary to specify it in my model file. The constraint I'm > trying to make lazy is:
> subject to allow_two_and_three_cycles {(i,j,k) in TRIPLES}: > e[i,j]+e[j,k] <= 1+e[k,i];
> How do I make it lazy within this declaration? I understand how to > make it lazy elsewhere (once parameters have been set I can write: > suffix lazy IN; let {(i,j,k) in TRIPLES} > allow_two_and_three_cycles[i,j,k].lazy := 1;), but I need to be able > to do it before I feed AMPL any data...
The constraints are necessary for feasible solutions, but the majority
of them will not be tight for a given solution. This is why I was
attracted to lazy constraints, since this is what they are made to
take care of.
What I guess I need then is a method to customize the branching
process so that it draws cuts from the set of constraints that is too
numerous to load initially. Is there an easy way to do this (that
avoids loading all of the constraints initially)?
Thanks for the help,
Rafael
On Apr 21, 10:07 am, "Robert Fourer" <4...@ampl.com> wrote:
> Specifying some constraints to be lazy constraints will not reduce the
> amount of memory needed in AMPL. All of the lazy constraints still need to
> be generated and sent to CPLEX. If there are any memory savings, they will
> occur in CPLEX when it is able to work with smaller linear equation systems.
> Is there something about your particular problem that suggests you can
> "throw out numerous constraints when processing the data"? Possibly this
> will lead to some other approach to reducing AMPL's memory requirements.
> Also try looking at question 3.6 atwww.ampl.com/FAQfor some suggestions
> for diagnosing memory needs.
> > -----Original Message-----
> > From: ampl@googlegroups.com [mailto:ampl@googlegroups.com] On Behalf Of
> > rgarcia
> > Sent: Sunday, April 20, 2008 6:29 PM
> > To: AMPL Modeling Language
> > Subject: [AMPL 1751] Memory issues and the .lazy directive
> > Hi,
> > I'm implementing a model that uses a small 10-50MB data file. However,
> > because of the model, AMPL uses up much more than 10-50MB when reading
> > in the data. Is there a way to overcome this?
> > I'm trying to use the .lazy directive to throw out numerous
> > constraints when processing the data, but I am struggling with the
> > syntax necessary to specify it in my model file. The constraint I'm
> > trying to make lazy is:
> > subject to allow_two_and_three_cycles {(i,j,k) in TRIPLES}:
> > e[i,j]+e[j,k] <= 1+e[k,i];
> > How do I make it lazy within this declaration? I understand how to
> > make it lazy elsewhere (once parameters have been set I can write:
> > suffix lazy IN; let {(i,j,k) in TRIPLES}
> > allow_two_and_three_cycles[i,j,k].lazy := 1;), but I need to be able
> > to do it before I feed AMPL any data...