IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2015-02-13T15:49:17Z by AlexFleischer
5 Posts

Pinned topic Lazy Constraints using OPL?

‏2014-05-22T16:14:06Z |


I want to know if with the new releases of Cplex, it is currently possible to implement lazy constraints using OPL Script ? As I looked around, someone already asked this question on the forum ( ) and get the answer it wasn't possible.

I tried to add lazy constraints using the method IloCplex::addLazyConstraint( IloConstraint con), but I get an assertion failed error 

Erreur interne : ASSERTION FAILED à l'emplacement E:\SF\s80\builds32\workspace\RB.opl_lang-wks.x86_windows_vs2010\opl_lang\include\ilopl/script/proxies.h:946.

but unfortunately, I couldn't figure out what that error is, I guess it deals with the way Windows handle procedures.

As we should add lazy constraint after we generate the model, we need to create them in the main script bloc, but the properties IloConstraint or even IloRange do not have any constructor available, so it's virtually impossible to create such elements outside the model, Am I wrong?

Does somebody have an example of JAVA/.NET/C++ opl interfaces examples using lazy constraints? I looked on the examples files but I couldn't find any?

I would appreciate any help.


  • davidoff
    55 Posts

    Re: Lazy Constraints using OPL?

    ‏2014-06-11T16:11:45Z  in response to MBEUTCHA

    Any answer for this question ? I'm interested to know using Scripting too.

    Using API's that should be possible though. Take any Java sample with OPL and adapt it to run your own model, then before solving , remove all the constraints from the model that you would like to manage as lazy constraints (this would be done through loops on the collection of named constraints), then re-add all these constraints as lazy