Questions tagged [indicator-constraints]
For questions on constraints controlled by binary variables.
24
questions
2
votes
1answer
236 views
If-then constraint with continuous variables
I was usually using if-then constraints with integer variables but ended up using continuous variables and got confused. I have variables $x_{ij}\in\mathbb{R}_{\geq 0}$, and would like to force the ...
2
votes
1answer
41 views
Logical equivalencies to modeling an indicator decision variable in transportation problem
I am formulating a model that seeks to minimize the cost of shipping goods from factories to warehouses, where the cost of shipping is independent of the type or amount of goods being shipped (except ...
1
vote
2answers
116 views
Modeling the product of two variables
Suppose we have two continuous nonnegative variables $X_{1}$ and $X_{2}$ both bounded by the number $M$ from above.
I would like to model the following:
If $X_{1} > 0$ then $X_{2} = 0$
If $X_{2} &...
1
vote
1answer
71 views
How to model this chain of logical implication II
I would like to seek some advice on modeling the following (chain of) logical implication:
For instance $\omega_{xz}$ might indicate precedence, i.e., $x$, $z$ being the nodes $x$ and $z$, ...
1
vote
1answer
59 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$, ...
2
votes
0answers
67 views
Indicator function for integer variable with inequality constraint
I have $n$ integer variables $\vec{x}$ with the following integer programming problem.
$$
COST = \sum^{n-1}_{i = 0} a_i x_i + \sum^{n-1}_{j=0} b_j I(x_j > 0)
$$
Here, $a_i, b_j \in \mathbb{R}_+$ ...
2
votes
1answer
45 views
Portfolio optimization with indicator function constraints in Cvxpy
I have the following portfolio optimization problem that I want to solve using Cvxpy:
However I am having troubles implementing the last constraint involving an indicator function. Any ideas on how ...
1
vote
2answers
156 views
Switching of decision variables to be larger than or equal to a decision variable according to an indicator variable value
I would like to seek some advice on modeling the following:
I have two integer decisions variables, $x, x'$, that are either equal or greater than zero and either of them is greater than or equal to a ...
4
votes
1answer
141 views
Switching of decision variables to be equal to a certain decision variable according to a binary (indicator) variable
I would like to seek some advice on modeling the following:
I have two integer decisions variables, $x, x'$, that are either equal or greater than zero and either of them is to be equated to a third ...
2
votes
1answer
56 views
Formulating indicator constraint set
I am having difficulty formulating the indicator constraints for the following:
Consider a set of $A_{n}$ decision variables such that $A_{1},A_{2},āÆ,A_{n}<A$. While all of them are integers that ...
2
votes
1answer
51 views
Reformulating to locate the second largest decision variable of a set of decision variables
Consider a set of $A_{vn}$ decision variables such that $A_{v1},A_{v2},\cdots,A_{vn}<A$. While this is the standard formulation finding the maximum value of $A_{vn}$, I would also like to find the ...
2
votes
1answer
132 views
Linearize sum of continuous and boolean variable
For maximizing the objective function $\sum_i{d_i y_i}+ A x - B \cdot \mathbb{I}_{x>0}$, how can I linearize $ A x - B \cdot \mathbb{I}_{x>0}$ term where $d_i, A$ and $B$ are positive constants ...
4
votes
2answers
150 views
Formulating the conditional constraint
I want to develop a model extension of capacitated location problem.
The variables are a binary $x_i$ and a continuous $Q_i$. The following condition must be satisfied:
if $x_i = 0$, $Q_i$ must be ...
3
votes
2answers
159 views
Model “If, then” constraint
How to model the following "If, then" type constraint?
If $\sum\limits_{i \in I}x_i = 0$ then $\sum\limits_{j \in J}x_{j} = n$
where $x$ are binary variables, $n$ is a known parameter and $...
4
votes
2answers
149 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 ...
4
votes
1answer
252 views
Indicator function in math programming
I have the following doubt:
Being $x$ an integer variable that takes the values $1$, $2$ or $3$.
Being $y_1$ a binary variable.
Being $y_2$ a binary variable.
I want to express the two following ...
3
votes
1answer
116 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 ...
5
votes
1answer
111 views
How are indicator constraints implemented? [duplicate]
I wonder how systems like CPLEX, GUROBI, etc implement indicator constraints. Do they just implement Big M equivalents? If yes, what is then the justification for using them?
Edit
The question does ...
4
votes
2answers
376 views
How to convert this if-then constraint to MIP constraint?
How to convert this if-then constraint to MIP constraint?
$\text{if } a \geq 0 \text{ then } b=K_1 \text{ else(a <0 ) } \ b =K_2$
3
votes
1answer
107 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 ...
3
votes
1answer
166 views
How to fomulate the following conditional constraint in MILP?
How can I formulate the following conditional constraint to a linear constraint using indicator variables? Please note that all variables are continuous and $c \ge 0$
$\text{1: if} \ c=0 \ \& \ ...
3
votes
2answers
286 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 ...
12
votes
1answer
447 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\...
17
votes
5answers
3k views
When to use indicator constraints versus big-M approaches in solving (mixed-)integer programs
Various optimization modeling languages and solvers allow for both indicator constraints (see for example here, here and here) and traditional binary variable and big-M approaches can be used to model ...