---
title: Electric Vehicle Routing with Time Windows
url: https://www.emergentmind.com/topics/electric-vehicle-routing-problem-with-time-windows-evrptw
type: topic
---

# Electric Vehicle Routing with Time Windows

The Electric Vehicle Routing Problem with Time Windows (EVRPTW) is a constrained combinatorial optimization problem central to sustainable logistics, aiming to route a fleet of electric vehicles (EVs) to serve customer demands within specified time intervals while respecting battery, cargo, and operational constraints. The problem’s intricacy stems from tightly coupled decision variables—routing, recharging, scheduling—under the complex operational realities of electric fleets. Advanced modeling integrates partial and nonlinear charging, charging station queuing, time-dependent travel, uncertainty, shared mobility, grid interactions (vehicle-to-grid), pickup-delivery couplings, and operational heterogeneity, as well as exact, metaheuristic, and learning-based solution methodologies.

## 1. Mathematical and Operational Formulation

The canonical EVRPTW is defined on a directed graph \(G=(V, A)\) with depot(s), set \(C\) of customers, set \(F\) of charging stations, and, in extensions, variants such as pickup-delivery pairs, discharging stations, or time-dependent arcs. Each customer \(i\) specifies a demand \(q_i\) and a time window \([e_i, l_i]\). Each route is subject to cargo capacity \(Q\), battery capacity \(B\), and trip-specific energy costs \(e_{ij}\) that depend on distance, vehicle load, and sometimes exogenous factors (e.g., weather or traffic for stochastic consumption). 

Decision variables typically include route-selection binaries (\(x_{ij}^k\)), arrival times (\(t_i^k\)), state-of-charge (\(SoC_i^k\)), and per-stop charge quantities (\(c_i^k\)), with possible per-route, per-customer, and per-charging station variations. 

The objective can lexicographically minimize (i) number of vehicles, (ii) total operational cost (distance/time), and (iii) resource usage (energy/cost), as in the MILP and hybrid models presented in [1506.00211], [2508.01476], [2512.21346], and [2509.07402]. Constraints enforce unique customer visitation, flow conservation, time-window adherence, battery/energy propagation, and, in advanced versions, further operational couplings.

Significantly, advanced formulations address:

- **Partial and nonlinear charging**: The battery level at stations is a continuous variable, with recharge time linked to the increment as in [1506.00211], [2410.19580], [2509.12623]. Nonlinear and piecewise-linear battery charging models ([2509.12623]) are critical for realistic timing and queuing.
- **Time-dependent travel and queuing**: Stepwise or arbitrary time-varying travel times and wait times at stations reflect urban and shared-mobility realities ([2509.12623]).
- **Vehicle-to-grid (V2G) and grid interactions**: Some models allow/require discharge of energy at specified nodes during grid-peak (with economic incentives) ([2012.09357], [2204.05545]).
- **Uncertainty and robustness**: Adaptive robust optimization using polyhedral budgeted uncertainty for per-arc consumption rates, with two-stage recourse, accommodates real-world uncertainty in range ([2204.10913]).

## 2. Core Algorithmic and Metaheuristic Approaches

Due to the problem’s NP-hardness, scalable solution techniques combine exact and metaheuristic strategies:

- **MILP formulations** capture all constraints, enabling proven optimality on small instances ([1506.00211], [2508.01476], [2509.07402], [2512.21346]).
- **Variable Neighborhood Search Branching (VNSB)** and **Hybrid Memetic Algorithms (HMA)** interleave local branching/large neighborhood search and population-based search with problem-specific destroy/repair strategies and domain-specific crossover ([1506.00211], [2410.19580]).
- **Parallel-Sequential Station Insertion (PSSI)** and cross-domain neighborhood search handle the insertion, removal, and relocation of charging station visits to maintain feasible battery levels ([2410.19580]).
- **Compositional SMT/MILP approaches** decompose the problem into routing, assignment, and scheduling subproblems and solve with constraint programming or SMT solvers—critical for conflict-free routing in environments with limited spatial capacity ([2103.08217], [2203.06977], [2106.07387]).

A schematic overview of main strategies is provided:

| Methodology             | Key Features                                             | Scalability                |
|-------------------------|---------------------------------------------------------|----------------------------|
| MILP (exact)            | Tightest model, optimal on small instances              | N ≤ 15–30                  |
| VNSB/HMA/ALNS/ACO       | Domain-tailored metaheuristics, destroy/repair, cross-domain |  N ≤ 100 or more           |
| Compositional (SMT/CP)  | Decomposition into submodels, supports conflicts/robustness | Industrial-scale when conflict structure is critical |
| RL/DRL-based            | Learning for high-dimensional/rapid dispatch, generalization |  N ≤ 100–1000 (inference)  |

## 3. Extensions: Uncertainty, Sharing, V2G, and Advanced Constraints

### Energy Consumption Uncertainty and Adaptive Robustness

Energy uncertainty is introduced via polyhedral uncertainty sets. Adaptive robust EVRPTW (AR-EVRPTW) is modeled as a two-stage min–max–min program, routing decisions are fixed before energy realization, with recourse for adaptive charging, and master-subproblem decomposition exploiting VNS and alternating direction (AD) algorithms as in [2204.10913]. Increased uncertainty budgets yield higher energy costs but dramatically increase route robustness and feasibility.

### Time-Dependency, Shared Mobility, and Nonlinear Charging

Time-dependent EVRPTW frameworks model per-arc travel times as step functions (e.g., peaks/valleys for congestion), queueing at charging stations, partial charging, and different infrastructure types. Shared-mobility variants introduce pickup–drop-off pairings, in-vehicle passenger couplings, and time-window pairing for shared rides ([2509.12623]). Nonlinear charging is approximated by piecewise-linear segments, with activation through binary variables and convex combinations. Results show significant reductions (up to 20%) in total vehicle-kilometers with small penalties in travel time.

