# Combine two constraints into one

I have these two constraints, where the indices are $$i$$ person, $$j$$ shift and $$t$$, the day. $$x_{ijt}$$ is the shift assignment, $$m_{ijt}$$ the motivation of the person in a shift (only takes values $$m_{ijt}>0$$ if the corresponding value of $$x_{ijt}=1$$, otherwise $$m_{ijt}=0$$) and the slack $$s^+_{jt}$$. The first constraint ensures that demand is met and the second that if demand is greater than 0, then at least one person works and therefore not everything falls into the slack variable. Is it possible to combine both constraints into one constraint? The reasons for this do not matter for now.

\begin{align} &\sum_{i}^{}m_{ijt}+s^+_{jt}\ge Demand_{jt}&\forall j,t\\ &\sum_{i}^{}x_{ijt}\ge 0.1\cdot Demand_{jt}&\forall j,t \end{align}

• You still want a linear constraint right? If this does not matter for you, you could multiply the two left hand sides with each other and have the demand on the right hand side. Commented May 23 at 20:10
• Yes, it should be linear Commented May 23 at 20:25
• Is $m_{ijt}$ a variable or a predefined parameter. It seems a bit odd that the model determines each person’s motivation for taking a given shift at a certain day.
– Sune
Commented May 23 at 20:40
• It is a variable. Commented May 23 at 20:45
• Why do you want to combine the constraints into one? From a practical perspective it is often better to just have more constraints. If you observe specific performance issues, we might be able to help with those. Commented May 23 at 21:05

I wonder if the second constraint can be replaced by a simple upper bound on $$s^+_{jt}$$? Something like

\begin{align} &\sum_{i}^{}m_{ijt}+s^+_{jt}\ge Demand_{jt}&\forall j,t\\ &s^+_{jt} \leq \alpha_{i,t}&\forall j,t\\ \end{align}

where $$\alpha_{i,t} = \max\left(\frac{1}{2} Demand_{jt},\; Demand_{jt}-\epsilon\right)$$ for some significant but small $$\epsilon > 0$$. This specific choice of constant, $$\alpha_{i,t}$$, implies that $$\sum_{i}^{}m_{ijt} \geq \min\left(\frac{1}{2} Demand_{jt},\; \epsilon\right)$$

which is positive when $$Demand_{jt} > 0$$ and zero when $$Demand_{jt} = 0$$. This has the desired effect that when $$Demand_{jt} > 0$$, at least one of the $$m_{ijt}$$ in the summation must be positive, which implies that at least one $$x_{ijt}=1$$, by the relationship you mentioned:

[motivation] only takes values $$m_{ijt}>0$$ if the corresponding value of $$x_{ijt}=1$$, otherwise $$m_{ijt}=0$$) and the slack $$s^+_{jt}$$.

Assuming that for fixed $$j$$ and $$t$$ there is a lower bound $$L_{jt}>0$$ on the motivation of anyone assigned to a shift (0.1 is suggested in a comment), the second constraint can be replaced by an upper bound on the slack: $$s_{jt}^+ \le Demand_{jt} - L_{jt}.$$ That will force nonzero total motivation whenever demand is positive, and nonzero motivation will force at least one assignment given that $$x_{ijt}=0\implies m_{ijt}=0.$$

• Thanks Mr. Rubin. Assuming I have a decomposed model, and I want to add this constraint on the slack to the Master Problem. Do I then need to add the duals of this constraint to the objective of the Subproblems aswell, or is it just a bound rather than a constraint? Commented May 25 at 9:29
• You would need to include the dual prices for the upper bounds in the subproblems. You can get them from the reduced costs (orinanobworld.blogspot.com/2010/09/…).
– prubin
Commented May 25 at 16:19