Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Cut of Benders Decomposition

    Posted Tue January 12, 2016 08:52 PM

    Originally posted by: Selectedbetter


    In the C++ code of Benders Decomposition, the cut is defined in the part of IloBool separate(...){...}.

    And in our question, the variable of the Master question is x[k][i][j]. 

    When we define the left hand of  the cut, we need to sum a part of j for a typical couple of k and i .

    We tried like this:

    IloExpr expr(env);
     for(j=1;j<=N;++j)
     {
         expr+=x[k][i][j];
     }

    cutLhs += val[h] * (5-M*(1-expr)); 
    expr.end();

    But we got an error says"IloExpr& IloNumExpr::operator+=const IloIntVar arg: mixing mismatch Environments" .

    Could anyone tell us how to correct or use other way  to define the sum?

    Thank you so much !

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cut of Benders Decomposition

    Posted Wed January 13, 2016 03:49 AM

    What is the exact expression that throws the exception?

    Does it help to initialize expr as

    IloExpr expr(cutLhs.getEnv())

    instead?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cut of Benders Decomposition

    Posted Thu January 14, 2016 02:45 AM

    Originally posted by: Selectedbetter


    Dear DanielJunglas

    Thank you for answering our question!

    We have taken your advice, and the code can run with no error.

    But, what happened next is that we found the result was only constrainted by the Master problem, and the constraints of sub-problem didn't work.

    Now, we don't know how to do with the code, because we can't find where might have mistake.

    Could you give us another advice?

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cut of Benders Decomposition

    Posted Wed January 27, 2016 07:53 AM

    I have no advice since the description of your problem is way to vague. What do you mean by "the constraints of the sub-problem didn't work"? Did you add constraints to the sub-problem and CPLEX produced a solution that violated these constraints?
     


    #CPLEXOptimizers
    #DecisionOptimization