Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

A constraint definition isue in concert technology/c++ interface

  • 1.  A constraint definition isue in concert technology/c++ interface

    Posted Sat November 16, 2013 06:57 PM

    Originally posted by: Industrial88


    Dear all,

    I want to to formulate the following mathematical programming constraint using concert technology in C++ interface.
    sum(i in I)(j in J) x[i][j] >= 0.5 * sum(j in J)(k in K) y[j][k]
    where x[i][j] and y[j][k] are both non-negative continuous decision variables. This constraint means the summation over all "i" and "j" for decision variable "x" is at least greater or equal than half of the summation over all "j" and "k" for decision variable "y".
    I am using the following piece of code within my code. However, I'm a little bit skeptical whether it is well-defined or it's wrong!

        IloExpr vi(env), vii(env);
        for(i = 0; i < I; i++){
           for(j = 0; j < J; j++){
           vi += x[i][j];}
         }
        for(j = 0; j < J; j++){
           for(k = 0; k < K; k++){
           vii += y[j][k];}
         }        
        mipmodel.add(vi >= 0.5*vii);
        vi.end();
        vii.end();
     
    "env" and "mipmodel" are the names of my environment and my model, respectively.
    Any comment would be highly appreciated.

     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: A constraint definition isue in concert technology/c++ interface

    Posted Mon November 18, 2013 06:27 AM

    To me that looks exactly like the thing you want to do. Do you experience unexpected behavior or why do you have doubts about this?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: A constraint definition isue in concert technology/c++ interface

    Posted Mon November 18, 2013 04:04 PM

    Originally posted by: Industrial88


    Thanks for your comment.

    Actually, I've never had any kind of errors or things like that. I've no longer any doubt about it.


    #DecisionOptimization
    #MathematicalProgramming-General