Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  is there possibility to remove column from cplex object?

    Posted 07/31/10 06:24 AM

    Originally posted by: SystemAdmin


    Hi everybody,

    I could not find out whether we can somehow manipulate the model which is already extracted to a cplex object.
    Assume you are given a set of models which you want to solve with given parameters in an iterative procedure.
    One knows which variables are zero and not required in such huge model and which are not BUT this changes iteration to iteration.
    How can one efficiently preprocess the model while NOT putting additional burden of returning the removed columns to model later on at the next iterations.

    any comment is appreciated.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: is there possibility to remove column from cplex object?

    Posted 07/31/10 10:45 AM

    Originally posted by: SystemAdmin


    > Shahin G wrote:

    > Assume you are given a set of models which you want to solve with given parameters in an iterative procedure.
    > One knows which variables are zero and not required in such huge model and which are not BUT this changes iteration to iteration.
    > How can one efficiently preprocess the model while NOT putting additional burden of returning the removed columns to model later on at the next iterations.

    C++ API? You can set the bounds of the corresponding variables to zero with the IloNumVar::setBounds method (or the same method for integer/boolean variables). The model will communicate that to the extracted CPLEX object.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: is there possibility to remove column from cplex object?

    Posted 07/31/10 11:15 AM

    Originally posted by: SystemAdmin


    Hi Paul,

    Paul, isnt it like the memory is still occupied inside the cplex object? Does it physically remove the column and perhaps some of the constraints which are also voided because of deletion of columns?
    To me it seems that setting bound does not help reducing the size.

    That is what I see from the system log that the amount of occupied memory is still large and NOT chaned also the number of fixed variables is very high almost 90% (900 of 1000).

    On the other hand if cplex physically removes it how then can answer enquiries regarding that column or range?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: is there possibility to remove column from cplex object?

    Posted 07/31/10 11:46 AM

    Originally posted by: SystemAdmin


    Hi Shahin,

    If you use the setBounds trick, the instance of IloCplex still contains the column (so yes, that memory is still occupied), but the presolver will effectively eliminate the column, so it should not affect computation time significantly. If you want to eliminate the column from the IloCplex instance (which means you are going to have to re-extract the model each iteration, at least partially), I think your best bet is to build the model by columns (see "Modeling by columns" in the "Concert Technology tutorial for C++ users") and store either each IloNumColumn instance or each IloNumVar instance somewhere. From here I can see two possibilities. One is to invoke IloModel.remove(x) to temporarily eliminate IloNumVar x from the model (which will be communicated to the IloCplex instance) and IloModel.add(x) to restore the variable. I'm not sure if the stored variable retains the column information; if not, then you would store the IloNumColumn (call it col) and use IloModel.add(new IloNumVar(col). I don't use column-wise modeling (nor C++, for that matter), so I'm speculating here. I have used the zero-bounds trick in the past.

    /Paul
    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: is there possibility to remove column from cplex object?

    Posted 07/31/10 02:01 PM

    Originally posted by: SystemAdmin


    Paul, many thanks for your comment.
    #DecisionOptimization
    #MathematicalProgramming-General