Towards greener city logistics: an application of agile routing algorithms to optimize the distribution of micro-hubs in Barcelona

The COVID‑19 pandemic accelerated the shift towards online shopping, reshaping consumer habits and intensify‑ ing the impact on urban freight distribution. This disruption exacerbated traffic congestion and parking shortages in cities, underscoring the need for sustainable distribution models. The European Union’s common transport policy advocates for innovative UFD approaches that promote intermodal transportation, reduce traffic, and optimize cargo loads. Our study addresses these challenges by proposing an agile routing algorithm for an alternative UFD model in Barcelona. This model suggests strategically located micro‑hubs selected from a set of railway facilities, markets, shopping centers, district buildings, pickup points, post offices, and parking lots (1057 points in total). It also promotes intermodality through cargo bikes and electric vans. The study has two main objectives: (i) to identify a network of intermodal micro‑hubs for the efficient delivery of parcels in Barcelona and (ii) to develop an agile routing algo‑ rithm to optimize their location. The algorithm generates adaptive distribution plans considering micro‑hub operat‑ ing costs and vehicle routing costs, and using heuristic and machine learning methods enhanced by parallelization techniques. It swiftly produces high‑quality routing plans based on transportation infrastructure, transportation modes, and delivery locations. The algorithm adapts dynamically and employs multi‑objective techniques to establish the Pareto frontier for each plan. Real‑world testing in Barcelona, using actual data has shown promising results, pro‑ viding potential scenarios to reduce CO 2 emissions and improve delivery times. As such, this research offers an inno‑ vative and sustainable approach to UFD, that will contribute significantly to a greener future for cities.


Introduction
The rise of e-commerce, with businesses increasing their digital presence [1], has placed growing pressure on the logistics industry to improve the efficiency of urban delivery and reduce negative externalities such as congestion and carbon emissions [2][3][4].Urban freight distribution (UFD), already a vital component of city logistics before the pandemic, has become even more critical in the new post-pandemic landscape [5,6].The surge in demand for home deliveries and the imperative to move goods swiftly and efficiently have spurred the search for innovative UFD solutions [7,8].
In this context, micro-hubs emerge as a promising alternative to the current UFD model [9,10].They fit seamlessly with the sustainable distribution models promoted by public administrations [7,11] and the common transport policy of the European Union (EU).These micro consolidation centers have the potential to minimize travel distances and optimize the relationship between actual cargo and total vehicle capacity [12][13][14], thereby helping to reduce congestion and environmental impact.Furthermore, they enable transshipment to more sustainable modes of transportation, such as cargo bikes and electric vans [15], further strengthening their role in the search for more sustainable city logistics that rely less on internal combustion vehicles [16].
The problem with implementing micro-hubs, however, is that they alter the value chain and market presence of current logistics operators.Governments and administrations therefore have a crucial role to play in achieving sustainable UFD, in particular in enacting legislation, defining urban planning regulations, and establishing public procurement practices [17].Urban policies within the logistics system are of paramount importance as they hold the key to sustainability [18].However, the challenges of limited space and time in urban areas, combined with low operational margins, hinder the implementation of such policies [19].Innovation in the physical concreteness of the distribution model is thus essential to ensure that UFD is greener and has a positive impact on society, the economy, and the environment [20].
In this context, our study proposes a new model with various strategically located infrastructures that are designed to function as micro-hubs, combining public and private facilities to make better use of underutilized space.These include railway facilities (train stations, subway stations, and narrow-gauge rail stations), markets, shopping centers, district buildings, pickup points, post offices, and parking lots for e-commerce distribution (a total of 1057 points).These locations are leveraged innovatively to distribute e-commerce parcels, promoting intermodality by encouraging transshipment to sustainable vehicles such as cargo bikes and electric vans.Consequently, the study has two main objectives: (i) to identify a potential network of micro-hubs that enables efficient parcel delivery throughout the city of Barcelona while promoting intermodal UFD, and (ii) to develop an agile routing algorithm capable of generating adaptive distribution plans for dynamic environments.These plans should take into account multiple optimization targets, including operational and routing costs.
To improve the distribution of goods across our network, we solved a Location Routing Problem (LRP) using an Iterated Local Search (ILS) strategy.LRP is helpful in deciding where to place facilities and how to plan delivery routes together, which is important because these two tasks are tightly linked.Indeed, studies have shown that it is not effective to treat these tasks separately [21][22][23].Thanks to improved computing power, LRP research has expanded considerably to include many different approaches [24].LRP deals with both the big picture, such as Facility Location Problems (FLP), and day-today decisions, such as designing delivery routes by solving Vehicle Routing Problems (VRP) [25].It also looks at making deliveries more efficient in other ways, such as minimizing total route length.In other words, LRP involves making decisions about the location of facilities and designing routes in a way that meets customer needs and addresses a wide range of logistical challenges [26,27].
Our findings demonstrate the feasibility of implementing a sustainable last-mile UFD system in cities using existing infrastructure as potential micro-hubs, including public locations such as parking lots and train stations, but also private facilities.The results show that out of a possible network of 1057 potential micro-hubs and 1000 randomly generated delivery points, only 61 micro-hubs would be needed for a high-demand scenario.This constitutes only 5.8% of the total capacity.The implementation of the proposed distribution network, combined with the use of sustainable vehicles, would reduce the number of kilometers traveled, CO 2 emissions, and delivery times.As such, this study represents a step forward in overcoming the challenges of UFD in the post-pandemic era and is in line with public endeavors to achieve a more sustainable and efficient system.
This study is of significant importance, particularly for its innovative, comprehensive and multidimensional approach to UFD sustainability.The notability of our research lies in the integration of sustainability concepts into a single LRP, effectively hybridizing two distinct algorithms into a new, unified solution tailored to practical cases in last-mile distribution.This groundbreaking integration marks a considerable advancement in the application of logistics algorithms to real-world problems.It offers a holistic solution that encompasses both routing and facility location within a single framework.This innovative approach is not only relevant to the current challenges in Barcelona, but also has the potential to serve as a replicable model for other urban areas facing similar concerns.The adaptability and applicability of this solution to different urban contexts highlight its essential role in global efforts to enhance sustainability and efficiency in city logistics.This study makes a significant contribution to the literature by filling this research gap, and positions itself as a pioneering effort in the integration of complex logistics algorithms for the improvement of UFD systems worldwide.
The paper is structured as follows: Sect. 2 provides a literature review.Section 3 describes the data and methods used to carry out the study.Section 4 presents the main findings of the research, followed by a discussion in Sect. 5. Finally, Sect.6 outlines our conclusions.

