# Power of variable or tools

I'm working with OR Tools in Python and I need to define the objective function an expression of the variables. In particular, the objective function is

$$\frac{c_j}{1.7^{s_j}}$$

with $$c_j$$ constants and $$s_j$$ the model's variables.

I read there is a MakePower(exp,float) function that makes a IntExp ($$exp^{float}$$) in C++ but I havent found an equivalent for Python, there exist such a function that allow to create these expresssions of variables? (I found sum and product, but nothing else implemented for Python).

• First, you cannot use floats and floating point values. Second, make sure you use the CP-SAT solver. Third, if the ange of the variables are not too big, you can precompute everything, and use either an element constraint, or an allowed assignment constraint. – Laurent Perron Jan 14 '20 at 16:53
• thanks for the recomendatons, I already implement a model with everything precompute and only binary variables, now I want to model in this way to compare formulations (and realize if is even possible this formulatio in CP). – Clopen Jan 14 '20 at 17:52
• It is not possible. There are no floating point variables, nor floating point constraints. – Laurent Perron Jan 15 '20 at 12:14
• thanks. Just to be sure, with an int constant also there isn't possible? I mean 5^{s_j} – Clopen Jan 16 '20 at 13:11
• Not on the CP-SAT solver. I believe the original has it. But is is deprecated for non routing applications. – Laurent Perron Jan 16 '20 at 15:01