Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Unable to remove a constraint from a model

    Posted 07/27/12 04:04 AM

    Originally posted by: sjayaswal


    Hi,
    I am running a Cplex code (in C++ Concert Technology) wherein at each iteration I need to substitute one of the earlier added constraints by a newly generated one. The constraint is lhs = -1, where lhs is the left hand side expression of the constraint. This is how I am trying to do it:

    IloCplex cplex_IIS(model_IIS);
    ....
    ....
    IloRange r1(env, -1, lhs, -1, "r1");
    model_IIS.add(r1);
    lhs.end();
    cplex_IIS.solve();

    model_IIS.remove(r1);// to remove the constraint already added

    .....
    .....
    IloRange r1(env, -1, lhs1, -1, "r1");
    model_IIS.add(r1);
    lhs1.end();
    cplex_IIS.solve();


    However, although the above code successfully adds a new constraint,
    it fails to remove the old constraint.
    This is my first experience at removing a constraint from a model.
    Can someone tell me where am I going wrong?

    Thanks and Regards,
    Sachin
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Unable to remove a constraint from a model

    Posted 07/27/12 05:06 PM

    Originally posted by: SystemAdmin


    Duplicate of http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14869129&tstart=0#14869129.
    #CPLEXOptimizers
    #DecisionOptimization