The need for a new model for greener urban freight distribution
The exponential growth of the urban population and the associated expansion of e-commerce have significantly increased the demand for UFD, posing major challenges in terms of congestion, greenhouse gas emissions, and noise pollution.In 2017, around 55% of the world's population lived in cities, a figure that is expected to rise to 68% by 2050 [28].This surge in urbanization has led to significant congestion across all transportation modes, particularly in UFD, exacerbating environmental and social problems [29][30][31].
Although UFD represents only 10-20% of vehicle traffic, it contributes disproportionately to urban congestion, especially in areas with limited road infrastructure [32,33].This issue is further aggravated by non-stop loading and unloading on active roads, which not only disrupts traffic flow, but also contributes to increased greenhouse gas emissions and noise pollution, factors that account for approximately 25% and 30-50% of transportation-related emissions, respectively [34].
Considering these challenges, micro urban consolidation centers emerge as a potential solution to mitigate the negative externalities associated with UFD.These microhubs, located throughout a city's urban area, can facilitate transshipment to low-volume, low-emission vehicles, such as electric cargo bikes and electric vans, for last-mile delivery [35].This would not only reduce the presence of diesel trucks delivering in residential areas (minimizing pollution, congestion, and traffic accidents), but it could also provide fast, low-cost distribution in dense urban environments, especially for lightweight and time-sensitive services such as inner-city courier delivery [36,37].
However, these innovations face limitations, particularly in terms of effective integration into conventional UFD practices, which are generally divided into one-tier and two-tier systems designed for small to medium-sized cities and large metropolitan areas, respectively [38].The passive transformation of the UFD system, brought about by innovations such as the movement of goods on public transportation, may point to a shift towards multi-tier systems involving additional challenges such as land use conflicts and changes in the type of stakeholders involved [39].

