Assistance in formulating implication constraints for inequalities

I would like to seek some advice on modeling the following logical implications, where $$\delta$$ is a binary variable, $$D_{j}$$ and $$A_{j}$$ are nonnegative discrete variables, and $$p_{j}$$ are nonnegative discrete parameter values.

$$\delta = 1 \implies D_{j}+p_{j}\gt A_{j} \lor D_{j}+p_{j}\lt A_{j} \tag1\label1$$

$$D_{j}+p_{j}\gt A_{j} \lor D_{j}+p_{j}\lt A_{j} \implies \delta = 1 \tag2\label2$$

• $\delta$ is a binary variable?
– prubin
Apr 29 at 15:59
• Yes, δ is a binary variable. Thank you
– Mike
Apr 29 at 15:59

Apply the formulation given in https://or.stackexchange.com/a/2632/500 with $$y=1-\delta$$, $$x=D_j-A_j$$, and $$b=-p_j$$.

Assuming by “discrete” you mean that $$D_j$$ and $$A_j$$ are integer-valued, you can use a tolerance of $$1$$ (the $$\delta$$ in the linked answer).

If you want to enforce only $$(1)$$, introduce binary variables $$\delta_1$$ and $$\delta_2$$, and impose linear constraints: \begin{align} \delta &\le \delta_1 + \delta_2 \\ -D_j - p_j + A_j + 1 &\le M_1 (1-\delta_1) \\ D_j + p_j - A_j + 1 &\le M_2 (1-\delta_2) \end{align}

If you want to enforce only $$(2)$$, consider its contrapositive $$\delta = 0 \implies D_{j}+p_{j}\le A_{j} \land D_{j}+p_{j}\ge A_{j},$$ which you can enforce via \begin{align} D_j + p_j - A_j &\le M_3 \delta \\ -D_j - p_j + A_j &\le M_4 \delta \end{align}