Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX Matlab class library: Using same cplex object for multiple problems

    Posted 10/24/12 07:47 AM

    Originally posted by: MSaqib


    Hi everyone
    I am using the CPLEX Class API in Matlab. I am creating a Cplex object using:

    Code
    cplex = Cplex();
    Code

    Then, inside a loop, I read models from .lp files. In each iteration of the loop, I solve a different problem. The pseudo-code is as follows:

    Code
    for i = 1 : n
    cplex.readModel(xyz);
    cplex.solve();
    end
    Code

    Is this a correct workflow? It wouldn't cause any resource leaks or anything, right? I am concerned about slow-downs as the code progresses. It could very well be due to variables in my Matlab script growing over time and causing a slow down. But I'm fine with that as long as the way I am using cplex object is correct. These are integer optimization problems, so I do expect that some problems might take longer than others.

    Thanks and best regards
    Saqib
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX Matlab class library: Using same cplex object for multiple problems

    Posted 10/24/12 07:51 AM

    Originally posted by: MSaqib


    Sorry about misspelled hypertext. I was using Chrome and the preview tab doesn't work with it. Now, reposting using Internet Explorer to make sure everything is readable as expected.

    Hi everyone
    I am using the CPLEX Class API in Matlab. I am creating a Cplex object using:

    cplex = Cplex();
    


    Then, inside a loop, I read models from .lp files. In each iteration of the loop, I solve a different problem. The pseudo-code is as follows:

    for i = 1 : n
      cplex.readModel(xyz);
      cplex.solve();
    end
    


    Is this a correct workflow? It wouldn't cause any resource leaks or anything, right? I am concerned about slow-downs as the code progresses. It could very well be due to variables in my Matlab script growing over time and causing a slow down. But I'm fine with that as long as the way I am using cplex object is correct. These are integer optimization problems, so I do expect that some problems might take longer than others.

    Thanks and best regards
    Saqib
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX Matlab class library: Using same cplex object for multiple problems

    Posted 10/30/12 03:33 AM

    Originally posted by: SystemAdmin


    The way you use the CPLEX object is correct.
    Unfortunately, there are some known memory leaks in the CPLEX matlab code. So if you observe growing memory over time then this may be due to these leaks.
    #CPLEXOptimizers
    #DecisionOptimization