Introducing multi-echelon UFD systems for freight consolidation and transshipment
The implementation of multi-echelon logistics systems is an effective strategy for addressing UFD challenges in densely populated areas.The most common model is the two-echelon logistics delivery and pickup network (2E-LDPN).This model involves: (i) transporting goods from regional warehouses or logistics platforms to intermediate delivery and pickup centers, such as micro-hubs, and (ii) distributing from these centers to end customers using smaller, cleaner vehicles.The first step in this approach reduces reliance on diesel trucks and vans to deliver parcels to end customers, thereby lowering emissions, congestion, and traffic accidents [40].The second step enables more efficient and environmentally friendly last-mile deliveries with smaller, better adapted vehicles, meeting urban consumers' demands for fast and sustainable services [41].The use of electric vehicles and cargo bikes in this second echelon reduces emissions and fits in with urban policies aimed at mitigating current externalities.These vehicles are well suited to the shorter routes and frequent stops of last-mile deliveries [42].Micro-hubs serve as nodes for deconsolidating, sorting, and consolidating goods arriving from outside the city for transshipment to greener, more flexible means of transportation for last-mile delivery [36,43].This increased flexibility also allows cargo capacity to be optimized by better matching the total number of vehicles in use.However, the implementation of micro-hubs also poses some challenges.First, it is difficult to identify suitable locations that balance efficiency with minimal urban disruption.Finding enough suitable sites in dense urban areas without exacerbating land-use conflicts is indeed a challenge.Second, the transition from traditional UFD systems to micro-hubs models requires careful planning and complex logistics management, as any new innovation can significantly impact the urban transportation network [44].
The optimal selection of micro-hubs is essential for planning last-mile UFD.This process is usually carried out in two stages: an initial analysis of several urban indicators followed by a technical evaluation.[45] argue that two-tier distribution designs with micro-hubs offer socio-economic advantages compared to direct delivery.[6] describe a two-step method for selecting micro-hubs.The first step, based on the Delphi analysis, involves defining relevant criteria for selecting candidate sites through information gathering, analysis, and feedback.These criteria are then applied to the candidate sites using the Data Envelopment Analysis method for technical efficiency [46].This approach ensures that the criteria are evaluated in a consistent and systematic manner, facilitating informed technical decision-making.
Conversely, authors such as [47] and [48] underline the challenges of finding optimal locations for micro-hubs.Previous studies highlight the importance of integrating these models into existing urban infrastructure to minimize disruption and maximize efficiency.For instance, [21,26] emphasize the need for robust planning tools to deal with the complexities of two-echelon logistics systems, including variability in customer demand and traffic conditions.Additionally, cooperative strategies among logistics providers can mitigate some challenges by enabling the sharing of micro-hubs.This increases the efficiency of city logistics networks and reduces costs by optimizing resource utilization and ensuring fair profit distribution among stakeholders [49].

Optimizing micro-hub location and route design
A number of complex issues surround last-mile UFD, including FLP, VRP and a combination of the two: LRP.These problems have many variants, including constraints such as time windows, vehicle fleet, and vehicle capacity.Solving these problems often requires advanced mathematical developments, especially when it comes to finding exact solutions, but alternative solutions can be inferred iteratively using heuristic and metaheuristic techniques.
Research on micro-hub siting in last-mile UFD is evolving towards more integrated and sustainable approaches.Studies such as [50], on green VRP with time windows, and [51], on time-dependent green VRP with stochastic speed, highlight the importance of considering environmental factors in route planning.The integration of sustainability goals in FLP reflects a more holistic approach to logistics optimization, in line with public policies and emission reduction strategies.In the field of heuristic methods, the combination of techniques such as Variable Neighborhood Search (VNS) and Tabu Search (TS) has proven effective.For instance, [52] applies these techniques to solve a VRP with recharging and delivery time windows, achieving significant improvements in solution quality.
The integration of FLP and VRP into a single model has gained popularity. [23] and [53] note that treating these problems together leads to more optimal solutions.Some examples follow.[54] propose a hybrid genetic algorithm for the multi-depot vehicle routing problem (MDVRP) in a time-varying road network.This approach optimizes total costs, including fixed vehicle costs, penalties for out-of-hours deliveries, fuel costs, and the influence of vehicle speed, which is affected by load and road gradient.[55] propose a tabu-search-based heuristic approach for the uncapacitated single allocation hub covering problem (USAHCP) to determine optimal hub locations, establish hub links, and allocate non-hub nodes to hubs in Turkey.In [56], a VRP is developed for the simultaneous distribution and collection of packages over several days with generalized consistency requirements, aiming at consistent arrival times, driver consistency, and route consistency.In this regard, [24] define LRP as facility location planning with simultaneous consideration of vehicle route design.This approach has been reinforced by studies such as [21,26], which document the continuous growth of research in this area.
In terms of exact methods, [57] develop a logistics cost function that includes setup, processing, inventory, and transportation costs to determine the optimal number of warehouses and routing zones.[58] present a case study where a retailer chooses the optimal locations for hubs to fulfill online orders and replenish stores using a mixed-integer problem (MIP) in a solver.[59] suggest a two-stage stochastic programming formulation for the 2E-VRP with stochastic demand, focusing on urban vehicle service network design and routing of second fleet vehicles with possible recourse strategies.[60] develop an exact method based on a set partitioning formulation, using route generation procedures and variable reduction by branch-and-cut algorithms.[61] propose an exact algorithm for MDVRP under capacity and route length constraints using vehicle flow and set partitioning formulations.
Various heuristic and metaheuristic methods have also been proposed for MDVRP.[62] present a heuristic approach by combining [63] and [64], aiming to minimize total travel time between service hubs and demand points.[65] use genetic algorithms to solve the uncapacitated hub covering problem, aiming to minimize total costs while covering all nodes within a certain radius.
[66] also develop hybrid genetic algorithms incorporating the Clarke-Wright Savings (CWS) method [67], the nearest neighbor heuristic, and the iterated swap procedure.[68] propose a parallel ant colony optimization for MDVRP.In [69], population-based evolutionary search, neighborhood-based metaheuristics, and advanced population diversity management are combined to solve the periodic MDVRP.Finally, [70] propose methods for minimizing the expected cost of recourse actions in stochastic VRPs, demonstrating the effectiveness of combining various heuristic strategies to address the complexities of last-mile delivery.
Building on this body of work, our study presents a proposal for siting potential micro-hubs in the city of Barcelona, combining public, private, and mixed infrastructures as a potential solution to the complexities associated with the growth of UFD.In light of the findings of [71], which confirm operational inefficiencies in UFD due to divergent interests and conflicting solutions among stakeholders, it becomes clear that addressing these challenges requires a concerted effort between private companies and public authorities.The research by [71] underscores the importance of communication and cooperation between local authorities and stakeholders, and advocates for the role of a skilled spokesperson to manage UFD operations effectively.This is very much in line with our approach, highlighting the need for a public-private collaborative framework to optimize the location of micro-hubs.By prioritizing the harmonization of restrictions and considering sector-specific conditions, our study aims to overcome the misalignment and limited cooperation between stakeholders.

