Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Performance issue constructing IloLPMatrix object in Java

    Posted 02/23/16 02:39 PM

    Originally posted by: Perth2


    I am using CPLEX to construct an IloLPMatrix object in Java in a column generation setting. Firstly, I am initializing all rows one by one. Each row is created by first creating an IloLinearNumExpr with the cplex.linearNumExpr() call, then creating a range based on this IloLinearNumExpr with a call to e. g. cplex.addEq(iloNumExpr, value, name). The resulting range is then added to my IloLpMatrix object by a call to lpMatrix.addRow(range). I have about 70.000 of rows, and depending on the hardware, the initial construction takes up to several minutes. This seems to me to be a very long time. Running a performance profiler, I can see that ilog.cplex.Cplex.CPXGetRows[native] is where much of the time is spent. Is there an explanation to this? Is there a way to construct/populate the IloLPMatrix object that circumvents the (as it looks) repeated calls to CPXGetRows? Or is it something else that is causing the calls to CPXGetRows?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Performance issue constructing IloLPMatrix object in Java

    Posted 02/24/16 03:33 AM

    First of all, are you sure you should call cplex.addEq() to create the range? This creates and adds the range to the invoking IloCplex instance. If you only need the range to store things in an IloLPMatrix instance then just cplex.eq() should be enough.

    Have you tried collecting all rows into an array and then adding them all at once via IloLPMatrix.addRows()?

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Performance issue constructing IloLPMatrix object in Java

    Posted 02/24/16 08:59 AM

    Originally posted by: Perth2


    Thanks, Daniel. Yes, I should of course only add them once. And yes, it runs in 3 seconds now I changed the code to adding all rows in one go and updating the IloLPMatrix with setNZs also all in one go.


    #CPLEXOptimizers
    #DecisionOptimization