### Vehicle-to-Grid and Grid Price-Integrated Models

Some EVRPTWs integrate active grid-feedback: vehicles can discharge stored energy at grid node(s) under time-variant prices ([2012.09357], [2204.05545]), with the objective function trading off travel/delivery cost and price-based discharge revenue. This links route and charge/discharge scheduling tightly to grid economics and time-of-use cost curves.

## 4. Deep Learning and Reinforcement Learning Approaches

Deep RL frameworks (e.g., curriculum-based DRL [2601.15038], Edge-DIRECT [2407.01615], attention-pointer RL [2010.02068]) leverage graph-based encoders with spatial, temporal, energy, and time-window contextualization, and decoder architectures that explicitly model the heterogeneity of EVs and charging stations. Curriculum learning decomposes the constraint set incrementally (first routing, then energy, then strict time windows), mitigating policy collapse and improving feasibility under tight EVRPTW constraints ([2601.15038]). Edge-enhanced attention, time-window overlap graph representation, and dual-attention decoders (vehicle and node) directly boost empirical performance, especially under highly heterogeneous fleet or network settings ([2407.01615]).

Key empirical observations:
- Properly structured DRL architectures with domain priors (e.g., explicit SoC masking, charging detours) can generalize models trained on N=10 to N=100; feasibility and cost performance are competitive or superior to metaheuristics for large \(N\) [2601.15038], [2010.02068], [2407.01615].
- RL approaches can infer competitive routes 10–100× faster than metaheuristics, albeit with a moderate optimality gap (typically <20%) [2010.02068], [2204.05545].
- Limitations include the lack of feasibility guarantees, difficulties with stochastic/dynamic inputs, and current restriction to static network data.

## 5. Industrial-Scale, Conflict-Free, and Multi-Period Routing

Conflict-free variants with road-segment capacity constraints, often motivated by automated or plant-based EV routing, require strict schedule separation. The problem is addressed by compositional SMT solving, with “master” routing and “checker” scheduling phases—the latter injecting “conflict cuts” generated from unsatisfiable core analysis ([2103.08217], [2203.06977], [2106.07387]). This approach drastically outperforms monolithic encodings and guarantees completeness for practical plant layouts.

Multi-day EVRPTW is realized by introducing separator nodes, time-window linking across days, and flexible appointment planning, with specialized tabu search, ALNS, and ACO metaheuristics ([2512.21346]). For small problem sizes (N ≤ 15), MIP is optimal; for larger cases, tailored metaheuristics achieve near-optimal quality orders of magnitude faster, supporting realistic, high-variance daily appointment chains.

## 6. Benchmarking, Empirical Findings, and Managerial Insights

Extensive computational benchmarking shows that heuristic and metaheuristic algorithms provide near-optimal solutions at far larger scale than exact solvers (Table 1 below), with hybrid metaheuristics (HMA), cluster-sort-assign (CSA), and compositional solvers consistently outperforming generic baselines (EDF/NDF) by 10–40% in operational cost [2410.19580], [2508.01476].

| Approach          | Instance Scale (N)   | Typical Gaps vs. Optimal | Solve Time (indicative)   |
|-------------------|---------------------|-------------------------|---------------------------|
| MILP              | N ≤ 15–20           | 0%                      | >10^3 s                   |
| HMA/LNS/CDNS      | 20 < N ≤ 200        | <5% (avg), <2% (best)   | 1–300 s                   |
| CSA (cluster-sort)| N ≈ 200             | <1 delivery lost, ~20% cost reduction vs. EDF | ~10^1 s         |
| DRL/Edge-DIRECT   | N ≤ 100             | 2–10% gap, much faster  | ~10^0 s (greedy), ~10^3 s (sampling) |

Key insights:
- Partial recharging and flexibility in charging station visit timing are crucial for feasible routing and marked reductions in “time outside depot” (ΔTTOD ~ −30%) [1506.00211], [2410.19580].
- Introduction of time-dependent and shared mobility factors enables significant reductions in fleet miles with only minor increases in per-vehicle time, providing robust evidence for urban deployment of shared EV fleets [2509.12623].
- Adaptive robust models accommodate inherent uncertainties in consumption, providing a tunable tradeoff between operational cost and reliability (out-of-sample feasibility reaching >95%) [2204.10913].
- Conflict-free formulations with compositional SMT allow practical industrial deployment when capacity or collision constraints are present.

## 7. Future Directions and Methodological Gaps

Recent research points toward several frontiers:
- **Stochastic and dynamic routing:** Inclusion of uncertainty in travel times, demands, and real-time order insertion remains a major challenge.
- **Integration of nonlinear, dynamically varying charging curves, and real-time grid coupling**: Fine-grained models of charging behavior, battery degradation, and time-variant electricity prices demand hybrid optimization-stochastic control.
- **Hybridization of RL with metaheuristics** may combine neural inference speed with local search optimality refinement.
- **Scalability beyond N=1000** likely requires hierarchical decompositions, distributed optimization, or real-time learning-based feedback (dynamic RL).
- **Open-source benchmark sets of real-world scale and complexity, coupled with metaheuristic and learning baselines**, such as those introduced in [2410.19580], are pivotal for progress.

The field continues to advance toward increasingly realistic, robust, and scalable models and solution methods, with cross-fertilization from operations research, constraint programming, and machine learning fueling rapid methodological evolution.

Source: https://www.emergentmind.com/topics/electric-vehicle-routing-problem-with-time-windows-evrptw