Search code examples
mathematical-optimizationcplexsolvergurobi

Can CPLEX or Gurobi mathematical programming packages handle this objective function?


I have the following objective function in a formulation.

formula

The formula's are 0-1 variables and the formula's are constants.

I know that packages like CPLEX and Gurobi can handle quadratic objective functions and constraints. However, the above objective function has variables in the denominator and it appears to me that standard mathematical programming packages cannot handle this.

I would like to know if I am correct, and if not, I would love some pointers on how I might express such an objective function in a .LP file.


Solution

  • The first term sum(i, (s(i)*x(i,j))^2 ) is actually linear, as x^2=x for a binary variable. So this is just sum(i, s(i)^2*x(i,j)).

    The ratio is more difficult. It can be rewritten as

     ratio(j)*sum(i,x(i,j)) = sum(i,s(i)*x(i,j))^2
    

    For sure this can be handled by Gurobi as it allows non-convex quadratic terms anywhere in the model (i.e. both the objective and constraints). So my first try would be:

     min sum(j, w2(j) - ratio(j))         (linear)
     v(j) = sum(i,x(i,j))                 (linear)  
     w(j) = sum(i,s(i)*x(i,j))            (linear)  
     w2(j) =  sum(i, s(i)^2*x(i,j))       (linear)
     ratio(j)*v(j) = w(j)^2               (quadratic)     
      
    

    and use Gurobi's nonconvex quadratic solver. Of course, we don't know the rest of the model which may yield further possibilities to simplify this.