Decision Optimization

 View Only
  • 1.  Error CPLEX 5002 help

    Posted 5 days ago

    Hello, I have started using IBM ILOG CPLEX Optimization Studio 22.1.1 and I encounter the following problem when I try to run my model :
    Exception from IBM ILOG CPLEX: CPLEX Error  5002: 'q1770' is not convex.->

    I believe the error comes from my constraints in which I multiply two decision variables in a sum (a boolean decision variable multiplied by a float decision variable)

    Is there any way to make it work?
    By changing the settings, rewriting the constraint differently (is there a technique for this scenario? I've heard of McCormick envelopes but am not entirely sure they apply ?) or should I just use another solver such as Gurobi?

    So far my attempts have been to set "Solution to compute" (which seems to be cplex.optimalitytarget) to "Global optimal solution" (3)
    Which didn't change anything. Though I wasn't too hopeful, I think that only helps if the decision variables multiplication happens in the objective function
    (which it also does.. But it also is present in constraints)



    ------------------------------
    Damien Blanchard
    ------------------------------


  • 2.  RE: Error CPLEX 5002 help

    Posted 5 days ago

    You can reformulate your model to eliminate the product. See, for instance, the answers to this question on OR Stack Exchange.



    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 3.  RE: Error CPLEX 5002 help

    Posted 2 days ago

    Hi

    at https://github.com/AlexFleischerParis/howtowithopl/blob/master/multiplybinarybydecisionvariable.mod I shared ways to linearize such a product.

    // suppose we want b * x <= 7 
    
        dvar int x in 2..10;
        dvar boolean b;
    
        dvar int bx;
    
        maximize x;
        subject to
        {
          
        // Linearization  
        bx<=7;
    
         
    
        2*b<=bx;
        bx<=10*b;
    
        bx<=x-2*(1-b);
        bx>=x-10*(1-b);
        
        // if we use CP we could write directly
        // b*x<=7
        
        // or rely on logical constraints within CPLEX
        // (b==1) => (bx==x);
        // (b==0) => (bx==0);
        }


    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 4.  RE: Error CPLEX 5002 help

    Posted yesterday
    Edited by Damien Blanchard 21 hours ago

    Thank you for your answers !

    I thought there was a problem if x was possibly negative, but I made a mistake; apparently it still works so nevermind