36 views

265 views

### How to model If $A \le B$ then $Y = 1$, otherwise $Y = 0$

Somehow I don't get it right. I would like to model the following conditional: If $A\le B$ then $Y=1$ otherwise $Y=0$ where $A, B$ are reals and $Y$ is binary. I can model as follows: $Y \cdot A \le B$...
Let $\mathcal{U} = \{ [x_1, ..., x_n] \in \mathbb{R}^n : 0 \leq x_i \leq 1\}$ be the unit hypercube and $C \in \mathbb{R}^n\setminus\mathcal{U}$ fixed. Let us consider the following problem $$\max_{X ... 1answer 128 views ### Conditional Controls in MIP Models Innocently cross-posted at Mathematics SE I am developing a model that operates in the realm of mixed integer programming, although I am fairly unfamiliar with this area of mathematics at the moment. ... 2answers 265 views ### Mocking up conditional statements in LP I would like to know how if condition statements in linear programming can be reformulated using indicator constraints, and hence solved as a mixed integer linear program. Specifically: 1. Is it ... 1answer 94 views ### Binary variable to count appearances Let x \in \mathbb{R}^n be an optimization variable. Now, at a constraint, I would like to count how many times a value, say 2, appears in x decision. I think we can have a binary variable y_i... 1answer 66 views ### How to model A_i=B_i for only one i I would like to model the following: Only one of the following equalities can hold.$$(A_1 = B_1)\quad\text{OR}\quad(A_2 = B_2)\quad\text{OR}\quad\dots\quad\text{OR}\quad(A_k = B_k)$$I can ... 1answer 110 views ### Linearizing constraint with continuous and boolean variables I have two continuous variables A, B and two binary variables x, y. Condition: if A = B \wedge x = 1 \wedge y=1 then z = 1 else z = 0 from In an integer program, how I can force a ... 1answer 69 views ### Same values constraint and grouping of variables In a linear program, I would like some variables to: 1. Take the same values 2. Group some variables i.e. some variables should take same values or lie within certain percentage. 3. All different ... 1answer 110 views ### How to optimize with “if” constraints The minimizing problem is the following :$$ \underset{w}{\operatorname{argmin}} \sum_{i=1}^{n}\left[w_{i}\times (\frac{Vw}{\sigma})_{i} - b_{i}\right]^{2} with $V$ a $n\times n$ matrix (covariance ...
How can I create constraints to make sure $x=1$ if $k\geq 0$ and $x=0$ if $k<0$, where $x\in \{0,1\}$ and $k\in \mathbb{R}$? Here is my attempt: \label{cons:1} \begin{aligned} ...