Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX cannot extract expression

    Posted 08/09/19 07:23 AM

    Originally posted by: reru90


    hi,

    I am a newbie in using OPL, i dont know how to fix this Problem:"CPLEX(default) cannot extract expression"(in line 54). Can someone help me, please?

    Best Regards

    
    
    forall(i, j in PatientenundDepots, k in Mitarbeitermenge)
                frueAbholzeit[i] <= x[k][i][j]*StartServicezeit[k][i] <= spaetAbholzeit[i];
    
    forall(k in Mitarbeitermenge)
            sum(i in Patienten)(Nachfrage[i])*
            sum(j in PatientenundDepots)(x[k][i][j]) <= kapazitaet[k];
             
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX cannot extract expression

    Posted 08/09/19 05:11 PM

    Originally posted by: EdKlotz


    In general an error of the form " ... cannot extract expression ... " means you are specifying an expression that the optimizer you are using does not handle.   For example, for nonlinear expressions, CPLEX currently accepts only quadratic expressions.   So if you gave it an expression x**y, you would get a message like this.    When you get this error message, look at the expression in the problematic line, and assess whether it is one that the optimizer accepts.

     

    Your line 54 involves the product of a binary variable x and an integer variable StartServicezeit (for those of you who know even less German than me, "zeit" = "time"), with the other items being data rather than variables:

     

      >          frueAbholzeit[i] <= x[k][i][j]*StartServicezeit[k][i] <= spaetAbholzeit[i];

     

    Both CPLEX and CPO can handle the product of a binary and general integer like this.   But OPL appears to reject this when you a single constraint with two inequalities as in line 54 above.   I reproduced this with a simpler example, and OPL accepted it if a separated the constraint like the one above into two separate constraints.    So try replacing line 54 above with the following two equivalent statements:

    frueAbholzeit[i] <= x[k][i][j]*StartServicezeit[k][i];

    x[k][i][j]*StartServicezeit[k][i] <= spaetAbholzeit[i];

     

    I don't know the details about how OPL performs its extractions, but I think OPL could be extended to handle the single constraint you used here.   I will check with the OPL developers on that.

    But regardless of what I find, in the short term try the change described here.

     

    I don't see what's wrong in line 61, but maybe it's a byproduct of the error you were getting in line 54.

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX cannot extract expression

    Posted 08/09/19 06:07 PM

    Originally posted by: reru90


    Nice, it works)) Thank you so much!


    #CPLEXOptimizers
    #DecisionOptimization