Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

a quick way to reduce computational time?

  • 1.  a quick way to reduce computational time?

    Posted 03/12/09 11:34 PM

    Originally posted by: SystemAdmin


    [ekimg said:]

    Hello everyone,

    I have a mip model and a solution array. According to the values in the solution array, I fix some of the variables in the mip and the mip becomes a lp. Then I solve it. In fixing the variables I need to change some of the constraints in the lp. I need to remove the old ones and add the modified ones. I do it simply by (model.remove) and (model.add) with cplex 11 under c++. But I need something faster in order to decrease the computational time. Is there a quicker way to do this?
    Since I am a beginner, any idea or help will be appreciated.

    Thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: a quick way to reduce computational time?

    Posted 03/30/09 11:22 PM

    Originally posted by: SystemAdmin


    [EdKlotz said:]

    Hello everyone,

    I have a mip model and a solution array. According to the values in the solution array, I fix some of the variables in the mip and the mip becomes a lp. Then I solve it. In fixing the variables I need to change some of the constraints in the lp. I need to remove the old ones and add the modified ones. I do it simply by (model.remove) and (model.add) with cplex 11 under c++. But I need something faster in order to decrease the computational time. Is there a quicker way to do this?
    Since I am a beginner, any idea or help will be appreciated.

    Thanks a lot.

    First of all, make sure that the run time associated with the model.remove and model.add calls
    really takes up a significant amount of your total run time.  If your MIP model requires a significant
    amount of time to solve, I would not expect the constraint addition and removal to be very
    significant.

    However, if this does impose significant overhead, and you don't need the optimization results to
    derive the constraints, you could instead put all constraints into the model at the beginning, but
    add an explicit slack variable for each constraint.  Then, to add or remove the constraints, you
    just adjust the bounds on the slack variable.    So, for example, if you have

    ax <= b<br />
    express it instead as

    ax + s <= b<br />
    -infinity <= s <= +infinity<br />
    With these infinite bounds, the constraint doesn't affect the model even though it is present.
    If you want to add this constraint, change the lower and upper bounds on s to 0.  For constraints
    you wish to remove, change the bounds from [0,0] to [-infinity, +infinity].  Changing bounds takes
    less time than adding and removing constraints.
    #CPLEXOptimizers
    #DecisionOptimization