Lazy constraints

Problems with modeling
Post Reply
abb.omidi
User
User
Posts: 39
Joined: 6 years ago

Lazy constraints

Post by abb.omidi »

Hello everybody,

Is there any way to use (or call) lazy constraint in GAMS modelling? If so, could you tell me how can I run it?

Thanks in advance
Omidi. A
Fred
Posts: 372
Joined: 7 years ago

Re: Lazy constraints

Post by Fred »

Hi,

a search for "lazy" in the GAMS documentation center seems to be a good idea: https://www.gams.com/latest/docs/search.html
Currently, lazy constraints are only available for GAMS/Gurobi.

Best,
Fred
abb.omidi
User
User
Posts: 39
Joined: 6 years ago

Re: Lazy constraints

Post by abb.omidi »

Dear Fred,

Thanks for your replay.
As per your comment, I try it and it works fine for cube problem while I try to run it on the "ROTDK" in the GAMS lib, it seems that it does not work properly. (it's solved optimally but did not apply any lazy constraint).
AFAIK, to apply lazy in the GUROBI or CPLEX software, must define lazy (initially) into the model and solver use it when it's needed.
I have some questions about that:
1) does GAMS distinguish lazy automatically? If no, how can I define lazy constraints in the model?
2) What does lazy define in the cube model (cube.gms)?
3) What does "$call grep "Extracted .* lazy constraints" cube.log > %system.nullfile%" mean?
4) Is it possible to apply lazy on the "ROTDK" or it's needed a specific way?

I was wondering if, you could advise me.

Regards
Omidi. A
Fred
Posts: 372
Joined: 7 years ago

Re: Lazy constraints

Post by Fred »

abb.omidi wrote: 5 years ago 1) does GAMS distinguish lazy automatically? If no, how can I define lazy constraints in the model?
https://www.gams.com/latest/docs/S_GURO ... OBIDOTlazy
abb.omidi wrote: 5 years ago 2) What does lazy define in the cube model (cube.gms)?
I guess you arerefrreing to this example https://www.gams.com/latest/testlib_ml/ ... azy01.html, which is just a wrapper around the cube model (https://www.gams.com/latest/gamslib_ml/ ... earch=cube) to solve it with lazy constraints.
Lazy constraints are defined via the gurobi option file which is activated by the subsequent call with optfile=1

Code: Select all

...
$onecho > gurobi.opt
lazyconstraints yes
ldef.lazy 3
$offecho

$call gams cube lo=2 mip=gurobi optfile=1
...
abb.omidi wrote: 5 years ago 3) What does "$call grep "Extracted .* lazy constraints" cube.log > %system.nullfile%" mean?
The model is from the test library and this test makes sure that lazy constraints were used by searching for corresponding messages in the log with grep (https://en.wikipedia.org/wiki/Grep)
abb.omidi wrote: 5 years ago 4) Is it possible to apply lazy on the "ROTDK" or it's needed a specific way?
To use lazy constraints you need to define and activate them as described in the documentation
abb.omidi
User
User
Posts: 39
Joined: 6 years ago

Re: Lazy constraints

Post by abb.omidi »

Dear Fred,

Thanks so much for your help.
I can do it and it works fine.

Regards
Omidi. A
Post Reply