Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Transport problem (we found a strange solution)

    Posted 01/08/18 12:30 PM

    Originally posted by: youyou75


    Dear Sir or Madam,

     

    I am beginner in CPLEX OPL and I meet difficulties to set on CPLEX OPL, a mathematical model detailed on page 48 in the joined article because I found a strange solution (with the decisional variable qvrpct = -9007199254740991 instead of a positive value as we set a constraint that qvrpct is >=0

    To simplify the model, we did on CPLEX a simple case with 2 vessels v, one road r, and a planning T = 70 days with a travel each 15 days with a time windows of + or - 2 days.

     

    You will find an illustration in attachment so that you understand fastly our problem and the solution type that we need, with v = 2, r = 2 and T=60 with a travel each 15 days with a time windows of + or - 4 days.

     

    Can someone help me please ? the mod and data file are also in attachments. it is important for me..

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Transport problem (we found a strange solution)

    Posted 01/08/18 01:57 PM

    This is indeed very odd and looks like a bug. I will have to look into that.

    A more easy way to define a decision variable to be non-negative is to declare it as 'int+' instead of just 'int'. Can you please try if that works any better?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Transport problem (we found a strange solution)

    Posted 01/08/18 02:13 PM

    Actually, the bug is in your model. You have these definitions:

     int T=...; // T is 70 in the .dat
     range t=1..T;
     int T1=...; // T1 is 70 in the .dat
     range t1=0..T1;
    ...
    dvar int qvrpct[v][r][p][c][t1];
    ...
    forall (vv in v, rr in r, tt in t, pp in p, cc in c) qvrpct[vv][rr][pp][cc][tt] >= 0;

    Note the mismatch between t and t1 in the definition of the variable and the constraint. So your model fails to state the constraint for tt=0 (since t starts at 1).

    Using 'int+' instead of 'int' will avoid that subtle trap.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Transport problem (we found a strange solution)

    Posted 01/08/18 02:43 PM

    Originally posted by: youyou75


    Dear sir, we tested what you said but don't run... CPLEX says also that  :

     

    The decision variable "qvrpct # 0 # 0 # 1 # 0 # 0" was never used by the engine. prog Unknown OPL problem
    The decision variable "qvrpct # 0 # 0 # 0 # 0 # 0" was never used by the engine. prog Unknown OPL problem
    The decision variable "qvrpct # 1 # 0 # 1 # 0 # 0" has never been used by the engine. prog Unknown OPL problem
    The decision variable "qvrpct # 1 # 0 # 0 # 0 # 0" was never used by the engine. prog Unknown OPL problem


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Transport problem (we found a strange solution)

    Posted 01/09/18 03:42 AM

    What do you mean "don't run"? Can you please be more specific?

    Did you try using 'int+' instead of 'int' or did you also fix the discrepancy between t and t1 in the variable and constraint definition?

    The warnings about unused variables can safely be ignored for now. Eventually you may want to figure out why you define variables that do not appear in any constraints or the objective function.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Transport problem (we found a strange solution)

    Posted 01/11/18 04:24 AM

    Originally posted by: youyou75


    Dear Sir, sorry for my lateness, When I say don't run, it is about the quantity qvrpct, he is always 0 or a negative number (which is impossible). I have already used int+ but nothing...


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Transport problem (we found a strange solution)

    Posted 01/14/18 09:13 AM

    I find it strange that CPLEX would return a negative value for an int+ variable. 0 is of course possible and may be the optimal value. Can you please attach your updated model/data?


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Transport problem (we found a strange solution)

    Posted 11/17/18 06:20 AM

    Originally posted by: Julia189


    Hi, 

    we have a similar problem with CPLEX 12.6.0 

    We have dvar float+ ts[S][P][M][T] with all indices having ranges of 1... ( for T e.g. range T = 1..MaxT;)  but we get the following warning message "the decision variable ts#0#0#1#0 was never used by the engine " and for ts#0#0#1#1 and so on, which seems really odd to us as we do not start our ranges at 0.

    It is a student project, so we would be glad to receive some help on this. 

     

    I attached the model and data file.

     

    Thanks very much in advance!

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Transport problem (we found a strange solution)