## 3 Mathematical Formulation
### Mathematical Model
#### 3.3.1 Constraints for Staff Scheduling during Daytime  
Equations (2) and (3) represent the relationship between decision variables \(R_{i,j,p,d}\) and \(Y_{i,j,p,d}\). The actual number of irregular employees is decided by Equation (2) which multiplies the number of irregular workers following the schedules without absence by \(A_{d}\). Equation (3) determines value of decision variable \(R_{i,j,p,d}\). \(R_{i,j,p,d}\) can be 1 when decision variable \(Y_{i,j,p,d}\) is 1:  
\[\sum_{i\in Pt}\sum_{j\in I}\ \sum_{p\in P}\ R_{ijpd}\leq\sum_{i\in Pt}\sum_{j \in I}\ \sum_{p\in P}\ A_{d}*Y_{ijpd},\forall d\in D_{work} \tag{2}\]  
\[2*\sum_{j\in I}\ \sum_{p\in P}\ R_{ijpd}\leq\sum_{j\in I}\ \sum_{p\in P}\ Y_{ijpd}+1, \forall d\in D_{work},\forall i\in Pt \tag{3}\]  
Equations (4) and (5) mean that each regular employee and irregular employee cannot exceed coming to work five days a week due to the 52-h workweek policy. Equations (6) and (7) ensure that all employees must work between 40 and 52 h a week due to the 52-h workweek policy:  
\[\sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}X_{ijpd}\ \leq 5,\ \forall i\ \in I,\ \forall n\in N \tag{4}\]  
\[\sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}Y_{ijpd}\ \leq 5,\ \forall i\ \in Pt, \forall n\in N \tag{5}\]  
\[\sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}\paranthus_{id}\times Y_{ijpd}\geq 4 0,\forall i\in Pt,\]  
\[\forall n\in N\sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}\paranthus_{id} \times Y_{ijpd}\leq 52,\forall i\in Pt,\ \forall n\in N \tag{6}\]  
\[\sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}hours_{id}\times X_{ijpd}+\sum_{j \in I}\sum_{p\in P}\sum_{d\in W_{n}}Overhours_{id}\times O_{ijpd}\geq 40,\]  
\[ \begin{array}{c}\forall i\in I,\ \forall n\in N\\ \sum_{j\in I}\sum_{p\in P}\sum_{d\in W_{n}}hours_{id}\times X_{ijpd}+\sum_{j \in I}\sum_{p\in P}\sum_{d\in W_{n}}Overhours_{id}\times O_{ijpd}\leq 52, \\ \forall i\in I,\ \forall n\in N\end{array}  \tag{7}\]  
Equations (8) and (9) determine the allocation of the employee to the workplace and job. Each employee should be assigned to a workplace to perform just only one job. Equation (10) shows that all employees have a day off on Sunday. Equation (11) indicates that the number of employees who come to work is more than the minimum number of employees that a company needs a day:  
\[\sum_{j\in I}\sum_{p\in P}X_{ijpd}\leq 1,\forall i\in I,\ \forall d\ \in D_{work} \tag{8}\]  
\[\sum_{j\in I}\sum_{p\in P}Y_{ijpd}\leq 1,\forall i\in Pt\,\forall d\ \in D_{work} \tag{9}\]  
\[\sum_{i\in I}\sum_{p\in P}\sum_{j\in I}X_{ijpd}+\sum_{i\in Pt}\sum_{p\in P} \sum_{j\in I}Y_{ijpd}+\sum_{i\in I}\sum_{p\in P}\sum_{j\in I}O_{ijpd}=0,\forall d \ \in D_{sun} \tag{10}\]  
\[\sum_{i\in I}\sum_{j\in I}\ \sum_{p\in P}\ X_{ijpd}+\sum_{i\in Pt}\sum_{j\in I} \sum_{p\in P}\ R_{ijpd}\geq Min_{d}\,\forall d\in D_{work} \tag{11}\]  
Equations (12)-(14) determine the allocation for the workplace on the first floor and second floor. Equation (12) means that the necessary number of workers, including regular and irregular workers, is more than 15 on each floor at least per day. Equation (13) is about the assignment of a manager for supervision and one manager should work on each floor. Equation (14) means two workers doing Job 2 must be on one of two floors at least:  
\[\sum_{i\in I}\sum_{j\in I}X_{ijpd}+\sum_{i\in Pt}\sum_{j\in I}R_{ijpd}\geq 15, \ \forall p\ \in F,\forall d\ \in D_{work} \tag{12}\]  
\[\sum_{i\in M}\sum_{j\in I}X_{ijpd}\geq 1,\forall d\ \in D_{work},\forall p\ \in F \tag{13}\]\[\sum\
olimits_{i\in I}\sum\
olimits_{p\in F}X_{i2 pd}=2,\forall d\ \in D_{work} \tag{14}\]  
Equations (15) and (16) determine the allocation to open storage. Equation (15) represents that more than two employees are needed for open storage. Equation (16) means that open storage does not need managers:  
\[\sum\
olimits_{i\in Ep}X_{i13d}+\sum\
olimits_{i\in Pt}R_{i13d}\geq 2,\forall d \ \in D_{work} \tag{15}\]  
\[\sum\
olimits_{i\in M}\sum\
olimits_{j\in J}X_{ij3d}=0,\forall d\ \in D_{work} \tag{16}\]  
Equations (17)-(19) are about the allocation to the office.