## 3 Problem Modeling
### Deterministic EVRPTW  
The EVRPTW is defined on a complete and directed graph \(G=(N,A)\). Some assumptions are made for the model. 1. The supply at the depot is sufficient. 2. EVs are fully charged when leaving the depot or RSs. 3. Denote the index of depot by 0 and \(n+1\) when it corresponds to the start node and the end node of a route, respectively. 4. The fleet of EVs is big enough to serve all the customers, and each RS has enough recharging stations. 5. There is no energy consumption during service at each customer. 6. Each EV travels at a constant speed. The notations for the model are shown in Table 1.  
The deterministic EVRPTW is formulated as follows:  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\] \[f_{1}=c_{f}\sum_{k\in K}\sum_{j\in N_{C}}x_{0j}^{k}\] (2) \[f_{2}=c_{m}\sum_{k\in K}\sum_{i\in N_{j}}\sum_{j\in N\setminus\{ i\}}t_{ij}x_{ij}^{k}\] (3) \[f_{3}=c_{e}\sum_{k\in K}\sum_{i\in N_{1}}\sum_{j\in N_{2}\setminus \{i\}}h_{ij}t_{ij}x_{ij}^{k}\] (4) \[f_{4}=c_{r}\sum_{k\in K}\sum_{i\in N_{R}}\sum_{j\in N_{C}\cup(n+1 )}x_{ij}^{k} \tag{5}\]The objective function (1) minimizes the total cost, including fixed cost (2), maintenance cost (3), energy consumption cost (4), and recharging cost (5). This is subject to  
\[\sum_{k\in K}\sum_{i\in N_{1}\backslash\{j\}}x_{ij}^{k}=1\;\forall j\in N_{C} \tag{6}\]  
\[\sum_{j\in N_{2}\backslash\{i\}}x_{ij}^{k}=\sum_{j\in N_{1}\backslash\{i \}}x_{ji}^{k}\;\forall i\in N_{C}\cup N_{R},k\in K \tag{7}\]  
\[\sum_{j\in N_{R},i\
eq j}x_{ij}^{k}=0\;\forall i\in N_{R},k\in K \tag{8}\]  
\[(t_{ij}+s_{i})x_{ij}^{k}\leq t_{j}^{k}-t_{i}^{k}+T(1-x_{ij}^{k})\;\forall i\in N _{C},j\in N_{2},i\
eq j,k\in K \tag{9}\]  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]0  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]1  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]2  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]3  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]4  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]5  
\[\text{min}f=f_{1}+f_{2}+f_{3}+f_{4} \tag{1}\]6 \begin{table}
\begin{tabular}{l l} \hline \(\{0\}\) & The depot if depart from \\ \(\{n+1\}\) & The depot if arrive at \\ \(N_{C}\) & The set of customer nodes, \(N_{C}=\{1,2,\ldots,n_{c}\}\) \\ \(N_{R}\) & The set of RS nodes, \(N_{R}=\{n_{c}+1,n_{c}+2,\ldots,n\}\) \\ \(N_{1}\) & \(\{0\}\cup N_{C}\cup N_{R}\) \\ \(N_{2}\) & \(N_{C}\cup N_{R}\cup\{n+1\}\) \\ \(N\) & \(\{0\}\cup N_{C}\cup N_{R}\cup\{n+1\}\) \\ \(K\) & The set of EVs \\ \(A\) & The set of all arcs \\ \(c_{f}\) & The fixed cost of dispatching an EV from the depot \\ \(c_{e}\) & The cost of unit electric power consumption \\ \(c_{m}\) & The maintenance cost of unit travel time for an EV \\ \(c_{r}\) & The recharging cost at a RS \\ \(v\) & The speed of EV \\ \(B\) & The battery capacity of an EV \\ \(h_{ij}\) & The unit energy consumption from node \(i\) to node \(j\) \\ \(t_{ij}\) & The travel time between node \(i\) and node \(j\) \\ \(s_{i}\) & The service time for customer \(i\) \\ \([e_{i},l_{i}]\) & The time window of customer \(i\) \\ \(T\) & Upper bound on the total time for each EV \\ \(Q\) & The load capacity of an EV \\ \(q_{i}\) & The demand of customer \(i\) \\ \(S\) & The recharging rate at each RS \\ \(t_{i}^{k}\) & The service starts time of EV \(k\) at node \(i\) \\ \(b_{i}^{k}\) & SoC of EV \(k\) upon its arrival at node \(i\) \\ \(y_{i}^{k}\) & The remaining demand of EV \(k\) when it arrives at node \(i\) \\ \(x_{ij}^{k}\) & \(x_{ij}^{k}=1\) if EV \(k\) travels from node \(i\) to node \(j\); otherwise, \(x_{ij}^{k}=0\). \\ \hline \end{tabular}
\end{table} 
Table 1: Notations for the model. \[t_{i}^{k}\geq 0\ \forall i\in N,k\in K \tag{17}\]  
\[q_{i}\leq y_{i}^{k}\leq Q\ \forall i\in N,k\in K \tag{18}\]  
\[0\leq b_{j}^{k}\leq B\ \forall j\in N,k\in K \tag{19}\]  
Constraint (6) promises that each customer is visited by EVs exactly once. Constraint (7) is the flow constraint. Constraint (8) implies that an EV cannot continuously visit two RSs. Constraints (9) and (10) are the time constraints on the consecutive nodes.