New answers tagged

3 votes
Accepted

How can we write a binary variable as a power to a constant number?

Suppose it is needed to linearize the expression $Z=P^U$. It can be written as $$Z=U\times P+1-U$$ where $U$ is a binary variable and $P$ is a parameter. This is a general formulation for calculating $...
user avatar
14 votes

How can we write a binary variable as a power to a constant number?

If you check the two cases for $x_{i,j}$, you will see that you can rewrite the expression as a linear function of $x_{i,j}$: $x_{i,j}=0$ yields $1-0.3^0=0$ $x_{i,j}=1$ yields $1-0.3^1=0.7$ So $1-0....
user avatar
  • 21.7k
2 votes
Accepted

If $x=\min\{f(\mathbf{a}),1-\epsilon\}$, how can we model and partition $x$?

Start with the constraints $$x \le f(\mathbf{a})$$ and $$x \le 1-\epsilon.$$ If the nature of the problem is that larger values of $x$ are always preferable in objective terms to smaller values of $x$,...
user avatar
  • 28.8k
4 votes
Accepted

Linearizing $y=\sum_{i=1}^n(z+c)\left(\frac{r_i^2}{1-r_i}\right)\phi_i$

You are on the right track. Linearizing the product of a continuous variable ($\xi_i$) and a binary variable ($\phi_i$) is a FAQ. See, for instance, How to linearize the product of a binary and a non-...
user avatar
  • 28.8k
2 votes

Methods to solve integer linear inequalities with products of two variables

One classic technique is to reformulate the integer variables as a bunch of binary variables. In this case i would use a encoding with powers of 2 and then use a multiplier circuit to express the ...
user avatar
1 vote

Passing exact number of allocations as constraint to pyomo in a sourcing problem

I will first formalize the described problem in mathematical notations, I think it is more suitable, rather than a piece of code, for providing a better understanding. So, let $B$ be the brands set; $...
user avatar

Top 50 recent answers are included