Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  docplex- lazy constraints

    Posted Thu February 14, 2019 03:06 PM

    Originally posted by: open_ball


    Hi,

    I was wondering if the lazy constraint concept used in Benders decomposition is applicable in docplex. As stated here at https://developer.ibm.com/answers/storage/temp/23648-lazy-callback.txt, I can see that lazy constraints are callable in docplex through cplex. 

    However, as stated here at https://developer.ibm.com/answers/questions/463340/difference-between-docplex-and-cplex-python-api/ and https://www.ibm.com/developerworks/community/forums/html/topic?id=ccb5e8bd-4ea7-43d9-9e1e-99a7973f638b&ps=25, docplex have some drawbacks and /or restrictions.

     I was using OPL for modelling. Yet, it turned out that we have so many restrictions in OPL. So I decided to switch to Python. Now, I realize that docplex has some issues too. From a research perspective, is docplex a good option? Can the restrictions be handled through some coding manipulations or should I consider to build up my models in languages like C++ or Java?

    Thanks,


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: docplex- lazy constraints

    Posted Fri February 15, 2019 11:17 AM

    You can definitely have a lazy constraint callback in docplex. Benders decompostiion usually uses exactly this callback to generate the Benders cuts.

    Correct, docplex has some limitations. Whether they are a problem for you depends on what you actually plan to do. On the other hand, modeling with docplex is a little easier since it is object oriented rather than matrix oriented.

    Note that there also is a CPLEX Python API and docplex builds on this API. The CPLEX Python API is a lightweight wrapper around the C callalable library, which in turn is the most low-level interface to CPLEX. So with the CPLEX Python API you can do almost anything that is possible with the callable library, thus almost anything that is possible with CPLEX. So if you don't mind stating your model using a matrix-based API (where variables and constraints are indices rather than objects) then using this Python API gives you the biggest flexibility. If you prefer object oriented modeling (which is more similar to OPL) then docplex is for you.

    You may want to look at https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/Python/topics/cplex_python_overview.html to learn more about the differences between docplex and the CPLEX Python API.


    #CPLEXOptimizers
    #DecisionOptimization