Data and methods
This section describes our data collection and analysis methods.

Data collection
The database used for our research, which contained the location of potential micro-hubs for e-commerce parcel delivery, was obtained from public repositories, including [72] and [73].We selected a total of 1057 potential micro-hubs and then generated 1000 random points across the city, using real postal codes, to simulate the delivery of e-commerce parcels from these micro-hubs.Table 1 shows the number of facilities available to locate micro-hubs within the delivery network based on their category, and Fig. 1 provides a visual representation of their locations.
To estimate the required capacity for each micro-hub, we sought the advice of last-mile logistics operators in the province of Barcelona.Based on their expertise, we determined that the micro-hubs in our distribution network should have a minimum surface area of 50 m 2 , which would equate to a capacity of 1500 parcels.Again drawing on the operators' experience, we considered the daily operating costs, which include expenses such as staff, infrastructure, and technological equipment.Finally, we estimated a vehicle capacity of 300 parcels, a figure derived from both the operators' experience and examples from other studies [74,75].It is worth noting that our model is scalable and therefore customizable in terms of these initial values.In other words, the facility capacity, operating costs, and vehicle capacity can be adjusted as needed.

Problem definition
This problem can be represented by an LRP framework, which involves making three simultaneous decisions: (i) identifying the locations of micro-hubs (e.g., hubs or depots), (ii) assigning customers to these micro-hubs, and (iii) planning the routes for vehicles to serve the needs of the assigned customers by departing from and returning to each micro-hub.The LRP can be mathematically modeled on a graph G = (V, A), where the set V = I ∪ J contains different types of nodes: (i) a finite set of customers I, each with a demand d i > 0(∀ i ∈ I) , and (ii) a finite set of potential hub locations J, where D j > 0 is the capacity of hub j ∀j ∈ J and O j ≥ 0 is the cost of opening that hub.A is the set of arcs linking each pair of nodes, and for each a ∈ A , C a is the cost of traversing that arc.A set K of homogeneous vehicles is available, each with a capacity Q > 0. It is also assumed that there is a fixed cost, VF, per vehicle (route) used.Let S be a subset of nodes, and δ + (S) and δ − (S) the set of arcs leaving and entering S, respec- tively.Finally, let L(S) be the set of arcs with both ends in S. As indicated in [76], the LRP can be formulated as follows, where Y j refers to whether or not hub j is opened, X ij defines whether or not customer i is assigned to hub j, and f ak indicates whether or not arc a is traversed by vehicle k: Subject to: (1) The objective function (1) aims to minimize the total costs, including operating costs, routing costs, and the fixed costs associated with vehicle usage.Constraints (2) ensure that each customer is visited exactly once.Vehicle capacity constraints are represented by (3).Constraints (4) and ( 5) ensure the continuity of each route and that all vehicles return to their origin.Sub-tour elimination constraints are represented by inequalities (6).Expressions (7) guarantee that a customer is only assigned to an open hub.Constraints (8) specify that hub capacity must not be exceeded.Finally, expressions (9) define the domain of the decision variables.

