## 4 Mathematical Formulations
### Flexible VRPPD: MILP 2  
\(MILP2\) is more flexible than \(MILP1\). It considers a different representation of customer services. We associate two vertices \(i\) and \(i+n\) with each customer \(i\), where \(i\) and \(i+n\) are the same, but have different types of service operations. In reality, customers can be classified into two types according to the way of required services. Indeed, \(MILP2\) allows two types of services for customer \(i\). The first type assumes that the pickup and delivery are performed simultaneously. In such cases, vertex \(i\) is visited and vertex \(i+n\) is left. The second type ensures that a customer \(i\) is visited twice, where the delivery is performed at vertex \(i\), while pickup is done at vertex \(i+n\). Figure 2 illustrates the representation of customers based on a virtual replica. Figure 3 represents two feasible tours for the same vehicle trip. The solution includes nodes visited once with simultaneous pickup and delivery (black nodes), and nodes visited twice due to two separated operations (encircled black nodes). The originality in the proposed configuration is that certain feasible subtours must be allowed in appearance. However, thanks to the duplication of nodes, it became easy to model the problem by conserving classical subtour elimination principles, while using a subtle manner of formulation that takes into account the non-conservative progression of vehicle load. For \(MILP2\) formulation, we define additional parameters and variables, which are as follows. **Additional parameters for \(MILP2\):**  
* \(T_{(0,k)}\): vehicle availability time at the depot. \(\forall k=1,..m\). * \(T_{j}\): flow time at customer \(j\). **Additional variables for \(MILP2\):**  
* \(y_{i}=\left\{ \begin{aligned} & 1\,if\,pickup\,and\, delivery\,are\,formed\, simultaneously\,at\,\, customer\,j.(j=1,...,n)\\ & 0\,\,otherwise,\end{aligned} \right\}\)
* \(y_{i}=\left\{ \begin{aligned} & 1\,if\,\,the\,vehicle\,\, travels\,\,from\,\,i\,to\,j\\ &(j=n+1,...,2n;\,\,\forall i=1,...2n;\,\,i\
eq j;\,\,\forall k=1,.. m)\\ & 0\,\,otherwise,\end{aligned} \right\}\)  
\(MILP2\) formulation is as follows:  
\[Min\,\sum_{k=1}^{m}\sum_{j=0}^{n}\sum_{i=0,\
eq j}^{n}c_{ij}x_{ij}^{k} \tag{2a}\]  
Figure 3: Overview of the flexible vehicle routing problem with pickup and delivery (VRPPD): \(MILP2\). Figure 2: Representation of the virtual customers \((n+1,...,2n)\). \[W_{j}-W_{(0,k)}\geq(Sc_{j-n}^{ini}+d_{j-n}^{(c)})*\beta+(x_{0j}^{k}-1-y_{j-n})M_{18}\]  
\[(\forall j=n+1,...,2n;\ \forall k=1,...,m)\]  
\[C_{j}-C_{i}\leq Sc_{j}^{ini}*y_{i}+(\sum_{k=1}^{m}x_{ij}^{k}-1)M19\ \ (\forall j=1,...,n;\ \ \forall i=1,...,2n;\ \ i\
eq j)\]  
\[C_{j}-C_{i}\leq Sc_{j-n}^{ini}*y_{j}+(1-\sum_{k=1}^{m}x_{ij}^{k})M20\ \ (\forall j=1,...,n;\ \ \forall i=1,...,2n;\ \ i\
eq j)\]  
\[C_{j}-C_{i}\leq Sc_{j-n}^{ini}+(1-\sum_{k=1}^{m}x_{ij}^{k}+y_{j-n})M21\ \ (\forall j=1,...,n;\ \ \forall i=1,...,2n;\ \ i\
eq j)\]  
\[C_{j}-C_{i}\geq Sc_{j-n}^{ini}+(\sum_{k=1}^{m}x_{ij}^{k}-1-y_{j-n})M22\]  
\[(\forall j=n+1,...,2n;\ \ \forall i=1,...,2n;\ \ i\
eq j;\ \ k=1,...,m\]  
Figure 3:0  
Figure 3:1  
Figure 3:2  
Figure 3:3  
Figure 3:4  
Figure 3:5  
Figure 3:6  
Figure 3:7  
Figure 3:8  
Figure 3:9  
Figure 2:0  
Figure 2:1  
Figure 2:2  
Figure 2:3  
Figure 2:4  
Figure 2:5  
Figure 2:6  
Figure 2:7  
Figure 2:8  
Figure 2:9  
Knowing that:  
* \(TC_{j}=TPc_{u}*d_{j}^{(c)}\)
* \(M_{10}=M_{11}=M_{12}=M_{13}=M_{14}=M_{15}=M_{16}=M_{17}=M_{18}=M_{28}=M_{29}=M_{ 30}=M_{31}=M_{34}=Max_{k^{\prime}}Q_{k^{\prime}}^{(w)}\)
* \(M_{19}=M_{20}=M_{21}=M_{22}=M_{24}=M_{25}=M_{26}=M_{27}=M_{34}=Max_{k^{\prime}}Q_ {k^{\prime}}^{(c)}\)_MILP2_ shares the same objective function as \(MILP1\). However, constraints (2b) and (2c) mean that the first vertex associated with each customer must be visited once, either for a single operation of delivery or for a simultaneous pickup and delivery. Constraint (2d) ensures that the second vertex associated with the customer is visited only if a combined pickup and delivery do not occur at the first vertex.