Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Agreegate vs. disagreegate constraints - getting error

    Posted 09/24/11 08:16 PM

    Originally posted by: JDalal


    I have following constraint set in my model:

    x_ijt <= y_j for all i,j,t; i =1...m, j =1...n, t=1...T

    When I code in concert as below:

    for(int i = 0; i < num_cust; i++){
    for(int j = 0; j < num_locn; j++){
    for(int t = 0; t < num_pd; t++){
    ilo_model.add(x[i][j][t] <= y[j]);
    }
    }
    }

    there is no problem. But, if I want to aggregate them as below:

    //(aggregated): sum_i{x_i,j,t} <= m* y_j for all j,t

    for(int j = 0; j < n; j++){
    for(int t = 0; t < T; t++) {
    IloExpr lhs_expr1(env);
    for(int i = 0; i < m; i++)
    lhs_expr1 += x[i][j][t];

    ilo_model.add( lhs_expr1 <= m * y[j]);
    lhs_expr1.end();
    }
    }

    I am getting this : "ERROR: CPLEX Error 1217: No solution exists."

    Can anyone suggest what is wrong?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Agreegate vs. disagreegate constraints - getting error

    Posted 09/25/11 09:15 AM

    Originally posted by: SystemAdmin


    when you say
    x_ijt <= y_j for all i,j,t; i =1...m, j =1...n, t=1...T

    it means for a given j=j' all x_ij't can take 1 if y_j is one.

    but when you use:
    //(aggregated): sum_i{x_i,j,t} <= m* y_j for all j,t

    it means that for a given j= j', from among all the x_ij't s only one can take a if y_j is 1.

    they are not the same, why the second one proves infeasibility also depend on the impact of this new constraint in conjunction to the rest.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Agreegate vs. disagreegate constraints - getting error

    Posted 09/25/11 09:18 AM

    Originally posted by: SystemAdmin


    correction:
    //(aggregated): sum_i{x_i,j,t} <= m* y_j for all j,t

    it means that for given j= j', and t= t' from among all the x_ij't' only one variable can take 1, if y_j' is 1.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Agreegate vs. disagreegate constraints - getting error

    Posted 09/25/11 11:07 AM

    Originally posted by: JDalal


    "correction:

    //(aggregated): sum_i{x_i,j,t} <= m* y_j for all j,t

    it means that for given j= j', and t= t' from among all the x_ij't' only one variable can take 1, if y_j' is 1."

    ==============

    I think it would be at most m from among all the x_ij't' can take 1, if y_j' is 1, since RHS is m * y_j, not y_j.

    I am trying to illustrate a bit. Say, i=1,2,3; j=1,2; t=1,2;
    so my constraints in aggregated setting should be:

    for j=1,t=1: x_1,1,1 + x_2,1,1 + x_3,1,1 <= 3*y_1
    for j=1,t=2: x_1,1,2 + x_2,1,2 + x_3,1,2 <= 3*y_1
    for j=2,t=1: x_1,2,1 + x_2,2,1 + x_3,2,1 <= 3*y_2
    for j=2,t=2: x_1,2,2 + x_2,2,2 + x_3,2,2 <= 3*y_2

    But, is there anything wrong with my coding ?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Agreegate vs. disagreegate constraints - getting error

    Posted 09/25/11 05:56 PM

    Originally posted by: SystemAdmin


    sorry you are right. my mistake.:)

    I don't see mistake at this moment.
    if you can have an small example and fix the variable in the model.

    try to turn off presolve and see what constraint makes infeasible and try to fix it. this is one of the easiest to do.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Agreegate vs. disagreegate constraints - getting error

    Posted 09/25/11 05:56 PM

    Originally posted by: SystemAdmin


    sorry you are right. my mistake.:)

    I don't see mistake at this moment.
    if you can have an small example and fix the variable in the model.

    try to turn off presolve and see what constraint makes infeasible and try to fix it. this is one of the easiest to do.
    #CPLEXOptimizers
    #DecisionOptimization