Problem resolution
In order to tackle the LRP, we propose a multi-start algorithm that leverages concepts previously developed to address VRPs [77] and FLPs [78] separately.Our proposed approach seeks to amalgamate these algorithms into a new, hybrid solution to the LRP.The algorithm is designed to minimize the total daily costs, including the operational costs of maintaining the facilities and the costs associated with daily deliveries.We chose a multi-start algorithm because it is an iterative method belonging to the class of nondeterministic or stochastic methods that rely on biased (non-uniform and non-symmetric) random sampling.Therefore, different runs of the algorithm will yield different good solutions, depending on which points are randomly sampled.These algorithms are efficient and can operate with a reduced number of parameters, minimizing the need for time-consuming fine-tuning processes, providing an optimal balance between efficiency and simplicity, as highlighted in [79].Accordingly, the initial phase of the algorithm consists of generating a pool of promising initial solutions.The subsequent phase then focuses on intensification strategies to refine these solutions, using them as a foundation for further improvement.
As outlined in Fig. 2, the first phase of our approach was to generate feasible and promising solutions for the LRP.In order to generate each of these solutions, our heuristic method starts by determining the minimum and maximum number of micro-hubs to be opened, (7) a∈δ + (j)∩δ − (I) taking into account the demand constraints to guarantee the fulfillment of the total daily demand.Additionally, the objective function considered in this research includes both the cost of operating the opened facilities and the cost of the journeys required to complete all deliveries.This comprehensive approach ensures that our optimization not only addresses the logistical efficiency of the distribution network, but also incorporates economic considerations, thus providing a holistic solution to the challenges of UFD.The minimum number of micro-hubs required is calculated by dividing the total daily demand by the maximum hub capacity value, while the maximum number of micro-hubs is determined by dividing the total daily demand by the lowest micro-hub capacity value.The heuristic then uses a uniform random distribution spanning the range between these two values to select combinations of micro-hubs that satisfy the total demand requirement.At this point, we have a set of feasible location decisions (candidate micro-hubs), while adhering to constraints related to micro-hub capacity and daily demand satisfaction.The proposed heuristic then proceeds to assign customers to the candidate hubs.To achieve this, it uses the approach introduced by [80], which relies on the marginal-savings criterion.In essence, this criterion calculates the savings associated with assigning a customer, denoted 'i' , to an open facility 'j' , compared to the best alternative facility 'j*' for that customer.This procedure generates a set of submaps, each consisting of a micro-hub and a subset of customers.The final step in achieving a complete LRP solution is to design delivery routes to serve all customers.Multiple routes can be designed for each submap of the solution, depending on vehicle capacity considerations.Various heuristics from the literature can be used to optimize the route design process.
We chose the CWS heuristic proposed by [67] for its speed and ability to produce high-quality results, and used it to generate an initial routing plan.To diversify the search and evaluate different routing plans, we integrated a randomized version of the CWS heuristic into a multi-start framework.This framework is an optimization metaheuristic that repeatedly initiates a problem-solving algorithm from several different initial solutions, aiming to find the best possible solution by exploring various starting points.Randomized heuristics enable us to transform a deterministic heuristic into a probabilistic algorithm while preserving the underlying logic of the heuristic.As a result, each iteration of the multi-start framework yields a different solution.In our approach, we use a geometric probability distribution characterized by a single parameter, α (0 < α < 1), to create skewed behavior.The optimal value for α was determined through a short tuning process, which found that the system performs well when α is between 0.3 and 0.4.The multi-start procedure continues until the maximum number of iterations has been completed, culminating in the selection of the optimal solution, i.e. the one with the lowest routing cost.If this solution is considered promising, it is added to a pool of top solutions, keeping only the five most promising.It is important to recognize that the choice of microhubs has a significant impact on the potential routing plans.Therefore, to uncover other viable solutions, we repeated the entire process, generating additional configurations until the predetermined stopping criterion was met.Finally, the pool of promising solutions was compiled and presented.The limits for both the maximum number of iterations and the computation time were set following a straightforward tuning process.This process involved experimenting with various value combinations on a random sample of instances.For example, we set the maximum number of iterations for the randomized CWS to 5000 and capped the computation time for this phase at 600 s.
In the second phase, the algorithm focused on refining the set of "promising" solutions identified in the first phase by iteratively navigating the search space.The primary goal of this process was to reassign customers to different micro-hubs in order to improve the routing cost efficiency of each solution.It is crucial to understand that at this stage the geographical layouts, including the locations of the micro-hubs, were fixed and therefore remained unchanged.To accomplish this, we used an ILS metaheuristic [81].Figure 3 shows a pseudocode representation of this procedure.ILS works by perturbing the current solution to generate a new starting point, and then exploring the neighborhood of this new solution using a local search.As a perturbation method, we randomly selected a group of customers and attempted to randomly reassign them to another facility, ensuring that the facility's capacity was not exceeded.The random selection was carried out using real postal addresses within the city of Barcelona to simulate home deliveries.As for the local search phase, we used a twoopt inter-route operator.This operator exchanges two randomly selected chains of customers between different micro-hubs.The operation continues until no further improvement can be achieved.Whenever a new solution outperforms the current base solution of the iterated local search, the latter is updated with the former, and the best solution is updated accordingly.In order to further diversify the search, the algorithm may occasionally accept unimproved solutions according to an acceptance criterion to update the base solution and thus escape local optima.Specifically, we accepted a suboptimal new solution if the difference between the cost of the new solution and the best solution was less than the last improvement achieved.The process was repeated until the stopping criterion of this phase was met, returning the most promising solution.

