Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Multiplying three decision variables

    Posted 02/21/18 05:28 PM

    Originally posted by: Makak


    Hello,
    I have a problem with multiplying three decision variables in the OPL

     

    Look at the fragment of my code:
     
    int N = ...;
    int S = ...;
    range items = 1..N;
    range servers = 1..S;
     
    float p[items] = ...;
    float s[items] = ...;
    int b[items] = ...;
    int d[items] = ...;
    int sb[servers] = ...;

     

    dvar float l;
    dvar boolean x[items][servers];
    dvar float lx[items][servers];
    dvar float part[items][servers];

     

    maximize l;

     

    subject to{

     

    forall(s in servers)
    forall(i in items) {
    (x[i][s]==1) => (lx[i][s]==l);
    (x[i][s]==0) => (lx[i][s]==0);}

     

    forall(s in servers)
    sum (i in items) part[i][s]*lx[i][s]*p[i]*d[i]*b[i]  <=sb[s];

     

    forall(i in items)
    sum (s in servers) part[i][s]==1;

     

    forall(i in items)
    sum (s in servers) x[i][s]==1;
    }

     


    In the line:
    sum (i in items) part[i][s]*lx[i][s]*p[i]*d[i]*b[i]  <=sb[s];
    I want to multiply three decision variables (float -part[i][s] , float- l, boolean -x[i][s]), but I get : CPLEX Error  5002: 'q1' is not convex. 

    I've solved the problem of multiplying a boolean and float by logical constraint (lx[i][s]), but I  still don't know how to multiply it by one more float decision variable(part[i][s]).

     

    If something is unclear, please ask.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Multiplying three decision variables

    Posted 02/21/18 05:40 PM

    As far as I can tell you are only multiplying two decision variables: part and lx. The other factors (p, d, b) all seem to be data? The will simplify to just one single number.

    Your problem is that you have a quadratic constraint (a constraint that contains product of variables) that is not convex. This is not supported by CPLEX. You can read more about quadratic constraints here. Is your quadratic constraint convex in theory? In that case it may be numerics that make it non-convex.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Multiplying three decision variables

    Posted 02/22/18 06:05 PM

    Originally posted by: Makak


    Not exactly.
    Initially, this constraint looked like this:
    sum (i in items) part[i][s]*l*x[i][s]*p[i]*d[i]*b[i]  <=sb[s];
    Then, I multiplied  a l and x[i][s] using  logical constraint (you can see it in the code from the first post).
    After that, constraint looked like this:
    sum (i in items) part[i][s]*lx[i][s]*p[i]*d[i]*b[i]  <=sb[s];

    I think my constraint is not convex.
    We can see this on the simple example:
    sum (i in items) part[i][s]*lx[i][s]*p[i]*d[i]*b[i]  <=sb[s];   
    -> sum (i in items) part[i][s]*lx[i] <= data;
    -> for one item: part*lx <= data
    It is a function y<=1/x and is not convex.

     

    So, if this constraint is not convex is there any way to solve this problem?

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Multiplying three decision variables

    Posted 02/23/18 01:35 AM

    I don't see an obvious way to do that. This thread has a few ideas, though.


    #CPLEXOptimizers
    #DecisionOptimization