Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Solution error

    Posted 04/09/14 01:53 AM

    Originally posted by: vjkgp


    Hi,

    please go through the below program, when i run it, i am getting all my decision variables value zero,

    these following error are coming,

    // MILP solution error (Ax=b) (Total, Max)       0.00000e+000 0.00000e+000
    // MILP x bound error (Total, Max)               0.00000e+000 0.00000e+000
    // MILP x integrality error (Total, Max)         0.00000e+000 0.00000e+000
    // MILP slack bound error (Total, Max)           0.00000e+000 0.00000e+000
    //

    help me how to remove these errors,

    Model:-

    {int} box={1,2,3,4,5,6,7};
    {int} truck={1,2,3,4,5,6};
    int length[box]=[103, 103, 103, 103, 103, 103,103];
    int width[box]=[91,91,91,91,91, 91, 91];
    int height[box]=[116,116,116,116,116, 116, 116];
    int weight[box]=[558,558,558,558,558, 558, 558];
    float len[truck]= [426.72, 426.72, 487.68, 548.64, 731.52,1219.2];
    float wid[truck]=[182.88,182.88,213.36, 213.36, 213.36,243.84];
    float het[truck]=[182.88,182.88,213.36, 213.36, 213.36,243.84];
    int wet[truck]=[3000, 3500, 7000, 9000, 15000,20000];
     int M=10000;
    dvar boolean L[box];
    dvar float+ X[box];
    dvar float+ Y[box];
    dvar float+ Z[box];
    dvar boolean A[box,box];  
    dvar boolean B[box,box];
    dvar boolean C[box,box];
    dvar boolean D[box,box];
    dvar boolean n[truck];
    dvar boolean S[box,truck];


    minimize
      sum(j in truck)wet[j]*n[j]-sum(i in box)weight[i];
     
    subject to {
          forall(i in box, k in box : i<k)
            ct1:
              (X[i] + length[i]*L[i] + width[i]*(1-L[i])) <= (X[k] + (1-A[i,k])*M);
        forall( i in box,k in box: i<k)
            ct2:
              (X[k] + length[k]*L[k] + width[k]*(1-L[k])) <= (X[i] + (1-B[i,k])*M);        
        forall( i in box,k in box: i<k)
            ct3:
              (Y[i] + width[i]*L[i] + length[i]*(1-L[i])) <= (Y[k] + (1-C[i,k])*M);    
        forall( i in box,k in box: i<k)
            ct4:
              (Y[k] + width[k]*L[k] + length[k]*(1-L[k])) <= (Y[i] + (1-D[i,k])*M);
        forall( i in box,k in box: i<k)
            ct5:
              (Z[i] + height[i]) <= (Z[k] + M);
        forall( i in box,k in box: i<k)
            ct6:
              (Z[k] + height[k]) <= (Z[i] + M);        
        forall(i in box,k in box,j in truck : i<k)
          ct7:
            (A[i,k] + B[i,k] + C[i,k] + D[i,k])>=(S[i,j] - S[k,j] - 1);
          ct8:
            sum(j in truck) n[j]==1;
        forall(i in box)
          ct9:
            sum(j in truck) S[i,j]==1;
        forall(j in truck)
          ct10:
            sum(i in box)S[i,j]<=M*n[j];
        forall( i in box,j in truck)
            ct11:
              X[i] + length[i]*L[i] + width[i]*(1-L[i])<=len[j]*n[j] + (1-S[i,j])*M;
        forall( i in box,j in truck)      
            ct12:
              Y[i] + width[i]*L[i] + length[i]*(1-L[i])<=wid[j]*n[j] + (1-S[i,j])*M;
        forall( i in box,j in truck)        
            ct13:
              Z[i] + height[i]<=het[j]*n[j] + (1-S[i,j])*M;
        forall(i in box, j in truck)
           ct14:
            sum(i in box) weight[i]<=(wet[j]*n[j] + (1-S[i,j])*M);
    }    

     

     

    Thanks,

    Vijendra


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Solution error

    Posted 04/09/14 04:39 AM

    Hi,

    your model is fine and gives


    n = [0
             0 1 0 0 0];
    X = [0 0 0 0 0 0 0];
    L = [0 0 0 0 0 0 0];
    A = [[0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]];
    B = [[0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]];
    Y = [0 0 0 0 0 0 0];
    C = [[0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]];
    D = [[0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]
                 [0 0 0 0 0 0 0]];
    Z = [0 0 0 0 0 0 0];
    S = [[0 0 1 0 0 0]
                 [0 0 1 0 0 0]
                 [0 0 1 0 0 0]
                 [0 0 1 0 0 0]
                 [0 0 1 0 0 0]
                 [0 0 1 0 0 0]
                 [0 0 1 0 0 0]];

     

    No error

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Solution error

    Posted 04/09/14 05:03 AM

    Originally posted by: vjkgp


    Hi,

    thanks but you see all the values of decision variables are zero, please see in the solution consule, there are some messages coming like

    // MILP solution error (Ax=b) (Total, Max)       0.00000e+000 0.00000e+000
    // MILP x bound error (Total, Max)               0.00000e+000 0.00000e+000
    // MILP x integrality error (Total, Max)         0.00000e+000 0.00000e+000
    // MILP slack bound error (Total, Max)           0.00000e+000 0.00000e+000
    //

    because of these i think values are not coming.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Solution error

    Posted 04/09/14 05:05 AM

    Hi,

    most are zeros, but some are not:

    S = [[0 0 1 0 0 0]

    See the 1 ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Solution error

    Posted 04/09/14 06:40 AM

    Originally posted by: vjkgp


    ok, tell me what should i do to get over with these following error

    // MILP solution norm |x| (Total, Max)        
    // MILP solution error (Ax=b) (Total, Max)     
    // MILP x bound error (Total, Max)               
    // MILP x integrality error (Total, Max)         
    // MILP slack bound error (Total, Max)       
    // 

    is there any statement by which it will not appear??......suggest me

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Solution error

    Posted 04/09/14 08:05 AM