Results
The empirical results of our research are of significant relevance to the academic literature, as we present a simulation that addresses three different daily demand scenarios-low, medium, and high-across different facility types: (i) using only public facilities, (ii) using only private facilities, and (iii) a hybrid approach combining both public and private facilities.
Table 2 presents the key findings of our research, focusing on the hybrid approach using both public and private facilities to propose locations for micro-hubs.  2 for ease of comparison.
We have chosen to highlight the results of the hybrid approach in light of the findings of [71], who emphasize the need to encourage public-private collaboration to improve UFD.Below we present the results of three parcel delivery scenarios using this approach: low daily demand (5-25 parcels), medium daily demand (50-100 parcels), and large daily demand (100-200 parcels) for deliveries to 1000 randomly generated delivery points with real postal codes in the city of Barcelona.A total of 1057 locations were considered as potential micro-hubs (see Fig. 1).It is important to note that for the large daily demand scenario, the simulation only reaches a maximum of 600 random customers due to computational  Pickup points (7) Subway stations (6) Narrow-gauge rail stations (1) Railway stations (1) Shopping centers (1) limitations when processing the data.However, the large daily demand scenario shown is considered sufficient considering the future growth projections of e-commerce in Barcelona and the rest of Spain.
The estimates presented in Table 2 show the optimal number of micro-hubs, ranging from 1 to 61, along with their respective types and locations.For instance, in a medium daily demand scenario with an aggregated customer base of 1000 delivery points, the model suggests a total of 51 micro-hubs to effectively meet the daily e-commerce demand. 1 Interestingly, the model's optimal solution distributes these micro-hubs across a broad spectrum of public and private locations: 35 in parking lots, 7 at pickup points, 6 in subway stations, 1 in a narrow-gauge rail station, 1 in a train station, and 1 in a shopping center.
The results of the other approaches are provided in Appendix.The total number of micro-hubs remains stable, but the type of facility chosen by the algorithm clearly differs.Private facilities are dominated by parking lots and pickup points.For public facilities, although there is a greater variety of types, subway (and train) stations, markets, and post offices seem to dominate.Figure 6 shows the geographical basins of these approaches, showing where different sets of micro-hubs operate and distinguishing them by type-public or private.This is in the context of a medium daily demand scenario, serving   2.
The geographical distribution of the micro-hubs in Fig. 6 supports the strategy to comprehensively cover the city's daily e-commerce delivery needs.The varied placement of the hubs-color-coded for public and private facilities-demonstrates a targeted approach that leverages major transportation routes, residential neighborhoods, and industrial areas to ensure that largedemand areas are well served.The micro-hubs are strategically clustered in key areas, reflecting higher customer densities and strategic access points.This indicates a focused approach to maximizing operational efficiency and accessibility.At the same time, their distribution across the urban landscape demonstrates a deliberate design to ensure efficient service coverage throughout Fig. 6 Geographical basins of the proposed micro-hubs for a medium daily demand serving 1000 aggregated customers using the public and private approaches the city.This balanced distribution ensures that hubs are conveniently located relative to dispersed customer locations, minimizing delivery times and costs.This approach reveals a carefully considered balance, designed to meet urban demand while optimizing operational efficiency.The proximity of these hubs to scattered customer locations implies a deliberate effort to minimize delivery times and costs, pointing to a well-considered balance between ensuring operational efficiency and meeting urban demand.
Two significant insights emerge from our findings.First, the hybrid and private approaches show a consistent preference for parking lots and pickup points across all optimal solutions.This preference is primarily driven by their widespread availability and ease of access for both delivery vehicles and customers.Parking lots, in particular, are chosen as preferred micro-hub locations due to a number of advantageous factors.They typically have ample space for the temporary storage and sorting of parcels, which facilitates efficient operations.They are often strategically located in urban areas where there is a large daily demand for deliveries, such as near business districts, shopping centers, or densely populated residential areas, which helps to reduce the last-mile delivery distance.Additionally, parking lots usually have existing infrastructure that can support e-commerce logistics, such as road access for different types of delivery vehicles and the potential to install automated parcel lockers.This makes them ideal for the rapid deployment of micro-hubs, leading to a more resilient and responsive e-commerce delivery network.The public approach, in contrast, relies more on train stations, markets, and even post offices.
Second, the model suggests that only 61 out of the 1057 locations identified as suitable for intermodal e-commerce delivery would be required to meet current e-commerce demand in the city.This represents less than 6% of the potential locations suitable for this purpose.This finding places policymakers at a critical juncture.With the proliferation of e-commerce deliveries, they must define the role of public authorities and assess whether public infrastructure can adequately support UFD for more sustainable delivery methods.Providing public space at subsidized rates could encourage the growth of zero-emission last-mile operators, while relying on the private sector could lead to greater efficiency, but potentially less collaboration and control over logistics operations in the city.These considerations underscore the multifaceted choices that policymakers must make to ensure the future of sustainable UFD.The hybrid approach we present, which combines micro-hubs in both public and private facilities, emerges as a potential solution to the sustainable last-mile problem in the city of Barcelona.

