how to stop gams when it has reached an optimal solution

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1


Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede

\

Fede,

You say you want GAMS to stop when it has found an optimal solution,
but how do you know it is optimal unless it has been proved? Or do
you mean you want to stop as soon as you are feasible?

There are several GAMS parameters to control when the solver stops,
including the cheat and cutoff options (check the User’s Guide for
details) but the most commonly used ones are the absolute gap optca
and especially the relative gap (optcr) tolerances. For example,
setting optcr=3 would have the solver stop when the best found is
within 300% of the best bound. If you choose optcr and/or optca large
enough, you’ll stop as soon as you get MIP feasible.

-Steve

On Sun, Feb 6, 2011 at 12:20 PM, fedperea wrote:

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1

Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.




– Steven Dirkse, Ph.D. GAMS Development Corp., Washington DC Voice: (202)342-0180 Fax: (202)342-0181 sdirkse@gams.com http://www.gams.com

Thanks Steven!

On Mon, Feb 7, 2011 at 4:41 PM, Steven Dirkse wrote:

Fede,

You say you want GAMS to stop when it has found an optimal solution,
but how do you know it is optimal unless it has been proved? Or do
you mean you want to stop as soon as you are feasible?

There are several GAMS parameters to control when the solver stops,
including the cheat and cutoff options (check the User’s Guide for
details) but the most commonly used ones are the absolute gap optca
and especially the relative gap (optcr) tolerances. For example,
setting optcr=3 would have the solver stop when the best found is
within 300% of the best bound. If you choose optcr and/or optca large
enough, you’ll stop as soon as you get MIP feasible.

-Steve

On Sun, Feb 6, 2011 at 12:20 PM, fedperea wrote:

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1

Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Sorry, I reformulate my question because I wrote it totally wrong. I meant that I want GAMS to stop when it has found a feasible solution with at least a certain (known) objective value. (Maximization problem).

Best,

Fede

On Mon, Feb 7, 2011 at 4:41 PM, Steven Dirkse wrote:

Fede,

You say you want GAMS to stop when it has found an optimal solution,
but how do you know it is optimal unless it has been proved? Or do
you mean you want to stop as soon as you are feasible?

There are several GAMS parameters to control when the solver stops,
including the cheat and cutoff options (check the User’s Guide for
details) but the most commonly used ones are the absolute gap optca
and especially the relative gap (optcr) tolerances. For example,
setting optcr=3 would have the solver stop when the best found is
within 300% of the best bound. If you choose optcr and/or optca large
enough, you’ll stop as soon as you get MIP feasible.

-Steve

On Sun, Feb 6, 2011 at 12:20 PM, fedperea wrote:

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1

Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Fede,

Let’s call the constant C. What should happen if the maximum is below
C? Should the solver reject all feasible solutions with obj .cutoff = C and
.optcr = 9999 or some other large value. This will stop as
soon as it finds a feasible obj > C but it will reject all solutions
with obj >= C. It would be easy to implement internally but we’ve never been
asked for such an option.

-Steve

On Mon, Feb 7, 2011 at 10:51 AM, Federico Perea wrote:

Sorry, I reformulate my question because I wrote it totally wrong. I meant
that I want GAMS to stop when it has found a feasible solution with at least
a certain (known) objective value. (Maximization problem).

Best,

Fede

On Mon, Feb 7, 2011 at 4:41 PM, Steven Dirkse wrote:

Fede,

You say you want GAMS to stop when it has found an optimal solution,
but how do you know it is optimal unless it has been proved? Or do
you mean you want to stop as soon as you are feasible?

There are several GAMS parameters to control when the solver stops,
including the cheat and cutoff options (check the User’s Guide for
details) but the most commonly used ones are the absolute gap optca
and especially the relative gap (optcr) tolerances. For example,
setting optcr=3 would have the solver stop when the best found is
within 300% of the best bound. If you choose optcr and/or optca large
enough, you’ll stop as soon as you get MIP feasible.

-Steve

On Sun, Feb 6, 2011 at 12:20 PM, fedperea wrote:

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1

Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede


You received this message because you are subscribed to the Google
Groups “gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.




– Steven Dirkse, Ph.D. GAMS Development Corp., Washington DC Voice: (202)342-0180 Fax: (202)342-0181 sdirkse@gams.com http://www.gams.com

Thanks Steven,

asking your question, the maximum is known to be, at least, C. I will try what you suggest, it sounds good.

Regards,

Fede

On Tue, Feb 8, 2011 at 9:19 PM, Steven Dirkse wrote:

Fede,

Let’s call the constant C. What should happen if the maximum is below
C? Should the solver reject all feasible solutions with obj .cutoff = C and
.optcr = 9999 or some other large value. This will stop as
soon as it finds a feasible obj > C but it will reject all solutions
with obj = C. It would be easy to implement internally but we’ve never been
asked for such an option.

-Steve

On Mon, Feb 7, 2011 at 10:51 AM, Federico Perea wrote:

Sorry, I reformulate my question because I wrote it totally wrong. I meant
that I want GAMS to stop when it has found a feasible solution with at least
a certain (known) objective value. (Maximization problem).

Best,

Fede

On Mon, Feb 7, 2011 at 4:41 PM, Steven Dirkse wrote:

Fede,

You say you want GAMS to stop when it has found an optimal solution,
but how do you know it is optimal unless it has been proved? Or do
you mean you want to stop as soon as you are feasible?

There are several GAMS parameters to control when the solver stops,
including the cheat and cutoff options (check the User’s Guide for
details) but the most commonly used ones are the absolute gap optca
and especially the relative gap (optcr) tolerances. For example,
setting optcr=3 would have the solver stop when the best found is
within 300% of the best bound. If you choose optcr and/or optca large
enough, you’ll stop as soon as you get MIP feasible.

-Steve

On Sun, Feb 6, 2011 at 12:20 PM, fedperea wrote:

Hello!

I have an ILP problem, and I want GAMS to stop when it has found an
optimal solution (no need for optimality to be proved). What I did was
just to remove the objective function

zrtn =e= sum((p,q)$(g(p,q) ne 0),g(p,q)*p_rtn(p,q));

and substitute it by

zrtn =e= 1

Any ideas about the problem of this method and/or whether it can be
improved?

Thanks in advance!

Fede


You received this message because you are subscribed to the Google
Groups “gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.