Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Retrieving solve time from Cplex [python]

    Posted Mon February 27, 2012 02:09 PM

    Originally posted by: r_i_l_e_y


    Looking at some log files my supervisor and I were surprised to see presolve times which were larger than the total times For example:

    MIP Presolve eliminated 2100 rows and 0 columns.
    MIP Presolve modified 16830430 coefficients.
    Reduced MIP has 106621 rows, 151865 columns, and 139165120 nonzeros.
    Reduced MIP has 151865 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 1652.94 sec.

    Root node processing (before b&c):
    Real time = 445.24
    Sequential b&c:
    Real time = 0.00

    Total (root+branch&cut) = 445.24 sec.

    We had assumed that the total included the presolve time. What I'd really like to do is directly query Cplex for the total solve time (in the same way I might ask for the number of cuts, or the incumbent node). I cannot find anything in the documentation to support this, but surely this functionality exists?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Retrieving solve time from Cplex [python]

    Posted Tue February 28, 2012 02:29 AM

    Originally posted by: SystemAdmin


    I'm afraid, CPLEX does not provide any timing functions for Python.
    But they are not required anyway. You can use Python's "time" module which is described here. Just get a time stamp right before and after you call the solve() method. The low-level CPLEX API has functions to do exactly that but since Python has the 'time' module there is no need to expose them in Python.
    Maybe also look at the discussion here to double check what you want to do.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Retrieving solve time from Cplex [python]

    Posted Sat March 10, 2012 12:04 AM

    Originally posted by: r_i_l_e_y


    Cheers!
    #CPLEXOptimizers
    #DecisionOptimization