# The Electric Vehicle Routing Problem with Time Windows, Partial Readers, and Parcel Lockers
## 3 Problem Description and Mathematical Model
In particular, route 1 visits parcel locker P4 to drop off parcels for customer 7. Similarly, route 2 delivers parcels from customers 6 and 12 to parcel locker P3. Finally, route 3 involves a visit to parcel locker P1, where customers 5, 8, and 10 retrieve their parcels. Some CSs are also visited by EVs to recharge their batteries. For seeking the routing plans on EVRPTW-PR-PL, the model uses the following decision variables: binary variable \(x_{ij}\) is equal to 1 if arc \((i,j)\in A\) is traversed and 0 otherwise. Let \(o_{i}\) for all \(i\in C_{5}\cup C_{F}\) be a binary variable equal to 1 if the self-pickup method is chosen for customer \(i\) and 0 otherwise (indicating the home delivery method). The non-negative variable \(w_{i}\) for all \(i\in P\) then determines the total parcels delivered to the parcel locker \(i\). Regarding the battery level, non-negative variables \(y_{i}\) and \(Y_{i}\) present the battery state when coming to and departing from vertex \(i\in N\), respectively. Finally, non-negative variables \(\tau_{i}\) and \(u_{i}\) track the service starting time and current load when the EV arrives at vertex \(i\in N\). Objective function:  
\[\text{Minimize}\sum_{(i,j)\in A}c_{ij}x_{ij} \tag{1}\]  
The objective function (1) minimizes the total travel distance of the EVs. Constraints:  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]  
\[\sum_{(i,j)\in A}x_{ij}=1-o_{i},\quad\forall\;i\in C_{S}\cup C_{F} \tag{3}\]  
\[\sum_{(i,j)\in A}x_{ij}\leq 1,\quad\forall\;i\in F^{{}^{\prime}} \tag{4}\]  
Figure 1: An illustrative example of EVRPTW-PR-PL. \[Q\sum_{(i,j)\in A}x_{ij}\geq w_{i},\quad\forall\;i\in P \tag{5}\]  
\[\sum_{(j,i)\in A}x_{ji}-\sum_{(i,j)\in A}x_{ij}=0,\quad\forall\;i\in N^{{}^{ \prime}} \tag{6}\]  
\[\sum_{(0,i)\in A}x_{0i}\leq|K| \tag{7}\]  
Constraints (2) and (3) enforce the associated delivery methods for all customers. Constraint (4) addresses arc connectivity related to CSs. Constraint (5) ensures that the parcel locker must be visited by vehicles if it keeps parcels for at least one customer. Constraint (6) conserves EV's flows at each node within routes. Constraint (7) limits the number of used electric vehicles. \[\tau_{i}+(t_{ij}+s_{i})x_{ij}-b_{0}(1-x_{ij})\leq\tau_{j},\quad\forall\;i\in C \cup P,(i,j)\in A \tag{8}\]  
\[\tau_{i}+t_{ij}x_{ij}+g(Y_{i}-y_{i})-b_{0}(1-x_{ij})\leq\tau_{j},\quad\forall \;i\in F^{{}^{\prime}},(i,j)\in A \tag{9}\]  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]0  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]1  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]2  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]3  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]4  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]5  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]6  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]7  
Constraints (8) and (9) track the starting time for serving at each node. Constraints (10) and (11) impose that vehicles can only visit nodes within their predefined time windows. The current loading of EVs at each node is recorded by constraints (12) and (13). Constraint (14) guarantees that a vehicle's total load does not exceed its capacity. Constraint (15) states that the actual demand of each parcel locker equals the total demand from customers picking up their parcels at that specific parcel locker. Constraint (16) limits that the number of customers assigned to each parcel locker does not exceed the parcel locker's capacity. Constraint (17) imposes that each self-pickup customer must be assigned to the self-pickup method. \[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]8  
\[\sum_{(i,j)\in A}x_{ij}=1,\quad\forall\;i\in C_{H} \tag{2}\]9  
\[\sum_{(i,j)\in A}x_{ij}=1-o_{i},\quad\forall\;i\in C_{S}\cup C_{F} \tag{3}\]0Constraints (18) and (19) track the remaining battery capacity when the EVs visit CSs and the remaining nodes, respectively.