Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to remove elements from IloNumVarArray

    Posted 04/16/09 06:48 AM

    Originally posted by: SystemAdmin


    [smest001 said:]

    I am implementing Branch and Price algorithm using Concert Lib. During the branching process, I have to remove columns (variables) from the master problem. I am declaring those variables using IloNumVarArray. When i want to add new variables to the master problem I create
    IloNumColumn and add it using [i]variableName[/i].add(IloNumVar(env,lb,ub,ILOFLOAT)).
    Can someone tell me how to remove a set of variables from the model?

    Thank you
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to remove elements from IloNumVarArray

    Posted 04/16/09 08:18 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    AFAIK this can't be done directly.  I don't think CPLEX will let you modify the coefficient matrix in mid-solution.  What you can do is add cuts at a node (either global or local, whichever you need) forcing the variables you want to eliminate to be zero.  That won't reduce the size of the matrix (in fact, it will increase it a bit), but it will achieve the goal of eliminating those variables from the solution.

    /Paul

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to remove elements from IloNumVarArray

    Posted 04/16/09 09:33 PM

    Originally posted by: SystemAdmin


    [smest001 said:]

    Paul, Thank you for your response.
    Forgive my ignorance,
    but what I dont understand is Since I am implementing my own branch and price tree in C++, only after I get an optimal solution for my restricted master problem at a particular node, I want to remove some variables, since I will pruning the corresponding subtree.
    So what i understand is that I am not changing the coeff matrix in mid-solution.

    I want to remove those variables because, i want to control the size of the restricted master problem.
    Your guidance is highly appreciated.
    Thank you!
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How to remove elements from IloNumVarArray

    Posted 04/20/09 08:47 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    I seem to have misunderstood.  You're saying that you use a separate call to CPLEX's solve() method at each node of a tree that you (not CPLEX) build?  In that case, it's a question of how you are handling your node models and whether you want to permanently delete a column from every model it's in or not.

    The easiest answer is to invoke the end() method on the variable you want to delete.  If it's a member of an IloNumVarArray, don't invoke end() on the array, but rather invoke it on the array entry (e.g., myVarArray[5].end()).  That will irreversibly eliminate the variable from any and all models containing it.

    If you have a single variable instance that belongs to more than one model, and you want to delete it from one model but not from others, use the IloModel::remove() method.  You invoke that method on the model and feed it the variable as an argument.

    /Paul

    #CPLEXOptimizers
    #DecisionOptimization