Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Implement Branch-and-Price in CPLEX Python API

  • 1.  Implement Branch-and-Price in CPLEX Python API

    Posted Wed March 11, 2020 02:03 AM

    Originally posted by: JungS


    Hi,

    I am using CPLEX with Python interface and trying to implement branch-and-price method.

    From the previous threads, I have learned that cutstock example gives a good reference to implement B&P but I couldn't find the example written in Python API. (cutstock.py is written in docplex)

    Also, most threads related to column generation or B&P were using Java or C++. 

    I understand Java and C++ are the most popular interface for OPL, but since I am Python user I have used Python API so far.

    Here are some simple questions:

       1) Are there any good reference or framework for branch and price implement in CPLEX Python API? 

           (I've found that SCIP framework is recommended to customize B&B and provides Python interface, but it gives very limited set of examples for Python interface)

       2) Should I switch to use Java API to write customized branch and bound algorithm, such as B&P? (Does Java API provide more classes or interfaces than Python API does ? )

     

    Thank you! 

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Implement Branch-and-Price in CPLEX Python API

    Posted Fri March 13, 2020 07:47 AM

    First of all, the cutstock example only gives a limited version of Branch&Price: you generate some columns, at some point you settle for this set of columns and then you solve the MIP with this fixed set of columns.

    From what you write, it seems you want to do "real" Branch&Price. In particular, you want to create new variables at nodes in the tree. This is not possible with CPLEX. Once the solve started, you cannot add new columns to the model. This does not depend on the API but is a limitation of the engine. So if you want to do that then you indeed better switch over to SCIP or similar.

    The reason the cutstock example only exists in Java and C++ is that it uses the special "columnwise modeling API" and is meant as an example to illustrate the usage of this. In the CPLEX Python API you don't have special API for this, though. You just create columns by calling cplex.variables.add(). Do you still want to see the cutstock example in Python? Please let me know if yes, we can problably create something for you.


    #CPLEXOptimizers
    #DecisionOptimization