Linked Questions
11 questions linked to/from Cast to boolean, for integer linear programming
83
votes
3
answers
57k
views
Express boolean logic operations in zero-one integer linear programming (ILP)
I have an integer linear program (ILP) with some variables $x_i$ that are intended to represent boolean values. The $x_i$'s are constrained to be integers and to hold either 0 or 1 ($0 \le x_i \le 1$)...
1
vote
1
answer
5k
views
Expressing conditional in linear program [duplicate]
I have two variables $A$ and $B$, with $A$ being binary and $B$ is a real number where $B \ge 0$. My conditions are:
if B > 0
A = 1
else
A = 0
...
3
votes
1
answer
1k
views
How to solve an ILP problem with conditions in an objective function?
I have came accross this link.
I have an integer linear programming (ILP) problem
$$\max_{(x_1, x_2,\ldots, x_n)}\sum_{i=1}^n x_i\cdot f(x_i),$$
$$\text{subject to } \begin{cases}
..., &(1)\\
L≤...
2
votes
2
answers
573
views
Casting to boolean in integer linear programming
I have variables $x \in \{0,1,\dots,5\}$ and $y \in \{0,1\}$, where
$$y = \begin{cases} 0 & \text{if } x = 5\\ 1 & \text{if } x \neq 5\end{cases}$$
My problem is to maximize $y$. How can I ...
0
votes
1
answer
421
views
How to model equality in Integer Linear Programming
How to implement v=(a==b) using Linear Programming?
$$
v=
\begin{cases}
True, a=b\\
False, a≠b\\
\end{cases}
$$
Until now I tried the big M-Method.
To show a≤b:
$$a-b+Mv≤M$$
$$-a+b-Mv≤-1$$
To show ...
2
votes
1
answer
459
views
Modeling equality in an ILP
Lets say we have integer variables $a \in\mathbb{Z}^n$ and $M \in\{0,1\}^{n\times L}$. I am promised $a_i \leq L$, for some fixed constant $L$. I want to model the constraint $$M_{i,j} \iff (a_i=j)$...
1
vote
2
answers
395
views
Linear programming with inequality constraints treated lexicographically
I'm trying to solve optimization problems of the form: $\min\{cx|Ax\preceq b,\;x\geq 0\}$, where $\preceq$ means lexicographic order; that is, the set of linear inequalities need only to be satisfied ...
0
votes
1
answer
422
views
Integer Linear programming formulation if then condition
I want to create constraints such that I can implement the following condition:
Let A be an integer variable >= 0 with an upper bound of 12
I want to introduce the following variable B also an ...
1
vote
2
answers
268
views
Expressing the condition as a set of linear constraints
Express the condition "$x = 0$ if and only if $y = 0$" as a set of linear constraints, where $x,y$ are integers such that $ - 5 \le x \le 8$ and $0 \le y \le 1$
0
votes
2
answers
343
views
Conditional milp formulation
I have two binary integer variables, $\alpha_{ts,it}$ and $\alpha_{ts,gshp} \in \{0,1\} $, and two real variables $T_{it}$ and $T_{ts}$ which have known upper and lower bounds. How can I model $\...
0
votes
1
answer
183
views
Is the maximum matching problem trivial when the graph is complete?
I have a quick question.
The maximum matching problem is an easy problem but not a trivial one. I was wondering that if the bipartite graph was complete, is it a trivial problem?
I think we can just ...