# Variable Neighborhood Search for the Two-Echelon Electric Vehicle Routing Problem with Time Windows
## 3 Problem Description and Mathematical Model
 \forall i\in N_{S},\forall l\in N_{C}\] \[U1_{kij} \in\{0,\dots,Q1_{k}\}\quad\forall i,j\in N_{DS},\forall k\in V1\] \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\] \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\] \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\] \[Battery level of electric vehicle $e$ when departing from node $l$}\] \[D1_{j} \in\{0,\dots,\sum_{i\in N_{C}}D2_{i}\}\quad\forall j\in N_{S}\] Demand of satellite \[j\in N_{S}\] \[w1_{ki} \in[0,twl_{i}]\quad\forall i\in N_{DS},\forall k\in V1\] Visiting time of node \[i\] by vehicle \[k\] (first echelon) \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]0 Visiting time of node \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]1 by vehicle \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]2 (second echelon)  
**MILP model**  
\[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]3  
\[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]4 \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]5 (3) \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]6 (4) \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]7 (5) \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]8 (6) \[U2_{elm} \in\{0,\dots,Q2_{e}\}\quad\forall l,m\in N_{SRC},\forall e\in V2\]9 (8) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]0\[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]1 (10) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]2 (11) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]3 (12) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]4 (13) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]5 (14) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]6 (15) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]7 (16) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]8 (17) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]9 (18) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]0 (19) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]1 \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]2 (39) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]3 \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]4 (40) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]5 (41) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]6 (42) \[BSCA_{le} \in[0,BC_{e}]\quad\forall l\in N_{SRC},\forall e\in V2\]7  
The objective function (1) minimizes the total distance traveled by all utilized vehicles in both echelons. Constraint (2) guarantees that each satellite will be visited by a truck. Constraints (3) and (12) ensure the balance of flow for the satellites and customers, respectively. Constraints (4) and (5) ensure that vehicles in the first echelon are used only if needed. Constraint (6) does not allow direct transportation between central warehouses if there is more than one warehouse. Constraints (7) and (20) guarantee that the demand of each satellite and customer is met by the vehicles serving in the relevant echelon, respectively. Constraints (8) and (21) ensure that no product remains in the vehicle when returning to the central warehouse in the first echelon and to the satellite in the second echelon, respectively. Constraints (9) and (22) indicate that the vehicle capacity cannot be violated. Constraint (10) determines each satellite's demand to be the total demand of those customers served by the relevant satellite. Constraint (11) guarantees that each customer is visited only once. Constraints (13) and (14) ensure that vehicles in the second echelon are only used when they are needed.