Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  "No solution" problem

    Posted 06/22/16 12:13 PM

    Originally posted by: NRouge


    Hi,

    I'm new to CPLEX and I have a problem that my model worked fine with a sample of data, so I thought  my model had no problem, but when  I run with another sample of data  it returns "No solution".

    I don't know this problem can be caused by what possible reasons, the data or the model.  

    I attached my model below, please take a look. Thank you.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: "No solution" problem

    Posted 06/22/16 03:13 PM

    Hi,

    your model may be feasible for a .dat d1.dat and then be infeasible for .dat d2.dat

    What you could try is label your constraints so that cplex will give you some relaxations and conflicts which will help you to understand why the model got infeasible.

    How ?

    Simply follow the example

    You could turn

    forall (i in manu,j in dist, m in mode)
    TTC1[i,j,m]== FC1array[i,j,m]*XC[i,j,m] + sum(p in product) VC1array[i,j,p,m]*XQ[i,j,p,m];

    forall (j in dist,k in cust, m in mode)
    TTC2[j,k,m]== FC2array[j,k,m]*YC[j,k,m] + sum(p in product) VC2array[j,k,p,m]*YQ[j,k,p,m];

    into

    forall (i in manu,j in dist, m in mode)
    ct1:TTC1[i,j,m]== FC1array[i,j,m]*XC[i,j,m] + sum(p in product) VC1array[i,j,p,m]*XQ[i,j,p,m];

    forall (j in dist,k in cust, m in mode)
    ct2:TTC2[j,k,m]== FC2array[j,k,m]*YC[j,k,m] + sum(p in product) VC2array[j,k,p,m]*YQ[j,k,p,m];

    and so on

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: "No solution" problem

    Posted 06/23/16 01:57 AM

    Originally posted by: NRouge


    Hi,

    Thank you for your response, I did as you told me and in conflicts it shows for example ct4#0#0 or ct7 #0#0#0#1#1, what does it mean?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: "No solution" problem

    Posted 06/23/16 02:10 AM

    Hi,

    In the documentation you may read

    When a model is proved infeasible, OPL also searches for possible conflicts between the constraints of the model. A conflict is a set of constraints that cannot be all true at the same time. At least one of them must be removed or modified to avoid the conflict.

    to get a better message you should change the following setting. And then you will get info about which ct4 constraint is in conflict with which ct7 constraint

    Big map naming threshold

    Specifies how many entries an array (or map in Concert terms) or constraint must have to be considered as big for display and naming purposes.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: "No solution" problem

    Posted 06/23/16 05:06 AM

    Originally posted by: NRouge


    Hi,

    It helps a lot, thank you.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: "No solution" problem

    Posted 06/28/16 12:52 PM

    Originally posted by: NRouge


    Hi,

    I have this full model :

     
    int nonode=...;
    int notrip=...;
    int novec=...;
    int Q=6;//capa vec
    int M=1000;
    int tmax=24;//trip duration limit
    int T=168;
    range V=0..nonode;
    range K=1..notrip;
    range U=1..novec;
     
    tuple arc
    {int i;
    int j; }
                  
    setof(arc) Arcs = {<i,j>|i in V,j in V};
     
    int c[Arcs]=...;//cost
    int t[Arcs]=...;//time
    int d[V]=...;//demand
    int st[V]=...;//service time
    int l[V]=...;//loading time
    int a[V]=...;//earliest time
    int b[V]=...;//latest time
     
    dvar boolean x[Arcs,K];//if arc is in K
    dvar boolean o[K,U];//if trip by vec
    dvar boolean y[K,K,U];//if trip after K
    dvar boolean z[V,K];//if cust visited by K
    dvar int+ S[V,K];//service start time
    //to depot
    dvar int+ alpha[K];//trip load time
    dvar int+ d1[K];// trip service start time
    dvar int+ d2[K];//trip arrival time
     
     
    minimize sum(k in K,<i,j> in Arcs) c[<i,j>]*x[<i,j>,k];
     
    subject to {
    forall( i in 1..nonode,k in K)
    ct1: sum(j in V,<i,j> in Arcs) x[<i,j>,k]==z[i,k];
     
    forall(i in 1..nonode)
    ct2: sum(k in K) z[i,k]>=1;
     
    forall(i in V, k in K)
    ct3: sum(j in V,<i,j> in Arcs) x[<i,j>,k] -sum(j in V,<i,j> in Arcs)x[<j,i>,k] ==0;
     
    forall(k in K)
    ct4: sum(i in V,<0,i> in Arcs) x[<0,i>,k]<=1;
     

    forall(k in K)
    ct5: sum(i in 1..nonode,<i,j> in Arcs)d[i]*x[<i,j>,k]<=Q;
     
    forall(k in K)
    ct6: alpha[k]==sum(i in 1..nonode) l[i]*z[i,k];
     
    forall(<i,j> in Arcs:i!=0 && j!=0 && i!=j,k in K)
    ct7: S[i,k]+st[i]+t[<i,j>]-S[j,k]+M*x[<i,j>,k]<=M;
     
    forall(<i,0> in Arcs, k in K)
    ct8: S[i,k]+st[i]+t[<i,0>]-d2[k]+M*x[<i,0>,k]<=M ;
     
    forall(<0,i> in Arcs,k in K)
    ct9: d1[k]+alpha[k]+t[<0,i>]-S[i,k]+M*x[<0,i>,k]<=M;
     
    forall(i in V,k in K)
    ct10:   S[i,k]<=d1[k]+alpha[k]+tmax;
     
    forall(k in K)
    ct11:   sum(i in 1..nonode,<0,i> in Arcs) x[<0,i>,k]-sum(u in U) o[k,u] ==0;
     
    forall(k in K,l in K:k!=l ,u in U)
    ct12:   o[k,u]+o[l,u]-y[k,l,u]-y[l,k,u]<=1;
     
    forall(k in K,l in K:k!=l ,u in U)
    ct13:   1-y[k,l,u]-y[l,k,u]>=0;
     
    forall(k in K,l in K ,u in U)
    ct14: d2[k]-d1[l]+M*y[k,l,u]<=M;
     
    forall(i in V,k in K)
    ct15:   a[i]*z[i,k]<=S[i,k] &&
      S[i,k]<=b[i]*z[i,k];
     
    forall(k in K)
     ct16:  a[0]<=d1[k]<=b[0];
     
    forall(k in K)
    ct17:   a[0]<=d2[k]<=b[0];
     
    forall(k in K)
    ct18:   0<=d1[k]<=T;
     
    forall(k in K)
      ct19:   0<=d2[k]<=T;
    }
     
     

    After running it shows conflicts in ct1,ct2,ct5 , I checked many times but I cannot find the reason of this conflicts. Please help. Thank you. I attached the model and the data.

     

    #DecisionOptimization
    #OPLusingCPLEXOptimizer