Discussion
Our research has successfully achieved both objectives outlined in previous sections.First, we have identified an optimal network of micro-hubs that strategically integrates a wide range of public, private, and mixed-use infrastructures to facilitate efficient and sustainable UFD in Barcelona.This network is flexible and adaptable to different daily demand scenarios, promotes intermodality, and adapts to the evolving needs of city logistics [35].
Second, we have developed an agile routing algorithm capable of generating adaptive distribution plans, taking into account multiple optimization objectives.This algorithm tackles dynamic environments by optimizing operational and routing costs, thereby contributing to the comprehensive improvement of UFD efficiency [45].The importance of the developed algorithm is underscored by its innovative approach, which involves integrating two different algorithms to solve a practical last-mile distribution case within competitive computational times, as shown in Table 3.The table displays the computational times (in seconds) invested by our approach to obtain the provided solutions.
By hybridizing solutions to the LRP, the algorithm not only improves upon existing methods, but also offers a novel contribution to the literature.Its significance lies in the synergistic combination of location analysis and routing optimization, providing a holistic solution that addresses the complexities of last-mile delivery [23,53].This advancement in logistics strategy not only bolsters operational performance, but also represents a significant leap forward in the field of UFD systems [21].
Considering the findings of [82] our study also underscores the critical importance of optimizing last-mile logistics to reduce vehicle kilometers traveled (VKT) and negative externalities.Their research emphasizes the role of micro-hubs and parcel lockers in creating efficient UFD networks.By utilizing a spatial methodology and a genetic algorithm, they identified optimal microhub locations in Sydney, significantly reducing VKT and improving coverage areas.However, our approach enhances this framework by integrating a nimble routing algorithm that optimizes adaptive distribution plans and considers multiple optimization objectives.This provides a more holistic and efficient solution that simultaneously addresses the selection of micro-hub locations of different types (public, private, and mixed-use) and delivery routes.This synergistic combination of location analysis and route optimization not only further reduces VKT and operational costs but also better adapts to fluctuating daily demands, representing a significant advancement in the efficiency and sustainability of UFD systems.This approach becomes an effective tool for policymakers.
Our approach goes beyond the conventional use of logistics centers as micro-hubs in the public realm to include other key locations such as markets, shopping centers, district buildings, post offices, pickup points, and most importantly parking lots.This approach can help policymakers to explore a variety of options for siting micro-hubs within both public and private facilities [21,26].The inclusion of parking lots as an integral part of this strategy is particularly relevant as it represents a novel opportunity that many European cities, including Barcelona, are beginning to explore in order to expand and optimize their urban distribution network [39].This innovative use of urban space not only addresses the challenges of last-mile logistics, but is also in line with the broader objectives of sustainability and efficient resource utilization 2 [36,37].
Our study makes a significant contribution to the academic discourse on sustainable UFD by advancing our understanding of the location and prioritization of shared micro-hub networks in metropolitan areas.Previous research has advocated for the use of shared micro-hub networks in conjunction with parcel lockers or public transportation infrastructure (e.g., commuter lines, subways, and trains) to optimize last-mile delivery processes [6,83,84].Our research is distinctive in that it pioneers the integration of this concept into an LRP framework, which we approach with a novel multi-start, two-step methodology [6,45].
The importance and relevance of incorporating LRP into our approach lies in its unique ability to simultaneously consider the selection of optimal micro-hub locations and the most efficient delivery routes.Traditional methods often treat these issues separately [85], which can lead to suboptimal solutions that do not fully account for the interdependencies between location selection and routing optimization.By treating these two critical components as a single, integrated problem, our method provides a more comprehensive and potentially more cost-effective strategy for managing the complexities of UFD [46].This not only meets economic imperatives, but also supports environmental and social objectives by promoting more efficient use of urban space and reducing the impact of delivery operations on urban traffic and emissions [40,41].
Our research also enriches the dialogue on how to improve UFD by incorporating an array of urban infrastructure into the proposed distribution network.The results of our simulations confirm the viability of establishing a sustainable UFD network in urban landscapes by using a variety of locations as distribution origins.Its scalability to different daily demand scenarios (low, medium, and large) highlights its adaptability and potential for expansion [36,43].This is consistent with the existing literature, which emphasizes the need for distribution networks that are able to adapt to fluctuating market demand [86].
Building on the findings of [71], our study further positions itself as an invaluable tool for decision-makers seeking to adopt a UFD model that brings together public and private facilities.This collaboration can harness synergies, optimize the use of resources, and bolster the network's efficiency.The importance of this model lies in its integrated approach, which capitalizes on the strengths of both sectors.Public locations can provide widespread accessibility and may already be part of people's daily routines, offering convenience and reducing additional traffic.Private locations can offer flexibility and specialized services that can be tailored to the specific needs and daily demands of the e-commerce market [71].Together, this hybrid approach can facilitate faster deliveries, reduce environmental impacts through more direct routes and shared resources, and ultimately provide a resilient structure that accommodates the dynamic nature of urban commerce [49].
Therefore, the most substantial contribution of our proposal is the inclusion of multiple locations as microhubs, particularly parking lots.Traditionally, distribution facilities have focused on centralized hubs or warehouses.However, our approach is in line with the emerging trend of using a variety of locations, including a combination of public infrastructure and private facilities.This reflects the concept of a more decentralized and diversified UFD [87].
Lastly, our proposal considers the optimal number of micro-hubs for deliveries based on daily demand and total number of deliveries, which could reduce the number of vehicles on urban roads, reduce CO 2 emissions, 2 See "Car parks as city logistics hubs" by Saba.More information here.and alleviate traffic congestion.This is consistent with research advocating for delivery consolidation as an effective strategy for improving UFD efficiency [21].

