# Formulating these logical constraint in an ILP

Operations Research Asked on January 18, 2021

I have these two constraints :

$$z leq My$$

$$t leq M’y$$

where $$z$$ and $$t$$ are two integer variables $$z, tgeq 0$$, $$y$$ is a binary variable, and $$M$$, $$M’$$ are two big numbers.

So basically these constraints ensure that if $$y = 1$$ then $$z, t leq M , M’$$ respectively, otherwise $$z,t = 0$$.

However these constraints won’t give me a positive value for $$t$$ if $$z > 0$$.

My question is : how to connect variables $$z$$ and $$t$$ to ensure that if $$z > 0$$ then $$t > 0$$ .

The logical constraint that I want to write is as following:

if $$y= 1$$ then $$z >0$$ and $$t>0$$ .

Thank you.

## One Answer

Let $$epsilon > 0$$ be a tolerance for what you consider positive. Now impose linear constraints $$z ge epsilon y$$ and $$t ge epsilon y$$. Because $$z$$ and $$t$$ are integer variables, you can take $$epsilon=1$$.

Correct answer by RobPratt on January 18, 2021

## Related Questions

### How to implement a local search with different operators?

1  Asked on September 1, 2020

### Robust/Stochastic optimization deployed in real-world systems/applications

1  Asked on July 27, 2020 by betty

### Finding Optimal Route using different Paths

0  Asked on July 24, 2020 by daniel

### Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP