# Questions tagged [binary-variable]

For questions that involve variables than can only take on one of two values, usually 0 or 1.

55 questions
Filter by
Sorted by
Tagged with
1answer
46 views

### Constraints that set values to binary variables depending on other binaries

I am trying to write a mathematical problem that involves some conditions based on binary variables. More specifically, I have a set of three binary variables $d_1$, $d_2$, $d_3$ and depending on ...
1answer
116 views

### How to linearize the product of a binary and a continuous variable? [duplicate]

Suppose we have a binary variable $b \in \{0, 1\}$ and a continuous (possibly negative) variable $y \in \mathbb{R}$. How can we linearize the product $b \cdot y$?
0answers
100 views

### 0 1 solution of linear programming problem with only equality constraints

I have a linear programming problem $LP$ where all the variables $x_{i}$ take value in $\left[0, 1\right]$ (that is $0\leq x_{i} \leq 1$). All the constraints are as follow: $a_{1}+a_{2}+a_{3}=1$ that ...
2answers
420 views

2answers
152 views

### Faster implementation of “or” constraints in ILP

I have implemented a set of "or" constraints in my ILP using binary decision variables (as in this method). It works fine for smaller problems, but when I try to increase the number of ...
1answer
62 views

### Linearizing separable functions: SOS2 sets or binary variables

When linearizing a separable nonlinear function is there an advantage/disadvantage in using SOS2 sets in comparison to using binary variables?
1answer
105 views

1answer
122 views

### Modeling the sum of binary variables

Suppose $x_{1},x_{2}, \cdots ,x_{n}$ are binaries. I would like to model the following: IF $x_{1} + x_{2}+ \cdots +x_{n} \ge 2$ THEN $x_{1} + x_{2} = 2$ IF $x_{1} + x_{2}+ \cdots +x_{n} \ge 3$ ...
1answer
114 views

1answer
169 views

### Approximation methods for a mixed integer convex optimization problem

I have a convex objective function, e.g., minimizing the negative entropy function. My constraints are also linear. The only issue is that I also have binary variables. I am currently aware of AIMMS'...
3answers
460 views

### Is there a better way to formulate this constraint?

Let $x_{r}^{j}=1\iff$ the machine schedules job $j$ using resource $r$. My constraint says that: a resource cannot be used twice, i.e., if $x_{r}^{j}=1$, then $x_{r}^{j'}=0$ for $j'\neq j$. I write ...
1answer
55 views

### Find the number of idle intervals with weights

We have one job $i$ and one machine. Let $\mathbf{x}_i=[x_{i,1},x_{i,2},\ldots,x_{i,T}]$ be a binary vector where $x_{i,t}=1\iff$ job $i$ is scheduled at time $t$. Let $u$ be a positive number. I ...
2answers
2k views

### IF X = 0 THEN Y = 1, IF X > 0 THEN Y => 0

I'm trying to model the following IF $tS = 0$ THEN $Y = 1$, IF $tS \gt 0$ THEN $Y \ge 0$ $tS$ is a positive real number and $Y$ is binary. I tried the following: $tS - \epsilon \ge -M Y$ but ...
2answers
268 views

### How can this relationship be modelled?

I declare an array of binary variables as $y(i), i = 1, ..., N$ I would like to model the following: If $y(i-1) + y(i) = 1$ then $y(k) = 0$ for $k < i$ and $y(m) = 1$ for $m \geq i$ To make ...
2answers
101 views

### How can I model this binary logic?

I am looking for a constraint to express the following: IF W1 = 0 AND W2 = 0 THEN Y = 0 IF W1 = 0 AND W2 = 1 THEN Y = 1 IF W1 = 1 AND W2 = 0 THEN Y = 0 IF W1 = 1 AND W2 = 1 THEN Y <= 1 ...
2answers
209 views

### How can this be expressed as a MILP constraint?

I am looking for a constraint to express the following: IF W1 = 0 AND W2 = 0 THEN Y = 1 IF W1 = 0 AND W2 = 1 THEN Y = 1 IF W1 = 1 AND W2 = 0 THEN Y = 0 IF W1 = 1 AND W2 = 1 THEN Y <= 1 ...
1answer
528 views

3answers
454 views

### Interval variables in MIP

In Constraint Programming it is possible to use interval variables to represent intervals of time during which something happens (see here), usable in scheduling problems, for example. Is there ...
1answer
129 views