1. Introduction
The volume of e-commerce deliveries has witnessed significant growth in recent years, reaching a staggering USD 5.2 trillion in digital platform product sales during 2021. It is projected to surge by 56% in the coming years, reaching approximately USD 8.1 trillion by 2026 [
1]. This substantial upswing not only reshapes the dynamics of commerce by shifting the delivery profile from a scenario of few customers with large volumes to many customers demanding small packages, but also poses intricate challenges on logistics, particularly in the efficient delivery of goods, especially within major urban centers, where there is heavy traffic and various limitations that reduce delivery efficiency. This, along with the increase in express orders, deliveries outside regular business hours, and the demand for rapid services underscore the need for an innovative logistics approach [
2,
3].
A potential solution to these challenges involves the utilization of small Urban Transshipment Points (UTPs) or Urban Distribution Satellites for the two-echelon capacitated vehicles routing problem (2E-CVRP). This strategy is essential for effectively managing the final delivery stage, often referred to as the last mile, and requires swift and strategic responses to optimize routes, reduce costs, and address complex urban variables. The concept of the 2E-CVRP involves dividing the final product delivery process in large urban centers into two levels, utilizing intermediate facilities (satellites) and different types of vehicles in the process [
4]. The core concept is to use larger freight vehicles to consolidate large quantities of packages and transport them efficiently from the distribution center to the satellite, which is then responsible for completing the final delivery to customers using smaller urban vehicles, further streamlining the process [
5].
Despite its benefits, the 2E-CVRP is an NP-hard problem and presents significant computational complexity, making efficient problem-solving a challenge [
6]. This challenge is amplified when it must be implemented in systems that require quick responses, such as interactive Decision Support Systems (DSS), which are very useful for enhancing operations and providing training for logistics professionals and students to sharpen their intuition and improve their critical senses [
7]. This is because interactive DSS must offer quick, efficient, and reliable responses [
8]. However, achieving this requires the use of rapid and acceptable approximation techniques, with defined limits for compute time and solution quality [
9]. For truly interactive decision support, computation times of less than a minute for group settings and less than 30 s for individual user settings are a typical minimum requirement, while real-time response is preferred [
10].
Consequently, this study focuses on developing a heuristic designed to address the two-echelon capacitated vehicle routing problem (2E-CVRP). The specific aim is to integrate it into decision support systems for teaching and training logistics professionals in e-commerce and students. The proposed heuristic relies on local search operators, emphasizing the fundamental principles of this approach. Criteria for evaluating the heuristic center on operational efficiency, measured by resolution speed, while maintaining high-quality solutions.
Performance analysis of the heuristic involves benchmarks, including instances recognized in the literature as references. The evaluation extends to the practical application of the heuristic in solving real-world problems, utilizing data from a significant e-commerce retailer in Brazil. Thus, this work not only advances the approach to 2E-CVRP through the development of an effective heuristic, but also contributes to e-commerce logistics education, promoting operational efficiency without compromising solution quality.
2. Literature Review
This section aims to provide a description of the two-echelon capacitated vehicle routing problem (2E-CVRP) and highlight the primary resolution strategies designed for effective convergence to a solution while maintaining favorable values relative to the optimum. The mathematical model defining the problem consists of a directed graph, denoted as
, with vertices encompassing the central depot, customers, and satellites. The arcs connect the depot to satellites and satellites to customers, as outlined in the formal description provided in
Figure 1 [
11].
In this formal representation, products initially located at the central depot are transported by a fleet of homogeneous freight vehicles to the satellites. The satellites, in turn, execute the final delivery of the products to customers with heterogeneous demand, utilizing a fleet of smaller homogeneous vehicles. The vehicles in the first echelon (FE) and second echelon (SE) possess transport capacities denoted as and , with a specific number of trips, represented as , that the set of vehicles at each satellite can undertake. Additionally, within the problem, customers exhibit heterogeneity, each having their individual demand, denoted as , which must be entirely serviced by the same vehicle.
Other categories of strategies, discussed below, include local search heuristics, constructive heuristics, and genetic algorithms. However, similarly to exact algorithms, it is noted that many of them tend to take a long time to reach their final results, sometimes extending to hours, making them unfeasible for use in interactive DSS.
For the 2E-CVRP and its variants, the predominantly employed solution strategies revolve around exact branch-and-cut algorithms [
12,
13] and decomposition methods [
14]. These approaches successfully tackle problems involving up to 5 satellites and 50 customers for the first group, and 15 satellites with 300 customers for the second group, with an average computational time of one hour.
The use of Genetic Algorithms (GAs) in the context of 2E-CVRP involves research that models the chromosome in various ways. The main approach is to use chromosomes that represent a complete solution to the problem [
15], with each gene representing a route from the first (FE) or second (SE) echelon. Another approach considers a complete solution as an individual composed of several chromosomes [
16], where each chromosome symbolizes a route, and its genes correspond to the nodes of the problem. An extra chromosome is introduced to establish connections between the chromosomes of the FE and SE.
In addition, various constructive heuristics are used to build the initial population of a GA [
17,
18], and the process of selecting individuals for reproduction includes techniques such as Random Selection, Tournaments, Roulette, and Best Fitness.
After selection, the process of exchanging chromosome code is done based on the following operators: the order-based operator [
19,
20], the route copy operator [
15,
18], the cycle crossover operator also [
19], the Partially Mapped Crossover (PMX) operator [
21], and an operator specific to the 2E-CVRP problem developed by Zhou et al. [
16]. The authors use a criterion for stopping based on a limit of iterations without improvements.
Many of the heuristics for the 2E-CVRP commonly share the strategy of generating an initial solution with constructive heuristics by dividing the problem into two separate subproblems, one for the SE and one for the FE, and first solving the VRP related to the SE. Furthermore, constructive heuristics are exclusively employed in generating the initial solution, followed by a second improvement phase due to their rapid computational time. Two approaches to the routing problem of the SE are described by Crainic [
4]. In the first, customers are assigned to the nearest satellites, solving independent CVRP problems. In the second, a multi-depot CVRP is solved. In both cases, the cumulative demand at the satellites is considered to solve the first echelon as a classical VRP. The results obtained were compared with test instances, achieving gaps from 0 to 7% in relation to the optimum. In turn, Crainic et al. [
22] proposes Multi-Start heuristics based on the separation of depot-to-satellite transfer and satellite-to-customer delivery, using clusters and local search to calculate routes.
However, there are other methods that rely on heuristics, such as the nearest neighbor [
23], cheapest insertion [
24], Clarke and Wright savings heuristic [
25], and random insertion [
20]. All of them start with an assignment of customers to satellites and then proceed with the routing of the second echelon. The cheapest insertion method stands out, given the customers assigned to a satellite, as it can fit the customers in the best possible position on a route, achieving good results in fractions of a second, even for large problems [
24].
After solving the routing problem related to the second level, the calculation of each satellite’s demand is carried out. This is done based on the total demand of the customers who were served by all the SE routes that departed from that specific satellite. Then, the FE routes are constructed. Due to the relatively small number of depots and satellites, many methods use exact approaches to solve the FE routing problem [
6,
26,
27,
28]. However, the most common procedure for calculating the FE is that of Breunig [
29] which, in situations where satellites have a demand that exceeds the capacity of a single FE vehicle, proposes a preprocessing process. The process involves serving any satellite with demand exceeding the capacity of the FE vehicle through direct round trips from the nearest depot until the remaining demand is less than the capacity of the FE vehicle. After this step, a cheapest insertion heuristic is applied with the aim of constructing FE routes to meet the remaining demand from the satellites. It is important to note that this strategy was developed specifically for this situation to ensure the efficiency of the routing process.
Other approaches include local search heuristics, used to explore the neighborhood of a promising solution. They start from a solution and evaluate neighboring solutions obtained with some perturbation operator, such as relocating a customer to a different position within the route or even to a different route.
The best neighbor solution can be obtained with a first-best solution policy, as in the works of Amarouche et al. [
26], which leads to faster convergence to a final solution. However, it can also be guided by better improvement policies, where the entire neighborhood is computed, and the best-performing solution is selected as the next candidate solution, as in the works of Belgin [
23] and Liu [
24], even though it requires more computational time from the algorithm.
The main operators used to perturb solutions are relocation, exchange, 2-opt, 2-opt*, satellite change, and satellite swap. The relocation and exchange operators are employed to relocate a sequence of
m customers within the route, and to exchange the positions of two customers [
26], including both individual customers and groups of up to three customers [
4,
20,
30,
31].
The 2-opt and 2-opt* operators are intra-route and inter-route operators, respectively, involving two pairs of customers. In the case of 2-opt, it includes the reversal of the service sequence between two respective customers or the substitution of one customer for another between customers of two different routes. As for 2-opt*, these operators are applied only to the routes of the second echelon [
27,
28,
32]. However, they are also applicable to the routes of the first echelon of the problem [
24,
33]. For example, in the case of 2-opt*, changes in the demand allocated to the satellites occur, requiring adjustments in the first echelon as well.
To avoid changes in demand at the satellites, Hemmelmayr et al. [
25] used the strategy of only applying operators to routes of the second echelon that originate from the same satellite, avoiding the need for recalculation of the first echelon. Another strategy is to evaluate only changes between customers limited to the m closest, thus limiting the number of iterations in their heuristics [
16,
29,
34].
The satellite swap and satellite change operators, as defined to assess whether changing the satellite serving a route for another or exchanging the serving satellites of two distinct routes could yield better solutions [
23,
32,
35]. However, it is noticeable that such changes require recalculation of the first echelon, and the methods of constructive heuristics for generating the initial solution of the FE are applied for this purpose.
Other local search procedures applied to the 2E-VRP include the reassignment of customers to their second nearest satellite [
22], a Lin–Kernighan local search procedure devised by [
18], a split procedure [
25], and movements related to delivery options [
16].
5. Case Study
The company studied in this work is a highly relevant e-commerce retailer in the industry, covering the entire Latin American region. The sample used in this study consists of data from one day of deliveries in the city of São Paulo, Brazil. A total of 1.2 thousand shipments delivered throughout the city of São Paulo were analyzed, and specific regions were selected for the evaluation of the heuristic. In the problem, the objective is to minimize travel costs, which include costs per hour of travel and per kilometer traveled.
All distance and time information between points were calculated using the OpenStreetMap API, and data for the vehicles used, which consist of electric bicycles, used as parameters for the model, were estimated based on the work of Gonzalez-Calderon [
36], technical specifications from the manufacturers of the vehicles, company data, and the freight table from the TRC Guide [
37]. The data include the capacity of the bicycles, which is 15 packages given the delivery profile in the regions, a cost of 0.35 per kilometer (km) traveled, and a cost of 29.25 per working hour, in Brazilian real, to be used in the second echelon. For the first echelon, a truck with a capacity of 450 packages is used, with a cost of BRL 1.89 per kilometer (km) traveled and a cost of BRL 81.69 per working hour.
The evaluated regions were the neighborhoods of Mooca, Pinheiros, República, and Tucuruví, as they are some of the main extremes of the city, with Pinheiros being slightly closer to the distribution center than the others; Tucuruví, with slightly lower demand than normal; República, with one of the highest daily demands; and Mooca, a region with extremely high demand and irregular terrain, with few flat areas.
Figure 2 contains images of the four regions, with customers marked with blue drops and satellites in red, green, and brown drops.
The model proposed by Jepsen [
11] served as the basis for calculating an optimal solution for the evaluated instances, setting a time limit of 1 h. Additionally, to meet the company’s objective, the objective function of the problem was altered, disregarding inventory maintenance cost parameters and calculating the total cost between arcs i and j. This was given by the sum of the products between the respective travel times and distances with their associated costs.
Table 3 contains the results of the case study. It can be observed that the computational time is very low, close to real-time, and the gaps, with an average of 8.3%, are around the values evaluated with instances from the literature. Thus, there is evidence that the proposed heuristic is effective for use in decision support systems for teaching and training logistics professionals and students, as it is sufficiently fast and produces a gap sufficiently close to the optimum.
6. Conclusions
This study aimed to develop a heuristic for use in decision support systems focused on education and training. The heuristic is focused on solving the two-echelon vehicle routing problem (2E-CVRP), using urban distribution satellites, highlighting them as an efficient alternative to optimize Last Mile efficiency.
A heuristic developed in this work showed promising results in solving the 2E-CVRP, with an average gap of 6.3% and average execution times of 1.06 s in theoretical instances, and an average gap of 8.3% and 1.46 s in real-world problems. These results were obtained through an approach that combines a constructive heuristic, responsible for generating initial solutions, and a local search heuristic focused on improving these solutions with exchange operators. Performance analysis covered numerical experiments with instances from the literature, as well as a case study with real data from an e-commerce retailer in Latin America.
The results indicate that the proposed heuristic is effective for use in decision support systems, providing solutions with gaps close to the optimum in computational times that meet the time constraints required by training and teaching systems (30 s or less). Furthermore, the practical application of the heuristic in a real delivery scenario demonstrated its operational viability and ability to handle the specific demands of the Last Mile.
Although the results are promising, it is important to highlight the identification of opportunities for improvement, especially considering the identification of a gap close to 20% in certain instances. This acknowledgment suggests the ongoing need for optimization and refinement of the heuristic, aiming to achieve even smaller gaps and thereby enhance the quality of the obtained solutions.
In summary, this study contributes not only to the approach of the 2E-CVRP problem, but also provides the algorithmic core of a tool for the training of professionals and students in the e-commerce logistics field. The development of effective heuristics, capable of reconciling computational speed and solution quality, plays a crucial role in adapting logistics operations to the dynamic demands of e-commerce, especially in the challenging context of the Last Mile.