# “Greater than 0” condition in integer linear program with a binary variable [duplicate]

How can one model the following condition in an integer linear program? $$y = \begin{cases} 1 & \text{if } x > 0\\ 0 & \text{otherwise}\end{cases}$$ Where $$y \in \{0,1\}$$ and $$x \in \mathbb N$$.

• What do you think? What have you tried? This site encourages you to show your thoughts and partial progress towards solving the problems. People can then make the answers more helpful for you and for future readers. Feb 18 '19 at 17:11
• Whether this is possible depends on additional context, such as whether you have an upper bound on $x$ and whether you already have an objective function. See "Cast to boolean" at cs.stackexchange.com/q/12102/755. Is your question answered by any of those? If not, can you edit your question to provide additional context and explain why those solutions are not applicable here?