• Gurobi Staff

Hi,

You can drop the $$\sqrt{\cdot}$$ in your objective function because it is a concave monotonically increasing function. This means that $$\sqrt{a} \leq \sqrt{b}$$ for $$a \leq b$$. Once you have the optimal objective value, you can compute the $$\sqrt{\cdot}$$ of it manually.

Note that this is only ok, since it occurs in your objective only. It is not that straight forward if you have a $$\sqrt{\cdot}$$ in one of your constraints.

Best regards,
Jaromił

That certainly should work. Nevertheless, eventually, I am trying to solve a slightly complex case where dropping the  √ isn't going to do what I want.

I have K groups and I want to maximise the TOTAL SUM of the square root of the sum of scores of items for each group. (i.e )

$$\sum_{I=1}^{K} \sqrt{ \sum_{a=1}^{R} x_{a} ^{ i } * Score (x_a) }$$

I don’t think dropping the √ will give the desired result in such cases.

For example  √ 2 +√ 1 + √ 1 > √ 4 + √ 0 + √ 0);

But    2 + 1 + 1  = 4

I was wondering if there is a way to model such objectives with √ in Gurobi?

Thanks!

• Gurobi Staff

Hi Bereket,

You are right, in this case you can't simply drop the $$\sqrt{\cdot}$$. You could try the addGenConstrPow() function with $$a=0.5$$ to model a $$\sqrt{\cdot}$$. For that you will have to introduce auxiliary variables and equality constraints$$w_k= \sum_{a=1}^{R} x_{a} ^{ i } * Score (x_a)$$ and then use the auxiliary variables in your objective as $$\sum_{k=1}^{K} \sqrt{w_k}$$.

Best regards,
Jaromił

Thanks, Jaromił !

It works with the addGenConstrPow() method.

Best regards,

Bereket.