Linked Questions

4
votes
0answers
83 views

Conditional constraint formulation [duplicate]

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: \begin{equation}\label{cons:1} \begin{aligned} ...
23
votes
3answers
3k views

In an integer program, how I can force a binary variable to equal 1 if some condition holds?

Suppose we have a binary or continuous variable $x$, a binary variable $y$, and a constant $b$, and we want to enforce a relationship like If $x \gtreqless b$, then $y = 1$. How can we write this ...
12
votes
4answers
687 views

Single reference for Mixed Integer Programming formulations to linearize, handle logical constraints and disjunctive constraints, do Big M, etc?

Is there a single crisp and accessible reference which covers how to generate Mixed Integer Programming formulations to linearize products, handle logical constraints and disjunctive constraints, do ...
12
votes
1answer
1k views

If-then constraints in MIP programming

For continuous variables $x$ and $y$, the constraints are: ...
4
votes
2answers
162 views

Conditional Constraint in MIP

I need to formulate a conditional constraint for a binary variable z defined as: $z_{i,j,k}$, $\ \ i=1:10 \ , \ j=1:5 \ , \ k=1:3$ If any $z_{i,j,3} = 1$ then $z_{i,j,1} + z_{i,j,2} = 0 \ \ \...
12
votes
1answer
401 views

Representing an indicator function: binary variables and “indicator constraints”

I want to represent the indicator function: $$ \mathbb{1}_{(y=j)}$$ where $y$ is a non negative, integer variable. My attempt is as follows: define a binary variable: $$ z_j =\begin{cases} 1 \qquad\...
3
votes
2answers
258 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 ...
3
votes
1answer
109 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 ...
2
votes
1answer
67 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 ...
3
votes
1answer
104 views

How to transform these conditional constraints to linear integer ones in a more efficient way?

The conditional constraints A and B can be transformed to a set of linear integer constraints as follows: A) $\text{if} \ x_1=0 \ \text{then} \ d_1=1 \ \text{else} \ d_1= 0\\ x_1\in {\rm I\!R}^{\geq ...
5
votes
1answer
61 views

How to formulate case distinctions in AMPLs objective function?

This is my first real optimisation problem I formulated and now trying to solve by using AMPL. The following objective function is from a linear 0-1 LP means all variables $x_i^b\in\{0,1\}$, with $i\...
3
votes
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 ...
1
vote
1answer
54 views

How to model this chain of logical implication

I would like to seek some advice on modeling the following (chain of) logical implication: For instance $\omega_{xy}$ might indicate precedence, i.e., $x$, $y$ being the nodes $x$ and $y$, ...