# Converting a function composing of multipe pieces into a linear equation

I have a variable (alpha) which depends on some other binary variables, denoted as X_i. So, for some combination of other variables, alpha may take a value (Beta_j). I added some auxillary variables (b_j) for the sake of clarity. The variable alpha is defined as follows:

I think one way of linearizing these functions is to use big-M for each function. But, I am looking for another way to efficiently linearize this function in terms of computational time.

• You say $\alpha = \beta_1$ for a certain combination of $x$ values, which seems to contradict the expression of $\alpha$ as a linear combination of $b$ variables. Do you mean that $x_1 + x_2 = 2 \iff b_1 = 1?$ If so, do you have a constraint limiting at most one $b$ variable to taking the value 1?
– prubin
Apr 9 at 15:37
• Yes, each b corresponds to the right hand side of the alpha function. The point is that any of those combinations can happen. That's why each of b_j can take the value of 1. So, the sum of b_j can be greater or equal to 1.
– Sam
Apr 9 at 22:53
• I think I can rephrase my questions in another way. It si more clear I guess. I just edit the question. I hope it is more clear now.
– Sam
Apr 10 at 14:37

I assume here that the $$\beta_j$$ are all nonnegative. You can linearize the definition of $$b_1$$ as follows: $$b_1 \le \beta_1 x_1$$ $$b_1 \le \beta_1 x_2$$ $$b_1 \ge \beta_1 (x_1 + x_2 - 1).$$ The other $$b_i$$ are handled similarly.

• many thanks for your help !
– Sam
Apr 11 at 12:00
• May I ask you what would be the situation if Beta_j would be a negative value. Indeed, beta could be both positive and negative value.
– Sam
Apr 11 at 15:05
• If $\beta_j < 0$ then $b_j$ must be declared as a nonpositive variable. The three inequalities I listed would have their directions reversed in this case.
– prubin
Apr 11 at 15:55
• Thanks for the comment ans your help !
– Sam
Apr 11 at 19:58