Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Accessing to Cuts added by CPLEX

    Posted Mon March 14, 2022 11:52 AM
    Dear all,
    Is there any way that I print out, or have access to all cuts generated and added by CPLEX to the model during the cutting plane algorithm? I just want to analyze those cuts. If you have this experience I appreciate it if you share how it can be done, regardless of the programming language that you used.

    ------------------------------
    Babak Akbarzadeh
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Accessing to Cuts added by CPLEX

    Posted Mon March 14, 2022 01:00 PM
    I'm afraid the answer is no: there is no API to gain access to the cuts, whether when they are generated or when they are actually added to the model.

    ------------------------------
    Xavier
    ------------------------------



  • 3.  RE: Accessing to Cuts added by CPLEX

    Posted Mon March 14, 2022 04:02 PM
    Dear Xavier,
    Thank you, I thought so.

    ------------------------------
    Babak Akbarzadeh
    ------------------------------



  • 4.  RE: Accessing to Cuts added by CPLEX

    Posted Wed March 16, 2022 12:07 PM
    Hi Xavier,

    I am actually surprised at this answer to the OP.

    Surely, one can within a user cut callback have have CPLEX print the lp file via CPXgetcallbacknodelp to print the LP file at the current node, yes? I am still in CPLEX 12.10. Is this no longer possible in the latest CPLEX version? I sure hope not!

    Babak, can you look at https://www.ibm.com/docs/en/icos/20.1.0?topic=g-cpxxgetcallbacknodelp-cpxgetcallbacknodelp and try to see if that would work? I use this routinely in CPLEX 12.10 to examine cuts I add and what CPLEX adds. The CPLEX added cuts will have some mnemonics such as r1, m1, etc. that the user cannot control.

    Thanks.

    ------------------------------
    CPLEX User
    ------------------------------



  • 5.  RE: Accessing to Cuts added by CPLEX

    Posted Thu March 17, 2022 04:37 AM
    Hi,
    Thank you for sharing. Indeed my colleague has also the same experience using Callbacks to retrieve cuts, as you say. I've been working on this, I will post my findings here, for others if they are interested.

    ------------------------------
    Babak Akbarzadeh
    ------------------------------



  • 6.  RE: Accessing to Cuts added by CPLEX

    Posted Thu March 17, 2022 10:39 AM
    There is not change in the callbacks in 20.1 or the coming 22.1, but it's true that there is no built-in method to query the cuts and use them programmatically. It's true that with your method you can obtain them, but it is very hard to use them in an application.

    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 7.  RE: Accessing to Cuts added by CPLEX
    Best Answer

    Posted Thu March 17, 2022 11:17 AM
    Yes. Indeed my usage of CPXgetcallbacknodelp is only to examine the cuts offline.

    Programmatic manipulation is not possible as you and Xavier have suggested. It is just that the OP wanted to examine / analyze the CPLEX cuts offline in a non-production environment and I felt that he may benefit from the user cut callback.

    Regards

    ------------------------------
    CPLEX User
    ------------------------------