Highlights
Please indicate how your work links to systems science via your contributions to systems practice, theory, and/or methodology.
- •
- Formulates electric last-mile delivery with flexible service locations as a coupled logistics service system, integrating service location selection, routing, and charging decisions under operational constraints.
- •
- Develops an integrated optimization methodology combining a unified mathematical formulation and a MALNS-FO algorithm to coordinate interdependent decisions in sustainable logistics systems.
What are the main findings and/or the implications of the main findings?
- •
- Reveals that flexible service locations consolidate spatially dispersed demand, reduce routing costs, and balance operational efficiency with customer service convenience.
- •
- Demonstrates that the MALNS-FO algorithm effectively solves the coupled location-routing-charging problem and provides high-quality solutions for sustainable logistics decision-making.
Abstract
The rapid development of shared delivery, parcel lockers, and community pickup services has enabled customers to receive orders at multiple alternative service locations. In such scenarios, the fixed-location assumption adopted in traditional electric vehicle routing problems is no longer appropriate. This paper investigates the Electric Vehicle Routing Problem with Time Windows and Flexible Service Locations (EVRPTW-FSL), in which customers can be served at one selected location from a candidate set, while each service location may accommodate multiple customers subject to capacity limits. A mixed-integer optimization model is developed to jointly determine service location assignments, vehicle routing, and charging decisions under vehicle capacity, battery range, partial recharging, and customer time-window constraints. To balance operational efficiency and customer convenience, the objective minimizes the total travel cost and the customer deviation cost incurred when a customer is assigned to an alternative service location rather than the original service location. To solve this NP-hard problem, a Modified Adaptive Large Neighborhood Search with Fix-and-Optimize mechanism (MALNS-FO) is proposed, incorporating specialized operators such as location association destroy, location similarity destroy, and route reconstruction repair, as well as a fix-and-optimize mechanism. Computational experiments demonstrate that the proposed method consistently outperforms benchmark approaches in solution quality and computational efficiency. Results further show that introducing flexible service locations can significantly reduce fleet usage and routing cost by consolidating spatially dispersed demand. Moreover, moderate customer flexibility provides substantial operational benefits while maintaining acceptable service deviation levels.
1. Introduction
In the context of global energy constraints and increasingly severe environmental challenges, promoting a green and low-carbon transition of economic and social systems has become a common international objective. With the rapid development of e-commerce and urbanization, the logistics and distribution industry plays an increasingly important role in economic activities, while also contributing substantially to energy consumption and carbon emissions. In particular, emissions generated by urban last-mile delivery continue to place pressure on environmental sustainability [1]. Compared with traditional fuel vehicles, electric vehicles (EVs) offer significant advantages, such as zero tailpipe emissions and lower environmental impact [2]. Driven by these advantages, EVs have been increasingly adopted in urban logistics systems, attracting extensive research attention to the Electric Vehicle Routing Problem (EVRP) [3,4,5].
In recent years, new business models such as shared delivery and community group buying have gradually emerged, allowing customers to choose among multiple service locations [6]. For example, in scenarios such as parcel pickup and fresh-food cold-chain distribution, customers are no longer limited to receiving deliveries only at their own addresses, but may choose among smart lockers, community pickup stations, or shared service points. This trend challenges the fixed-location assumption embedded in traditional routing models [7]. In this study, we define such a service mode as “flexible service locations”, in which customers may choose from a set of candidate locations and one service location can serve multiple customers.
In general, the relationship between customers and service locations can be divided into three types: one-to-one, many-to-one, and many-to-many, as shown in Figure 1. Traditional logistics distribution typically follows a one-to-one relationship, where each customer corresponds to a fixed service location. Many-to-one relationships arise in scenarios such as community pickup stations, where multiple customers are served by one common location. The many-to-many relationship further extends flexibility by allowing customers to choose from multiple candidate locations while each service location can simultaneously serve multiple customers. The flexible service locations studied in this paper correspond to this many-to-many relationship. Compared with fixed service modes, this setting introduces bidirectional choice and resource-sharing characteristics between customers and service locations.
Figure 1.
The relationship between customers and service locations across different logistics delivery models.
Although EVRP has been widely studied, most existing studies focus on routing, charging strategies, battery constraints, and time windows under fixed customer service locations. Meanwhile, several studies on flexible delivery locations mainly consider conventional vehicle routing settings and rarely incorporate EV-specific charging constraints. As a result, service location assignment decisions and EV charging-routing decisions are usually studied separately. However, in practice, these decisions are highly interdependent. This research gap motivates the present study.
Specifically, the selection of customer service locations directly changes the set of nodes to be visited, route distances, service sequences, and battery consumption patterns, which further affects charging feasibility and route design. Conversely, limited battery range, charging infrastructure availability, and time-window constraints may restrict feasible service location assignments. Therefore, the problem extends from the traditional routing-charging decisions to a strongly coupled joint optimization problem involving service location assignment, routing, and charging strategies.
In addition, managing customer satisfaction has become increasingly important in logistics and distribution [8]. In scenarios involving flexible service locations, the degree of deviation between the actual service location and the customer’s own location directly determines the last-mile delivery experience. If only travel cost is minimized, customers may be excessively concentrated at a few service locations, leading to significant deviations from their preferred locations and reduced service quality. In this study, customer dissatisfaction cost is defined as the deviation cost resulting from the distance between the actual service location and the customer’s own location.
To address the above challenges, this study extends the classic EVRP by introducing flexible service locations while considering customer time windows. We refer to this problem as the Electric Vehicle Routing Problem with Time Windows and Flexible Service Locations (EVRPTW-FSL), which aims to minimize the sum of travel cost and deviation cost under constraints such as battery range, service location capacity, vehicle capacity, and customer time windows.
The main contributions of this paper are threefold: First, we define an EVRPTW-FSL problem by extending the EVRPTW to flexible service location scenarios and integrating service location assignment with EV-specific charging and partial recharging decisions. Second, we formulate the problem as a mixed-integer optimization model and develop a Modified Adaptive Large Neighborhood Search with Fix-and-Optimize mechanism (MALNS-FO) to solve it efficiently. Third, we validate the algorithm’s effectiveness through extensive numerical experiments, analyzing the effectiveness of the designed operators, the effectiveness of the fix-and-optimize mechanism, and the impact of deviation costs.
The rest of the paper is organized as follows. Section 2 reviews the related literature. Section 3 presents the problem description. Section 4 gives the mathematical formulation. Section 5 introduces the proposed solution methodology. Section 6 reports computational experiments and discusses managerial insights. Finally, Section 7 concludes the paper and outlines future research directions.
2. Literature Review
Since Dantzig and Ramser [9] first proposed the vehicle routing problem (VRP) in 1959, the problem and its various extended variants and solution algorithms have been extensively and deeply studied. The objective of the problem is to determine a set of routes that depart from a depot, serve a set of customers, and then return to the depot. Typically, the objective function aims to minimize the total cost, total travel time, or total distance. Toth [10], Braekers [11], and Tan [12] provided comprehensive summaries of VRP.
In recent years, an increasing number of scholars have been working in the field of EVRP [13,14,15]. EVRP is one of the key variants of VRP, characterized by the integration of electric vehicles into logistics and delivery systems. Compared with the traditional VRP, EVRP focuses on minimizing operational costs by optimizing routes for a fleet of electric vehicles that can recharge at recharging stations. As a result, charging decisions become a critical constraint. Subsequent research on the EVRP has incorporated a variety of features, leading to the development of different variants, such as customer time windows, partial recharging strategies, and recharging station siting. Preis et al. [16] constructed an urban delivery model for electric vehicles with the goal of reducing energy consumption and designed an adaptive tabu search algorithm to solve it. Schneider et al. [17] were the first to establish a standard model for the Electric Vehicle Routing Problem with Time Windows (EVRPTW), integrating time window constraints with recharging station considerations. Keskin and Çatay [18] proposed a partial charging strategy based on EVRPTW and demonstrated that flexible charging levels can effectively reduce operating costs. To address the dual uncertainties of driving time and energy consumption in electric vehicles, Han et al. [19] constructed a path-dependent uncertainty set and proposed a two-stage adaptive robust model. The model first determines core decisions such as routing and payload, and then adjusts the charging volume and service time based on the actual scenario. Bányai et al. [20] developed a mathematical optimization model that integrates vehicle capacity, delivery time windows, and greenhouse gas emission constraints to optimize last-mile logistics routing for small-scale urban food producers using green micromobility solutions. Guo et al. [21] proposed an integrated optimization framework combining multi-agent simulation and a genetic algorithm to optimize charging strategies for shared autonomous electric vehicles while balancing operational costs, empty vehicle miles traveled, and passenger waiting times. Davatgari et al. [22] proposed an innovative framework that integrates integer programming, clustering simplification strategies, and genetic algorithms to solve the problem of charging facility site selection and capacity allocation for electric freight vehicles operating on fixed routes.
Despite these advances, the aforementioned studies generally assume fixed service locations, meaning that each node corresponds to exactly one customer, and each customer is visited exactly once. However, the EVRP with fixed service locations fails to adequately capture the flexible service locations that are widespread in real-world logistics scenarios. The consideration of flexible service locations represents an extension of the classical EVRP on the demand side. Customers are no longer fixed at their own locations; instead, service must be provided at exactly one capable location selected from a set of alternatives. Compared to the classical EVRP, this adds an additional layer of service location assignment decisions, significantly increasing the complexity of the solution. To date, limited research has simultaneously addressed both service location allocation and charging decisions. Nevertheless, some studies have already examined VRP problems related to flexible service locations. The first works considering both location and routing aspects date back to the 1960s [23,24,25]. Cavagnini et al. [26] summarized the literature on location and routing, noting that integrating the site selection and routing problems can, to some extent, prevent excessive system costs or suboptimal solutions. Janihoff et al. [27] also classified and summarized existing literature and identified key characteristics across dimensions such as facility location, vehicle routing, and site-to-route planning. Dumez et al. [28] proposed a new vehicle routing problem with flexible customer delivery choices and developed a hybrid optimization algorithm to reduce delivery costs and improve service quality in urban last-mile logistics. Yang et al. [29] developed a neighborhood-based matheuristic algorithm for the vehicle routing problem with delivery options, combining local search, column generation, and a tailored initial solution method to optimize routing under service level and capacity constraints. Hu et al. [30] proposed a model and hybrid metaheuristic for the workforce scheduling and routing problem with sequence constraints and alternative locations and demonstrated the effectiveness and managerial implications through computational experiments.
In studies on flexible service locations, the objective functions are primarily defined from the perspective of logistics companies, and most fail to measure performance in terms of customer satisfaction. For example, if a customer must travel a long distance to receive a service, this can negatively impact service quality to some extent. This paper defines the additional cost incurred by the customer as the deviation cost. Some literature has also considered these additional costs from the customer’s perspective. For example, Frey et al. [31] proposed a vehicle routing problem with time windows and flexible delivery locations, and designed an adaptive neighborhood search algorithm to solve it; their objective function balances both the vehicle routing cost and the cost of customer location preferences. Zhang et al. [32] formulated a vehicle routing problem that balances flexible delivery locations and time windows. They developed an optimization model that incorporates total travel costs, fixed vehicle operating costs, and customer satisfaction penalty costs, and designed a multi-strategy adaptive large neighborhood search algorithm to achieve the joint optimization of costs and satisfaction. Zang et al. [33] addressed the problem of time-slot conflicts in last-mile delivery by proposing an urban delivery model that balances door-to-door delivery with parcel locker pickup. The model aims to minimize the sum of vehicle travel costs and customer pickup costs, and employs an exact algorithm to achieve efficient solutions.
To further clarify the relationship between this study and existing VRP variants, Table 1 summarizes the main problem features considered in the related literature.
Table 1.
Comparison of related literature.
As shown in Table 1, flexible service locations and deviation costs have been considered in some VRP studies, while EVRP and EVRPTW studies have mainly focused on battery constraints and recharging decisions under fixed service locations. This study incorporates charging decisions and service location decisions into the EVRP framework, recognizing that the two are interdependent. The selection of service locations directly determines the driving range, energy consumption along the route, and remaining battery level, which in turn influence the optimal scheduling of charging times, locations, and durations. Conversely, the limited range of electric vehicles, the distribution of charging infrastructure, and charging capacity constraints, in turn, limit the range of available service locations and the feasibility of allocation schemes. Optimizing service location allocation or developing charging strategies in isolation is likely to result in suboptimal solutions characterized by unreasonable energy consumption, infeasible routes, or high overall costs. Therefore, these decisions must be optimized jointly and in a coordinated manner.
3. Description of the Problem
EVRPTW-FSL can be described as follows: under the constraints of electric vehicle load, battery capacity, and customer time windows, this problem involves comprehensively optimizing vehicle routes, charging strategies, and specific service location selections for customers with multiple service location options.
In this problem, each customer has an original service location, which represents the customer’s preferred receiving location in the delivery system. This location may correspond to the customer’s address or another predefined preferred pickup point, depending on the practical service scenario. The original service location is included in the candidate service-location set of the customer. Therefore, a customer may either be served at the original service location or at another feasible alternative service location. However, each customer can be served at only one location in a feasible solution. In other words, “flexible service locations” means that one service location is selected from the candidate set for each customer, rather than that a customer is served repeatedly at multiple locations.
The goal is to balance delivery costs, including travel cost, against customer deviation cost, which reflects the inconvenience or compensation associated with being served away from a preferred location. To illustrate the differences between electric vehicle routing problems under flexible and fixed service location settings, this study designs a small-scale comparative example involving 10 customers, as shown in Figure 2.
Figure 2.
Schematic illustration of electric vehicle routing under fixed and flexible service location settings. (a) EVRP with fixed service locations; (b) EVRP with flexible service locations. Percentages indicate the remaining battery levels of vehicles along the routes, and the numbers beside the arcs or assignment links indicate the corresponding travel costs or deviation costs.
Under fixed service locations, three vehicles are required to complete the delivery task due to battery capacity constraints. In route 1, with the visiting sequence , customer is located relatively far from the depot; after visiting , the remaining battery is only sufficient for the vehicle to return to the depot. In route 2, denoted by the sequence , customer is far from the depot, therefore, the vehicle must recharge at station during the trip, and battery constraints prevent the two routes from being merged. In route 3, with the visiting sequence , the vehicle must recharge at after visiting customer ; otherwise, it cannot return to the depot. Under fixed service location constraints, complex geographical distributions reduce vehicle utilization efficiency and limit recharging flexibility, thereby hindering effective route integration. Under flexible service locations, as shown in Figure 2b, one location can be selected from a customer’s set of candidate service locations for service delivery. The selected location must belong to the corresponding customer’s candidate service-location set, and the final assignment is determined by the total cost, including both travel cost and deviation cost. By assigning to and to and adjusting the choice of recharging stations, routes 1 and 2 can be restructured into a single route: . In this case, only one vehicle is required to serve customers who originally required two vehicles. Meanwhile, by assigning and to , the remaining customers can be served without recharging. As shown in Figure 2, allowing flexible service locations reduces the total cost by 17%. This reduction is mainly due to the use of fewer vehicles, fewer charging operations, and shorter travel distances. This example clearly illustrates the key characteristics that distinguish the route structure of the EVRPTW-FSL from that of the traditional EVRP.
4. Mathematical Model
EVRPTW-FSL concerns a set of customers and a set of service locations. As previously established, a many-to-many relationship exists between the customers and the service locations. The subset of candidate service locations where each customer can be served is known. The service process is performed by a homogeneous fleet of electric vehicles with fixed loading capacities and limited cruising ranges. While a vehicle is traveling, its battery charge level decreases proportionally to the distance traversed, and the vehicle may need to visit a recharging station in order to continue its route.
In the EVRPTW-FSL, each customer may be served at one of several candidate service locations. Therefore, the model needs to jointly determine the route sequence of customers and the specific service location selected for each customer. To represent these two decisions in a unified way, this study formulates the EVRPTW-FSL on a directed graph by introducing customer-location tuples as route vertices. With this representation, service-location selection and route construction can be described within the same route-vertex framework, and the subsequent flow, time, load, and battery constraints can be imposed directly on the actually visited service locations.
Let be the set of physical customers, and be the set of service locations. For each customer , its original service location is also included in and belongs to its candidate service-location set. This original service location represents the customer’s preferred receiving location, while the other feasible locations in the candidate set are regarded as alternative service locations. A customer-location tuple represents the event that customer is served at service location . Therefore, when is the original service location of customer , visiting tuple means that customer is served at its own original location; otherwise, customer is served at an alternative location and a deviation cost is incurred. In this way, both original-location service and alternative-location service are represented within the same tuple-based structure. Let denote the set of customer-location tuples, where is the candidate service location set of customer . In a feasible solution, each customer must be associated with exactly one selected tuple from its candidate tuple set. Thus, flexible service locations mean that one service location is selected for each customer from , rather than that the same customer is served repeatedly at multiple locations.
To keep a unified tuple-based representation for all route vertices, the depot and each recharging station are also represented by tuple-like vertices. Since the depot and recharging stations do not correspond to real customers, they are paired with virtual customers whose demand and service time are both set to zero. For all virtual customers, the left time-window bound is set to 0 and the right time-window bound is set sufficiently large, so that these auxiliary vertices do not impose additional customer time-window restrictions. These virtual customers are auxiliary modeling devices only. They are not involved in customer service assignments and do not represent additional delivery requests. Their role is to allow depot vertices, recharging-station vertices, and customer-location vertices to be represented within the same route-vertex framework. The set contains the departure-depot tuple and its copies, and the set contains the arrival-depot tuple and its copies. Every route starts at a vertex in set and ends at a vertex in set . The set denotes the recharging stations, and the set contains the recharging-station tuples and their copies. The set is introduced to allow multiple visits to each recharging station in . Let be the set of vertices with . To distinguish sets containing the depot vertices, the subscript or is added to the set. Specifically, , and .
Thus, EVRPTW-FSL can be defined in the directed graph , with the set of arcs is . Each arc corresponds to a travel distance , a travel time , and a travel cost , which equals by default. Each traveled arc consumes the amount of the remaining battery charge of the vehicle traveling the arc, where denotes the constant charge consumption rate. Each vertex is associated with a demand , a time window and a service time . The demand and service time for all virtual customers are set to 0. Service cannot begin before , which may result in waiting time, and is not allowed to start after , but might end later. Each customer can only be served at one of multiple candidate locations, meaning that only one of the corresponding vertices may be selected to serve the customer. The delivery routes must cover all customers but need not cover all vertices. Consequently, each vertex in set is either not visited or visited exactly once, implying that its in-degree and out-degree must simultaneously equal zero or one. For each service location , the number of assigned customers cannot exceed its maximum capacity . For each selected customer-location tuple , denotes the deviation cost of assigning customer to service location . If is the original service location of customer , this cost is zero. Otherwise, is an alternative service location, and reflects the inconvenience or compensation associated with serving customer at this alternative location. At a recharging station, vehicles are charged at a recharging rate of . The vehicles depart from the depot fully charged but may depart from a station with any state of charge, meaning that partial recharging is permitted. The recharging time depends on the amount of energy replenished.
We use decision variables associated with vertices to keep track of vehicle states. The decision variables , , keep track of the service starting time, the remaining charge level on arrival at vertex . EVRPTW-FSL allows partial recharges by defining the decision variable which represents the battery state of charge on departure from vertex . The decision variables are binary and equal 1 if customer is served in location immediately before serving customer in location , and 0 otherwise. The objective is to determine a set of vertices that minimizes the sum of total travel cost and total deviation cost, subject to constraints on vehicle capacity, battery levels, service location capacity, and customer time windows.
4.1. Notation
The sets, parameters, and decision variables are shown in Table 2.
Table 2.
List of notations.
4.2. Model Assumptions
- Electric vehicles are homogeneous, start from the depot with fully charged standard batteries, and return to the depot [17].
- Each customer is associated with a candidate service location set that includes the customer’s original service location. In a feasible solution, exactly one location is selected from this set to serve the customer. If the selected service location differs from the customer’s original service location, a deviation cost is incurred, which depends on the distance between the selected location and the original service location [31].
- Each service location can serve multiple customers, subject to a maximum capacity constraint [31].
- Vehicles travel at a constant speed, with power consumption proportional to the travel distance [17].
- The energy replenished at recharging stations increases linearly with time, allowing for partial recharging [18].
4.3. Objective Function and Constraints
The mathematical formulation of the proposed EVRPTW-FSL model is presented as follows.
The objective function and constraints are explained as follows: Equation (1) is the objective function, which minimizes the total cost consisting of travel cost and deviation cost. The deviation cost is zero when a customer is assigned to the original service location and positive only when the customer is assigned to an alternative service location. Constraint (2) ensures that exactly one customer-location tuple is selected for each customer. Thus, each customer is assigned to only one service location in a feasible solution, which may be either the original service location or an alternative service location. The virtual customers used for depot and recharging-station tuple vertices are not included in and are not involved in customer service-location assignments. Constraint (3) ensures that each recharging-station tuple vertex, including each individual copy, is visited at most once. Multiple visits to the same physical recharging station can still be represented by selecting different copies of that station. Constraint (4) imposes flow conservation on customer-location tuple vertices and recharging-station tuple vertices. Constraints (5) and (6) restrict the outgoing and incoming arcs associated with departure and arrival-depot tuple vertices, respectively. Depot copies are introduced to represent multiple route starts and route terminations separately, with each used depot copy associated with at most one route. Constraint (5) ensures that each departure-depot tuple vertex can have at most one selected outgoing arc, so each used departure-depot copy can start at most one route. Constraint (6) ensures that each arrival-depot tuple vertex can have at most one selected incoming arc, so each used arrival-depot copy can terminate at most one route. Constraint (7) ensures that the number of selected route departures equals the number of selected route arrivals, so that each started route is properly terminated at an arrival-depot tuple vertex. Constraint (8) ensures that the number of customers assigned to each service location does not exceed its service-location capacity . The total number of customers served at a location is determined by the total number of active outgoing arcs originating from all of its associated customer-location tuple vertices. Constraints (9) and (10) update the service start time along selected arcs and ensure that the service times of consecutive vertices are consistent. Constraint (9) applies to arcs departing from departure-depot tuple vertices and customer-location tuple vertices. For such an arc from vertex to vertex , the service start time at the next vertex must be no earlier than the current service start time plus the service time at the current vertex and the travel time between the two locations. Constraint (10) applies to arcs departing from recharging-station tuple vertices. For a selected arc from vertex to vertex , the service start time at the next vertex must be no earlier than the current service start time , plus the recharging duration at the current station and the travel time between the two locations. In Constraint (10), serves as a sufficiently large time-related constant, where represents the maximum possible full-recharging time. Constraint (11) enforces the time-window requirements of the corresponding vertices. Constraint (12) propagates the route load along selected arcs and updates the remaining load according to the demand of the physical customer associated with the predecessor tuple. Constraint (13) bounds the load at each departure-depot tuple vertex by the maximum route load. For depot and recharging-station tuple vertices, the paired virtual customers have zero demand; therefore, visits to these vertices do not affect the route load. Constraint (14) describes the battery propagation when the predecessor vertex is a customer-location tuple vertex. Since no recharging operation is allowed at the vertex, the battery level at the next vertex is calculated based on the arrival battery level of the current vertex minus the energy consumption along the selected arc. Constraint (15) describes the battery propagation when the predecessor vertex is a departure-depot vertex or a recharging-station vertex. In this case, the vehicle may depart with a different battery level after charging or initialization, so the departure battery level is used to update the battery level at the next vertex. Constraint (16) links the arrival and departure battery levels at recharging-station and departure-depot tuple vertices and ensures that the departure battery level lies between the arrival battery level and the battery capacity. Constraint (17) defines the binary decision variables.
4.4. Complexity Analysis
Theorem 1.
EVRPTW-FSL is NP-hard.
Proof of Theorem 1.
Assuming that each customer can only receive service at original service locations, the flexible service location decision constraint simplifies to fixed service locations. Under the premise of keeping the other assumptions unchanged, the problem degenerates into the standard EVRPTW problem. EVRPTW has been proven to be NP-hard [17]. EVRPTW-FSL, as an extension of EVRPTW, introduces an additional layer of service location selection decisions; therefore, EVRPTW-FSL is also an NP-hard problem. Theorem 1 is proved. □
5. Solution Methodology
The challenges in solving this problem lie in the coupling between the charging strategy and service location assignment, as well as the correlation in location selection among customers. Specifically: (1) The coupling between the charging strategy and service location assignment. The assignment of service locations directly affects the spatial direction and travel distances of the route, which further affects the vehicle’s battery consumption and charging requirements. Assigning service locations far from charging stations increases range pressure, while charging decisions, in turn, restrict the feasible set of service location assignments. (2) Since assigning multiple customers to the same service location reduces the travel cost of vehicles shuttling between different locations, subsequent customers tend to concentrate on service locations already serving other customers, which can easily lead to a local optimum characterized by “irrational clustering.”
Given the NP-hard nature of the problem, we develop an MALNS-FO algorithm based on the adaptive large neighborhood search framework proposed by Ropke et al. [34]. The main challenge in algorithm design lies in developing efficient operators tailored to the problem characteristics and avoiding entrapment in local optima. To this end, we design specialized operators, including location association destroy, location similarity destroy, and route reconstruction repair for the characteristics of flexible service locations. Moreover, a fix-and-optimize mechanism is designed to overcome the “irrational clustering” phenomenon during the solution process and escape local optima.
The overall framework of the algorithm is shown in Figure 3. The algorithm consists of three main parts. First, an initial solution is constructed by encoding each solution as a sequence of customer-location tuples, where the service location assignment and vehicle routing are represented simultaneously. During this stage, the cost evaluation function and path feasibility assessment are used to guide the insertion of tuples. Second, the destroy-repair phase iteratively improves the current solution. Several destroy operators are used to remove selected customer-location tuples, and repair operators are then applied to reconstruct feasible routes. Third, the fix-and-optimize phase is triggered to further improve local route structures. It identifies a cluster center, removes the related central customer, and performs local reconstruction to reduce irrational clustering. Through these three stages, MALNS-FO jointly optimizes service location assignment, vehicle routing, and charging decisions.
Figure 3.
The structure of the MALNS-FO algorithm.
To further clarify the solution procedure, the pseudocode of the MALNS-FO algorithm is described as shown in Algorithm 1.
| Algorithm 1 MALNS-FO algorithm | |
| 1: | |
| 2: | while termination conditions are not met do: |
| 3: | select destroy and repair operators adaptively |
| 4: | |
| 5: | |
| 6: | if then: |
| 7: | |
| 8: | end if |
| 9: | if then: |
| 10: | |
| 11: | else then: |
| 12: | accepted as according to the simulated annealing criterion |
| 13: | end if |
| 14: | update the scores of operators and penalty coefficient |
| 15: | |
| 16: | |
| 17: | end while |
| 18: | return |
5.1. Solution Encoding
To capture the feature of the EVRPTW-FSL problem, where service location assignment and vehicle routing must be optimized simultaneously, we develop a solution encoding based on a list of customer-location tuples. Unlike traditional methods that only encode the sequence of customer visits, this encoding scheme represents each customer visit as a customer-location tuples and organizes the visit sequence of a single vehicle into a list of sub-paths. In this way, both routing and service location assignment decisions are captured within a unified data type.
Specifically, a complete solution is denoted as , where each corresponds to a sequence of a single vehicle. Each route is an ordered sequence of customer-location tuples. For instance, indicates that the vehicle departs from depot , serves at location , then serves at , visits recharging station , serves at , and finally returns to the depot . By explicitly recording service locations, this encoding scheme directly supports flexible selection among different service locations for the same customer, while the sequential structure maintains route feasibility. In subsequent optimization processes, destroy and repair operators can be directly applied to this representation to jointly adjust service locations and reconstruct routes.
The route encoding is consistent with the mathematical model. In the MALNS-FO algorithm, each route is represented as an ordered sequence of tuple vertices, starting from a departure-depot tuple vertex and ending at an arrival-depot tuple vertex. If two consecutive tuples and appear in a route, the corresponding arc variable is equal to 1, otherwise, it is equal to 0. Moreover, when tuple appears in a route, customer is assigned to service location . Therefore, the encoded solution simultaneously represents vehicle routing and service location assignment, which is consistent with the tuple-based mathematical model.
5.2. Initial Solution Construction
To efficiently generate a high-quality and feasible initial solution, this study proposes a fast greedy insertion algorithm with simultaneous service location and routing decisions. By simultaneously optimizing the assignment of service locations and the construction of route sequences, this method gradually constructs feasible solutions. The procedure begins with an empty set of routes, and at each iteration selects an unserved customer along with its candidate service locations, evaluating the total incremental cost for all feasible insertion positions. This cost jointly considers travel cost and location deviation cost. Specifically, when inserting node between nodes and , the incremental cost is defined as , where the first three terms account for the variation in travel cost and the last term denotes the deviation cost. The algorithm prioritizes the insertion operation with the minimum incremental cost. If the current route cannot accommodate further customer insertions due to battery limitations, the basic greedy recharging station insertion operator described in Section 5.3.2 is invoked to insert a charging station at the optimal position to ensure energy feasibility. If the constraints still cannot be satisfied, a new route is created, and the above process is repeated until all customers are served. By coupling location assignments with route construction in a unified decision process, the proposed algorithm effectively balances travel cost and deviation cost, thereby providing high-quality initial solutions for subsequent optimization.
5.3. Operator Design
Based on the initial feasible solution, the destroy and repair operators collaboratively drive the iterative optimization process in the solution space. The destroy operators designed in this study consist of two types: customer destroy operators and recharging station destroy operators, while the repair operators include customer repair operators and recharging station repair operators.
5.3.1. Destroy Operator
The customer destroy operator selects customers from the current routes according to different rules, then removes the corresponding customer-location tuples and adds the removed customers into a removal list. The value of depends on the total number of customers and is determined randomly between and using a uniform distribution.
We design location association destroy and location similarity destroy for flexible service locations. In addition, several standard operators are also adopted, including random destroy, worst destroy, Shaw destroy, and zone-based destroy.
- 1.
- Location association destroy: A customer is first randomly selected as the reference, and all customers served at the same location are removed. If the number of customers removed is less than , customers whose service locations are closer to that of the reference customer are preferentially removed. Figure 4 illustrates an example of the execution process of this operator. Specifically, Customer is first randomly selected as the reference customer. Customer , who is being served at the same service location 2 as the reference customer, is removed. Since the service locations of customers and are close to location , they are subsequently removed in sequence.Figure 4. Location association destroy operator.
- 2.
- Location similarity destroy: A customer is first randomly selected as the reference, and the similarity between this customer and the others is then calculated. The similarity is defined as the number of common possible service locations divided by the number of locations available for the customer with fewer location flexibility, and customers with higher similarity are removed first. Figure 5 illustrates an example of similarity calculation. Customer has 5 candidate locations (including its original service location and ), while customer has 4 (including its original service location and ); since they share locations and , the similarity between them is .Figure 5. Location similarity destroy operator.
- 3.
- Random destroy: customers are randomly selected from the current solution and removed.
- 4.
- Worst destroy: Remove customers with high cost, where cost is the sum of travel cost of the customer from the preceding and succeeding vertices in the route, plus the deviation cost.
- 5.
- Shaw destroy: A customer is first randomly selected as the reference. Calculate the similarity between other customers and the reference customer based on factors such as location, time window, and cargo demand, and prioritize removing customers with higher similarity to the reference customer.
- 6.
- Zone destroy: The Cartesian coordinate system in which the vertices are located is divided into smaller areas that are called zones. A zone is randomly selected and all the customers in that zone are removed from the solution.
Changes in customer service sequences and service location assignments may lead to different charging requirements. Therefore, after a fixed number of iterations, recharging stations are removed and reinserted to improve the current solution by identifying more efficient charging strategies. To this end, four charging station destroy operators are employed in this study: random station destroy, worst distance station destroy, worst charge usage station destroy, and full charge station destroy.
- 1.
- Random station destroy: A set of recharging stations is randomly selected from the current solution and removed.
- 2.
- Worst distance station destroy: Recharging stations that contribute to higher travel cost are removed first.
- 3.
- Worst charge usage station destroy: Recharging stations are sorted in non-increasing order of charging amount, and those with smaller charging amounts are removed first.
- 4.
- Full charge station destroy: Recharging stations where vehicles leave with a full battery are removed first.
5.3.2. Repair Operator
This study employs the classic greedy repair operator and the k-regret repair operator. However, due to the flexibility in customer service location selection, exhaustively evaluating all possible insertion options in large-scale instances would incur substantial computational overhead. Therefore, this study significantly reduces the computational load by performing reasonable pruning to avoid unreasonable insertions in advance. In addition, a route reconstruction repair operator is developed to prevent excessive concentration of customers on existing routes.
- 1.
- Greedy repair: Determine the best insertion position for customer by calculating the cost of inserting it between all feasible pairs and selecting the position with the minimum cost. The procedure is repeated for all customers and the customer who has the minimum insertion cost is inserted to its designated position. To improve efficiency, several heuristic pruning strategies are applied during operator execution, including distance-based pruning, capacity-based pruning, and time-window violation pruning. Distance-based pruning avoids insertions into routes that are excessively far from the customer, which would otherwise incur high travel cost. Capacity-load pruning removes insertions that would violate vehicle capacity. Time-window violation pruning preemptively filters out insertions that violate the time window. By discarding infeasible insertions in advance rather than checking route feasibility after insertion, the computational load can be significantly reduced.
- 2.
- K-regret repair: Calculate the difference between the cost of the first and kth best insertions of the customers and inserts the one with the highest difference into its best position. Similar to the greedy insertion operator, the k-regret insertion operator also incorporates multiple heuristic pruning strategies, including distance-based pruning, capacity-based pruning, and time-window violation pruning. In this study, we utilize 2-regret and 3-regret repair operators.
- 3.
- Route reconstruction repair: Create a new route, and unserved customers are sequentially inserted into the new route in a greedy manner. Unlike traditional repair operators that are restricted by existing route structures, whereas the route-reconstruction insertion operator achieves structural improvement by constructing new routes. Similar to the greedy insertion operator, the route-reconstruction insertion operator also incorporates the aforementioned heuristic pruning strategies to reduce computational time.
These pruning strategies only reduce candidate insertion positions for efficiency, while the final acceptance of a move is still based on the complete feasibility check consistent with the mathematical model.
This study employs three recharging station repair operators: the basic greedy station repair, the greedy station repair with comparison, and the best station repair.
- Basic greedy station repair: Determine the first customer in the route at which the vehicle arrives with a negative battery level and insert the station that increases the travel cost least on the arc between that customer and the previous customer. If this insertion is not feasible, then the previous arcs are attempted in the same manner.
- Greedy station repair with comparison: Determine the best charging station on the arc leading to the customer at which the battery level becomes negative and compare this outcome with that obtained by inserting the corresponding best station on the immediate predecessor arc. The insertion which increases the route distance the least is performed.
- Best station repair: Determine the best charging station insertion between the customer at which the vehicle arrives with a negative battery level and the depot or a previously visited station by examining all preceding arcs along the route. Then, select the best feasible insertion and perform it.
5.3.3. Feasibility Check
To ensure the consistency between the MALNS-FO algorithm and the mathematical model, a feasibility check is performed after each repair operation. A candidate solution is accepted only if it satisfies all feasibility requirements defined in the mathematical model. The feasibility check includes four specific verification functions.
- Customer Uniqueness Check: This function scans all routes and records the customer index of each visited customer-location tuple. If a customer appears more than once or does not appear in any route, the solution is regarded as infeasible.
- Vehicle Capacity Check: By traversing each route sequentially, this function dynamically tracks the vehicle’s payload after each service. If the total demand of a route exceeds , the route is infeasible.
- Battery and Time-Window Check: This function is conducted by a forward evaluation along each route. For each selected route, it computes the arrival time, service start time, and state of charge at each vertex. If a vehicle arrives at a recharging station, the function dynamically calculates the required charging duration based on the actual power replenished. A move is deemed infeasible if the arrival time violates a customer’s time window or if the state of charge drops below zero before reaching a station, ensuring alignment with the time continuous and charging mechanics.
- Service Location Capacity Check: This function aggregates the total number of customers assigned to each service location across all generated routes. If the number of assigned customers is larger than , the solution is infeasible.
5.4. Fix-and-Optimize Local Search Mechanism
Traditional repair operators typically follow a “single insertion” strategy, in which customers are inserted individually and sequentially into routes according to a given order. This means that earlier insertions may affect subsequent insertion processes, a phenomenon that becomes more pronounced in EVRPTW-FSL. Figure 6a illustrates a route to be repaired, where customers , , and are to be inserted. Figure 6b shows the result of inserting customers using the greedy repair operator. Specifically, location is first selected as the service location for customer based on the criterion of minimizing the sum of travel cost and deviation cost. Then, location is also selected for customer , since choosing the same service location incurs no additional travel cost, and customer is relatively close to , resulting in a low deviation cost. The same applies to customer , thereby illustrating a phenomenon of serving as a “clustering center” for multiple customers.
Figure 6.
Comparison between local optimum and global optimum. (a) Customers to be inserted; (b) local optimal state; (c) global optimal state.
The routing solution shown in Figure 6c represents the optimal solution to this instance, where acts as the clustering center and the vehicle does not need to visit recharging station . It is easy to see that the traditional single insertion operator may get trapped in the aforementioned “irrational gathering” local optimum.
Therefore, to address the aforementioned local optimum phenomenon, this paper proposes the FO local search mechanism. The idea of FO is to fix the values of a subset of decision variables while optimizing the remaining ones, thereby reducing the problem size and improving computational efficiency [35]. The FO local search consists of three steps: First, identify cluster centers along the route. If multiple consecutive customers are served at the same location, record that location and the number of customers served. A roulette wheel selection is then performed based on the number of customers served at each recorded location; locations serving more customers are more likely to be selected. The selected location is the cluster center to be disrupted, such as point in Figure 7a. Second, all customers served at the selected clustering center are removed from the route. Meanwhile, if the clustering center is adjacent to a recharging station, the corresponding recharging station is also removed, as illustrated in Figure 7b. This removal creates “insertion positions” in the route, while the remaining parts are kept unchanged, corresponding to the fixed variables in the model. Third, a commercial solver is invoked to determine the service locations and visiting sequence of the removed customers, with the requirement that their insertion must be confined to the insertion positions identified in the second step.
Figure 7.
Schematic diagram of the FO local search process. (a) Local optimal state; (b) customers at the gathering center are removed; (c) global optimal state.
To make the FO procedure reproducible, we further specify the corresponding subproblem. After the cluster center is selected, all customers served at this location are removed from the current route, and the remaining route segments are fixed. The insertion position is defined as the gaps between two consecutive fixed vertices after the removal operation. The FO subproblem only optimizes the removed customers within these insertion positions, including their service location choices, visiting sequence, and the related charging-station decisions inside the local area. The load, time, and battery states are then updated according to the same feasibility rules as in the mathematical model. If the commercial solver obtains an optimal or feasible solution within 60 s, the local route segment is replaced by the solver solution only when the complete route passes the feasibility check and improves the objective value. If no feasible solution is found within the time limit, the original route is kept unchanged.
5.5. Simulated Annealing Criterion
The solution update mechanism follows the simulated annealing criterion. A new solution is accepted directly if it improves the current solution; otherwise, it is accepted with probability , where and denote the objective values of the new and current solutions, respectively. is the initial temperature, is the cooling factor with , and is the current iteration number. By regulating the acceptance of inferior solutions through a temperature-controlled mechanism, the simulated annealing criterion dynamically balances exploration and exploitation, thereby enhancing the algorithm’s ability to approach global optimality.
5.6. Adaptive Weight Adjustment
During the iteration process of the MALNS-FO algorithm, operator weights are updated adaptively based on their historical performance. Each operator is scored according to the quality of the solutions it produces (e.g., improvement, acceptance, or rejection). A reaction-based weight updating strategy is then periodically applied to adjust the selection probabilities, allowing more effective operators to receive higher weights while preserving the exploration potential of less frequently selected ones, thereby guiding the search process adaptively. All operators are initialized with equal weights. At the end of each iteration cycle, the weight of operator , denoted as , is updated as , where controls how quickly the weight adjustment algorithm reacts to changes in the effectiveness of the heuristics, is the number of times operator is applied within the cycle, and is its accumulated score. The score is determined by solution quality: obtaining a new global best, improving the current solution, or producing a worse solution that is still accepted under the simulated annealing criterion corresponding to scores , , and , respectively.
6. Experimental Tests
To evaluate the performance of the MALNS-FO algorithm, this paper assesses its effectiveness from two dimensions: solution quality and computational efficiency. In addition, we analyze the effectiveness of the operators, validate the FO mechanism, and examine the impact of deviation cost. All experiments are performed on a Windows 10 system equipped with 16 GB of memory and an Intel(R)Core(TM) i7-8550UCPU@1.80 GHz. The algorithm is implemented in Python 3.8 using Anaconda, and Gurobi 9.5.1 is employed to solve the mathematical model.
6.1. Test Instances and Parameter Settings
Since EVRPTW-FSL is a new variant of the EVRP, there are currently no standard benchmark instances for this problem. Therefore, the test instances are generated by extending the classical EVRPTW benchmark instances of Schneider et al. [17], including three classes where customers and recharging stations are clustered (C), randomly distributed (R), and both clustered and randomly distributed (RC). The original information in these instances, including the depot, customers, charging stations, customer demands, service times, time windows, vehicle capacity, battery capacity, and travel-related parameters, is retained. To construct the EVRPTW-FSL instances, additional service locations are randomly generated on the same map using fixed random seeds. For each customer, a service location is considered as a candidate location if its distance from the customer does not exceed 10% of the maximum spatial span of the instance map. The customer-location tuples are then generated based on these candidate service locations. The capacity of each service location is set to 5% of the number of customers in the corresponding instance. The generated instances and the related random-seed information are publicly available in the GitHub repository described in the Data Availability Statement.
To make the scale of the test instances explicit, the number of customers in each instance group is summarized in Table 3. The small-size instances are used for exact-solver validation, and their instance names indicate the number of selected customers. Specifically, instances ending with C5, C10, and C15 contain 5, 10, and 15 customers, respectively. The large-size instances retain the original 100-customer structure of the Schneider et al. benchmark and are used for comparative experiments among metaheuristic algorithms. The number of used vehicles is not fixed in advance in the test instances; instead, it is determined by the solution through the number of constructed routes.
Table 3.
Number of customers in the test instances.
In the numerical experiments, the parameter settings follow Ropke [34], with , , , , , and . The FO local search is applied when the iteration count reaches a multiple of . The maximum running time for Gurobi is set to 7200 s. In the large-scale instance experiments, the MALNS-FO algorithm terminates after reaching 2500 iterations.
For each physical recharging station , recharging-station tuple vertices are created in the exact Gurobi model, where is the number of physical customers. This setting follows the worst-case treatment used in related CEVRP formulations, where a sufficiently large number of charging-station copies is introduced to allow each physical charging station to be visited zero, one, or multiple times [36].
6.2. Experimental Results and Comparative Analysis
6.2.1. Numerical Results for Small-Size Instances
Table 4 compares the performance of Gurobi and the MALNS-FO algorithm on 32 small-size instances, where denotes the total cost and denotes the computation time in seconds (s). The symbol “-” indicates that Gurobi did not obtain a feasible incumbent solution within the maximum running time. For these cases, no objective-value comparison with Gurobi is made, and the results of MALNS-FO are reported only as feasible solutions.
Table 4.
Comparison of solution results for small-scale instances.
As shown in Table 4, among the 21 instances where Gurobi is able to obtain optimal solutions, the MALNS-FO achieves exactly the same optimal solutions, with all gaps equal to 0.00%. For the remaining 11 instances, Gurobi does not obtain a feasible incumbent solution within the time limit, and therefore no objective-value comparison is made for these cases. In contrast, MALNS-FO is able to generate feasible solutions for all instances within a much shorter computational time. In terms of computational efficiency, as the problem size increases from C5 to C15, the computation time of Gurobi exhibits a typical exponential growth trend, reaching the maximum time limit of 7200 s for several instances. In contrast, the computation time of MALNS-FO increases approximately linearly, with significantly lower average computational time. For example, for the C15 instances, MALNS-FO requires on average only 210 s, which is substantially lower than the 7200 s required by Gurobi. Overall, the small-size experiments mainly verify the solution correctness and feasibility-finding ability of MALNS-FO, and show clear advantages on larger instances that are difficult for Gurobi to handle within the time limit.
6.2.2. Numerical Results for Large-Size Instances
To further evaluate the performance of the MALNS-FO algorithm on large-size instances, Adaptive Large Neighborhood Search (ALNS), Variable Neighborhood Search (VNS), Memetic Algorithm (MA), and Ant Colony Optimization (ACO) are selected as comparison algorithms. Jia [3], Mara [4], Souza [5] and other scholars have proven the effectiveness of these algorithms in solving routing optimization problems. For each large-size instance, each algorithm was independently run 20 times, and the reported objective value and runtime are the average values over the 20 runs. The parameter settings of the comparison algorithms are adopted from the original studies or widely recognized benchmark references in the literature, with default values corresponding to those validated through parameter tuning. All comparison algorithms were adapted to the EVRPTW-FSL structure and implemented under the same computational environment, stopping criterion, route encoding logic, station repair mechanism, and feasibility checks. The results comparing the total cost and runtime of each algorithm under large-size instances are shown in Table 5. The relative percentage difference () is also reported to compare MALNS-FO with the best-performing comparison algorithm.
Table 5.
Comparison of solution results for large-scale instances.
As shown in Table 5, in terms of solution quality, the results obtained by the MALNS-FO algorithm are superior to or equal to those of the four comparison algorithms across all 56 large-size instances. For type-C instances with clustered customer distributions, MALNS-FO demonstrates the most significant advantage, with an average of 832.60 and an average of −7.29%. The negative value indicates that MALNS-FO obtains a lower total cost than the best-performing comparison algorithm. This improvement is mainly attributed to the FO mechanism, which effectively identifies and restructures the “irrational clustering” phenomenon. For type-R instances with randomly distributed customers, the performance gap among the algorithms becomes smaller; however, MALNS-FO still maintains its lead, with an average of 1105.11 and an average of −2.02%. For type-RC instances with mixed distributions, MALNS-FO achieves an average of 1260.11 and an average of −2.14%. In terms of computational efficiency, the average computation time of MALNS-FO is lower than that of the comparison algorithms in all three types of instances. For example, compared with VNS, the average computation time is reduced by approximately 24%, mainly due to the significant reduction in the computational effort of the insertion operators enabled by multiple heuristic pruning strategies. Overall, the experimental results on large-size instances demonstrate the effectiveness of the MALNS-FO algorithm for solving the EVRPTW-FSL. The algorithm outperforms the comparison algorithms in both solution quality and computational efficiency, with particularly pronounced advantages observed in type-C instances.
Table 6 reports the results of the Wilcoxon rank-sum test comparing MALNS-FO with other comparison algorithms in terms of total cost and computation time, where indicates a statistically significant difference. At the 99% confidence level, MALNS-FO performs significantly better than the comparison algorithms in both total cost and computation time.
Table 6.
Wilcoxon signed-rank test of MALNS-FO and four comparison algorithms.
6.3. Operator Effectiveness Analysis
To analyze the behavior of adaptive operator selection, we recorded the selection probabilities of different destroy and repair operators over iterations. Since the selection probabilities are updated according to the historical scores of operators, this analysis helps show which operators are more often rewarded and selected during the search process. Figure 8 and Figure 9 show how the probability of selecting the destroy and repair operators changes with the number of iterations. Black thin lines represent classic operators. Blue lines represent our operators. Gray lines represent the operators that are not the focus of the subplot. Above average performance is displayed by solid line segments, while dotted lines represent below average performance.
Figure 8.
The probability of the destroy operator varies with the number of iterations.
Figure 9.
The probability of the repair operator varies with the number of iterations.
As shown in Figure 8, the location association destroy operator performs well among all removal operators. Its selection probability increases from about 0.18 at the beginning to around 0.25, and remains above this level in later iterations, indicating stable performance above average. This can be attributed to its ability to remove batches of location-related customers, thereby selectively disrupting clustered customer structures and more effectively guiding the search toward improved solutions. The location similarity destroy operator also performs above the average level, but overall it is inferior to the Shaw removal operator. A possible explanation is that, although it follows the same similarity-based removal principle as the Shaw operator, the latter considers multiple attributes, including customer time windows, demand, and route information, resulting in a more comprehensive measure of similarity. As shown in Figure 9, the selection probability of the route reconstruction repair operator exhibits a steadily increasing trend during the iterative process, rising from approximately 0.22 in the initial stage to around 0.32 and eventually stabilizing above 0.30. The superior performance of this operator mainly stems from its distinctive mechanism. Unlike traditional insertion operators that are restricted to local adjustments within the existing route structure, the route reconstruction repair operator constructs entirely new route sequences, thereby overcoming structural limitations and enabling exploration of more promising regions of the solution space. Overall, the proposed location association destroy operator and route reconstruction repair operator show relatively high selection probabilities during the search process, indicating that they are frequently rewarded by the adaptive scoring rule. This result suggests that these operators are useful for guiding the search of the MALNS-FO algorithm.
6.4. Effectiveness Analysis of the FO Mechanism
To evaluate the effectiveness of the FO local search mechanism, the performance of the modified adaptive large neighborhood search without the FO mechanism (Modified Adaptive Large Neighborhood Search, MALNS) is compared with that of the MALNS-FO algorithm, as reported in Table 7. In terms of solution quality, MALNS-FO achieves total costs that are superior to or equal to those of MALNS for the vast majority of test instances. Specifically, out of 56 instances, MALNS-FO obtains better solutions in 49 instances and achieves the same results as MALNS in the remaining 7 instances. For the type-C instances, the algorithm incorporating the FO mechanism demonstrates significant advantages, with the average objective value reduced by 9% compared with the variant without FO, at the expense of an approximately 11% increase in computational time. For the type-RC instances, the average objective value is reduced by 5%, while the computational time increases by about 8%. In these instances, characterized by clustered customer distributions, the improvement brought by the FO mechanism is more pronounced, as the concentration of customer locations tends to induce locally optimal “irrational clustering” patterns, which can be effectively mitigated through targeted local reconstruction by the FO mechanism. For the type-R instances, the FO mechanism leads to an increase of approximately 6% in computational time, while multiple instances exhibit identical objective values, and the average performance gap is smaller than that observed in the type-C and type-RC instances. This is because randomly distributed customers are less likely to form “irrational clustering” patterns. Overall, the FO mechanism demonstrates good adaptability across most instances, particularly for type-C and type-RC instances, where it effectively improves solution quality with a relatively modest increase in computational time. Table 8 presents the results of the Wilcoxon signed-rank test at the 99% confidence level, where indicates a statistically significant difference. At this confidence level, the inclusion of the FO mechanism leads to significantly better performance in terms of total cost compared with the comparison algorithm.
Table 7.
Comparison of solution results between MALNS-FO and MALNS.
Table 8.
Wilcoxon signed-rank test of MALNS-FO and MALNS.
To further analyze the FO mechanism, we recorded several FO-related indicators over repeated runs, as shown in Table 9. The runtime of FO is included in the total runtime of MALNS-FO, and both MALNS-FO and MALNS are tested under the same stopping criterion. Therefore, the comparison does not give MALNS-FO extra computational resources outside the algorithm.
Table 9.
Statistical results of the FO mechanism.
The results show that the FO mechanism is called regularly during the search, but each FO subproblem remains small because only customers around the selected cluster center are reoptimized. The average FO runtime is also limited compared with the total runtime. Moreover, a certain proportion of FO calls successfully generate feasible local solutions, and some of them are accepted as improved solutions. This indicates that the FO mechanism can help reconstruct local route structures and escape the irrational clustering pattern, especially in type-C and type-RC instances where customer distributions are more clustered.
6.5. Impact of Deviation Costs
To evaluate the impact of different deviation cost settings, four cases are considered following [31]: (1) no deviation costs; (2) fixed deviation costs of 1; (3) costs equal to the distance , where and denote the customer location and the assigned service location, respectively; and (4) costs equal to this distance squared . As shown in Figure 10, for large-size instances, both the total cost and the proportion of customers served at their original service locations increase across all three instance types as the deviation cost increases from 0 and 1 to and . This clearly indicates that improvements in customer service satisfaction are generally accompanied by higher operational costs. Table 10 reports the average total cost and the proportion of customers served at their original service locations under different deviation cost settings (where denotes the proportion of customers assigned to their original service locations). Increasing the deviation cost from 0 to 1 has only a limited effect on customer assignment. For instance, in type-R instances, rises slightly from 0.42 to 0.49, meaning most customers are still assigned to alternative service locations despite the slight penalty. When the deviation cost is set to , the effect becomes much more pronounced: increases from 0.45 to 0.65 in type-C instances, from 0.49 to 0.81 in type-R instances, and from 0.47 to 0.76 in type-RC instances. When the deviation cost is further raised to , remains at a high level across all instance types, with most customers are assigned to their original service locations. However, the continues to rise, suggesting that an overly strong penalty may push the model toward minimizing deviation at the expense of higher travel cost. Overall, serves as an effective benchmark for modeling deviation cost, as it achieves a reasonable balance between controlling total cost and accommodating customer location preferences.
Figure 10.
Impact of different deviation costs.
Table 10.
Statistical comparison of the impact of different deviation costs.
7. Conclusions
This paper studies the electric vehicle routing problem with flexible service locations, breaking away from the assumption of fixed customer service locations in traditional route optimization. A mixed-integer programming model is developed that jointly considers service location assignment, routing, and charging strategies. By introducing deviation costs and location capacity constraints, the model captures the trade-off between service flexibility and operating cost. To address the NP-hard nature of the problem and the presence of “irrational clustering” in the solution space, a MALNS-FO algorithm is proposed. Specialized operators, including location association destroy, location similarity destroy, and route reconstruction repair, are designed, and an FO mechanism is incorporated to effectively escape local optima. The computational results show that, on small-size instances, MALNS-FO obtains the same optimal solutions as Gurobi in the instances where Gurobi proves optimality. For instances where Gurobi does not find a feasible incumbent solution within the time limit, MALNS-FO is still able to generate feasible solutions. In large-size instances, MALNS-FO demonstrates significant advantages over algorithms such as ACO and VNS in terms of both total cost and computational efficiency, enabling the attainment of higher-quality solutions in less time.
The findings of this study provide the following managerial implications for logistics enterprises: (1) Introducing flexible service locations can provide logistics companies with more routing flexibility and help consolidate spatially dispersed demand, which may reduce the overall operating cost. (2) Managers should appropriately set deviation costs to avoid an excessive focus on service consolidation that may compromise service quality, thereby achieving a balance between operational cost and service level.
At the modeling level, this study does not yet consider some complex operational factors, such as stochastic customer preferences, stochastic customer demand, dynamic service location availability, and heterogeneous electric vehicle fleets. Future research may extend the proposed EVRPTW-FSL model by incorporating these factors into more realistic delivery settings. On the algorithmic side, combining reinforcement learning with metaheuristic methods may be a promising direction to further improve solution efficiency and adaptability under uncertainty.
Author Contributions
Conceptualization, X.D. and R.X.; methodology, X.D. and R.X.; software, X.D. and X.C.; validation, X.C. and R.X.; formal analysis, X.D. and R.X.; investigation, X.D. and X.C.; resources, R.X.; data curation, X.D. and X.C.; writing—original draft preparation, X.D. and X.C.; writing—review and editing, X.D. and R.X.; supervision, R.X.; funding acquisition, R.X. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Fundamental Research Funds for the Central Universities, grant number B250207085; the Philosophy and Social Science Fund of Education Department of Jiangsu Province, grant number 2024SJYB0054; and the Jiangsu Provincial Social Science Applied Research Excellent Project, grant number 25SYB-076.
Data Availability Statement
The data that support the findings of this study are openly available at https://github.com/Duanduan2001/EVRPTW-FSL (accessed on 9 August 2026).
Acknowledgments
The authors would like to acknowledge the support and inspiration provided by the Business Data Laboratory at the School of Business, Hohai University. The authors are grateful to the anonymous reviewers for greatly improving the quality of this paper.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Zhao, P.; Li, Z.; He, Z.; Chen, Y.; Xiao, Z. Reducing the road freight emissions through integrated strategy in the port cities. Nat. Commun. 2025, 16, 2563. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Basso, R.; Kulcsár, B.; Sanchez-Diaz, I.; Qu, X. Dynamic stochastic electric vehicle routing with safe reinforcement learning. Transp. Res. Part E Logist. Transp. Rev. 2022, 157, 102496. [Google Scholar]
- Jia, Y.H.; Mei, Y.; Zhang, M. Confidence-based ant colony optimization for capacitated electric vehicle routing problem with comparison of different encoding schemes. IEEE Trans. Evol. Comput. 2022, 26, 1394–1408. [Google Scholar] [CrossRef] [Scilit]
- Mara, S.T.W.; Sarker, R.; Essam, D.; Elsayed, S. Solving electric vehicle drone routing problem using memetic algorithm. Swarm Evol. Comput. 2023, 79, 101295. [Google Scholar] [CrossRef] [Scilit]
- Souza, A.L.; Papini, M.; Penna, P.H.; Souza, M.J. A flexible variable neighbourhood search algorithm for different variants of the electric vehicle routing problem. Comput. Oper. Res. 2024, 168, 106713. [Google Scholar] [CrossRef] [Scilit]
- Liu, X.; Pang, Q.; Yuen, K.F.; Wang, X. Transforming last-mile delivery into marketplaces of logistics services: An investigation on consumer participation motives, resources, and contextual differences. Bus. Res. 2025, 200, 115624. [Google Scholar]
- Fajardo-Calderin, J.; Masegosa, A.D.; Cantero, X.; Moreno, A.; Elejoste, P. Intelligent vehicle routing problem solver for simulating urban last-mile logistics. Eur. Transp. Res. Rev. 2026, 18, 22. [Google Scholar] [CrossRef] [Scilit]
- Lu, F.; Gao, Z.; Bi, H. Two-echelon vehicle routing problem with time windows and intermediate facilities for e-commerce logistics in crowdsourcing model. Systems 2026, 14, 382. [Google Scholar] [CrossRef] [Scilit]
- Dantzig, G.B.; Ramser, J.H. The truck dispatching problem. Manag. Sci. 1959, 6, 80–91. [Google Scholar]
- Toth, P.; Vigo, D. (Eds.) The Vehicle Routing Problem; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 2002; pp. 1–367. [Google Scholar]
- Braekers, K.; Ramaekers, K.; Van Nieuwenhuyse, I. The vehicle routing problem: State of the art classification and review. Comput. Ind. Eng. 2016, 99, 300–313. [Google Scholar] [CrossRef] [Scilit]
- Tan, S.Y.; Yeh, W.C. The vehicle routing problem: State-of-the-art classification and review. Appl. Sci. 2021, 11, 10295. [Google Scholar] [CrossRef] [Scilit]
- Shen, Y.D.; Peng, L.W.; Li, J.P. An improved estimation of distribution algorithm for multi-compartment electric vehicle routing problem. J. Syst. Eng. Electron. 2021, 32, 365–379. [Google Scholar]
- Tang, M.; Zhuang, W.; Li, B.; Liu, H.; Song, Z.; Yin, G. Energy-optimal routing for electric vehicles using deep reinforcement learning with transformer. Appl. Energy 2023, 350, 121711. [Google Scholar]
- Çatay, B.; Sadati, İ. A note on battery swapping policies in the electric vehicle routing problem with time windows and battery swapping vehicles. Comput. Oper. Res. 2025, 185, 107277. [Google Scholar]
- Preis, H.; Frank, S.; Nachtigall, K. Energy-Optimized Routing of Electric Vehicles in Urban Delivery Systems. In OperationsResearch Proceedings 2012. Operations Research Proceedings; Springer: Cham, Switzerland, 2014; pp. 583–588. Available online: https://link.springer.com/chapter/10.1007/978-3-319-00795-3_87 (accessed on 9 August 2026).
- Schneider, M.; Stenger, A.; Goeke, D. The electric vehicle-routing problem with time windows and recharging stations. Transp. Sci. 2014, 48, 500–520. [Google Scholar] [CrossRef] [Scilit]
- Keskin, M.; Çatay, B. Partial recharge strategies for the electric vehicle routing problem with time windows. Transp. Res. Part C Emerg. Technol. 2016, 65, 111–127. [Google Scholar] [CrossRef] [Scilit]
- Han, B.; Yan, Y.; Chi, T.; Park, Y. The electric vehicle routing problem with travel time and energy consumption uncertainty. Transp. Res. Part E Logist. Transp. Rev. 2025, 202, 104211. [Google Scholar] [CrossRef] [Scilit]
- Bányai, Á.; Kaczmar, I.; Bányai, T. Green Micromobility-Based Last-Mile Logistics from Small-Scale Urban Food Producers. Systems 2025, 13, 785. [Google Scholar] [CrossRef] [Scilit]
- Guo, S.; Ye, X.; Pei, S.; Yan, X.; Wang, T.; Chen, J.; Cheng, R. Charging Decision Optimization Strategy for Shared Autonomous Electric Vehicles Considering Multi-Objective Conflicts: An Integrated Solution Process Combining Multi-Agent Simulation Model and Genetic Algorithm. Systems 2025, 13, 921. [Google Scholar] [CrossRef] [Scilit]
- Davatgari, A.; Cokyasar, T.; Subramanyam, A.; Larson, J.; Mohammadian, A.K. Electric vehicle supply equipment location and capacity allocation for fixed-route networks. Eur. J. Oper. Res. 2024, 317, 953–966. [Google Scholar] [CrossRef] [Scilit]
- Von Boventer, E. The relationship between transportation costs and location rent in transportation problems. J. Reg. Sci. 1961, 3, 27–40. [Google Scholar] [CrossRef] [Scilit]
- Maranzana, F.E. On the location of supply points to minimize transport costs. J. Oper. Res. Soc. 1964, 15, 261–270. [Google Scholar] [CrossRef] [Scilit]
- Webb, M.H.J. Cost functions in the location of depots for multiple-delivery journeys. J. Oper. Res. Soc. 1968, 19, 311–320. [Google Scholar] [CrossRef] [Scilit]
- Cavagnini, R.; Santini, A.; Schneider, M. Recent developments in location-routing problems: Deterministic, single-echelon, single-objective, single-period problems. Eur. J. Oper. Res. 2026, 332, 711–729. [Google Scholar]
- Janinhoff, L.; Klein, R.; Sailer, D.; Schoppa, J.M. Out-of-home delivery in last-mile logistics: A review. Comput. Oper. Res. 2024, 168, 106686. [Google Scholar] [CrossRef] [Scilit]
- Dumez, D.; Lehuédé, F.; Péton, O. A large neighborhood search approach to the vehicle routing problem with delivery options. Transp. Res. Part B Methodol. 2021, 144, 103–132. [Google Scholar] [CrossRef] [Scilit]
- Yang, K.; Zhang, Z.; Zhao, J.; Liang, Z. A neighborhood-based matheuristic for the vehicle routing problem with delivery options. Transp. Res. Part E Logist. Transp. Rev. 2025, 203, 104366. [Google Scholar] [CrossRef] [Scilit]
- Hu, X.; Xiang, K.; Wang, K. The workforce scheduling and routing problem with sequence constraints and alternative locations. Comput. Ind. Eng. 2025, 209, 111487. [Google Scholar] [CrossRef] [Scilit]
- Frey, C.M.; Jungwirth, A.; Frey, M.; Kolisch, R. The vehicle routing problem with time windows and flexible delivery locations. Eur. J. Oper. Res. 2023, 308, 1142–1159. [Google Scholar] [CrossRef] [Scilit]
- Zhang, X.; Dai, X.; Lou, P.; Hu, J. A multi-strategy ALNS for the VRP with flexible time windows and delivery locations. Appl. Sci. 2025, 15, 4995. [Google Scholar] [CrossRef] [Scilit]
- Zang, X.; Jiang, L.; Liang, C.; Fang, X. Coordinated home and locker deliveries: An exact approach for the urban delivery problem with conflicting time windows. Transp. Res. Part E Logist. Transp. Rev. 2023, 177, 103228. [Google Scholar] [CrossRef] [Scilit]
- Ropke, S.; Pisinger, D. An adaptive large neighborhood search heuristic for the pickup and delivery problem with time windows. Transp. Sci. 2006, 40, 455–472. [Google Scholar] [CrossRef] [Scilit]
- Fonseca, G.H.; Figueiroa, G.B.; Toffolo, T.A. A fix-and-optimize heuristic for the unrelated parallel machine scheduling problem. Comput. Oper. Res. 2024, 163, 106504. [Google Scholar] [CrossRef] [Scilit]
- Wang, C.; Qin, F.; Xiang, X.; Jiang, H.; Zhang, X. A Dual-Population-Based Co-Evolutionary Algorithm for Capacitated Electric Vehicle Routing Problems. IEEE Trans. Transp. Electrif. 2024, 10, 2663–2676. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.









