Decision Optimization

 View Only
  • 1.  Modifying Progress report/log output for cplex.

    Posted Thu January 28, 2021 05:09 PM
    Hello everyone,

    I am new to cplex, I am working on decision optimization problem. I want to output several metrics whenever there is an improvement in cost function or gap.

    For example, Whenever cost function value decreases or there is an improvement in optimality gap,
    I want to record (Elapsed Time, Objective function Value, Optimality Gap)

    I found "MIP node log display information" parameter but this gives me log output whenever there is an improvement in the objective function value, what I am looking for is both improvements in objective function value as well as optimality gap. And I want to record that state for further analysis.

    Is there a way to do it in cplex?

    Thanks in advance

    ------------------------------
    Nitin Ramchandani
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Modifying Progress report/log output for cplex.

    IBM Champion
    Posted Fri January 29, 2021 03:48 PM
    I'm not positive this will work (the docs are rather vague on what constitutes "global progress"), but one possibility is to attach a generic callback to the "global progress" context. Inside the callback, query the current objective value and gap, check the elapsed time and generate a record.

    Paul

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 3.  RE: Modifying Progress report/log output for cplex.

    Posted Fri January 29, 2021 03:59 PM

    Hi Paul,

    You are right I took a similar approach looking into sample code which I found here.
    https://github.com/cswaroop/cplex-samples/blob/master/mipex4.py

    I modified LoggingCallback implementation as per the output I desired. I hope this helps someone else too.

    Thanks



    ------------------------------
    Nitin Ramchandani
    ------------------------------