Conclusions
Our research marks a significant step forward in the field of city logistics, establishing an optimal network of micro-hubs and pioneering an agile routing algorithm to boost the efficiency of UFD.It is important to underscore that while our proposal outlines an optimal framework for policymakers, any final decisions on micro-hub placement should be left to their judgment, informed by local knowledge and strategic priorities.Our findings not only demonstrate the practicality and benefits of integrating various urban infrastructures, including parking lots, into distribution networks as micro-hubs, but also highlight opportunities for further refinement.
The potential to enhance the model to more fully optimize the parcel delivery process, in particular to account for different types of vehicles, is acknowledged.Moreover, the accuracy and relevance of our findings would benefit from access to more detailed and up-to-date data on e-commerce activities in Barcelona.Such data would allow for more precise scenario analysis and direct applicability to the real world.Our research thus provides a foundation for future endeavors towards more sustainable and effective UFD, highlighting the importance of continuous collaboration and flexibility in meeting the dynamic daily demands of city logistics.
While our study provides important theoretical insights into the use of micro-hub networks in urban environments, as illustrated by our Barcelona case study, it also recognizes the need for further refinement.Our model adeptly integrates an LRP through a multi-start, two-step methodology that addresses both the optimal number and positioning of micro-hubs, but it does not go so far as to perfect the entire parcel delivery process in urban environments.In particular, it overlooks the segment that precedes the last-mile-transit from peripheral consolidation centers to micro-hubs.Additionally, our current model's inability to account for different vehicle types limits its ability to provide comprehensive assessments that would consider total distances, costs, and CO 2 emissions across the delivery network.
Furthermore, our findings underscore the importance of cooperative strategies among logistics providers to improve the efficiency of city logistics networks and reduce costs by optimizing the use of resources and ensuring a fair profit distribution among stakeholders.Cooperative use of micro-hubs can also lead to more balanced and less congested urban areas, encouraging infrastructure sharing and reducing duplicated delivery routes.
Finally, more robust and up-to-date data on e-commerce transactions in Barcelona would greatly enhance the practicality of our model.Such data would allow us to develop scenarios that more accurately reflect realworld conditions and facilitate comparisons with our modeled results.Our research lays the groundwork for continuous improvement of UFD systems and highlights the need for adaptive and resilient urban freight distribution strategies.

Fig. 1
Fig. 1 Map showing the 1057 potential micro-hubs for e-commerce parcel delivery

Fig. 2
Fig. 2 Phase 1 of the methodology (generating promising solutions) Figures 4 and 5 summarize the results of Table

Fig. 3
Fig. 3 Phase 2 of the methodology (iterated local search)

Fig. 4 Fig. 5
Fig.4 Boxplots illustrating the operating, routing, and total costs at different demand levels

Table 1
Potential micro-hubs by category within the e-commerce parcel delivery network

Table 2
Simulation of three daily demand scenarios (low, medium, and large) and their impact on opening and routing costs for lastmile UFD using the hybrid approach

Table 2 (continued) Initial simulation conditions Vehicle capacity: 300 parcels Micro-hub capacity: 1500 parcels per day Simulation results for three possible scenarios
1Based on the Government of Catalonia's estimate (report here) of five e-commerce parcels home delivered per second in Catalonia and Barcelona's population of 1,655,956 (IDESCAT, 2023), the daily demand for parcels is estimated at 59,400.

Table 3
Computational times (in seconds) required by our approach to obtain the solutions

Table 5
Simulation of three daily demand scenarios (low, medium, and large) and their impact on opening and routing costs for lastmile UFD using the private approach