This study employs an Informed-RRT* algorithm with a spatial index structure to carry out path planning tasks and calculate real path lengths. These lengths form the basis for determining whether a recipient address lies within the service range of a distribution center. The location model of the distribution center optimizes economic cost and customer satisfaction while incorporating service range and delivery demand balance constraints. Finally, an immune genetic algorithm is used to solve the model and establish the optimal logistics distribution layout.
3.1. Informed-RRT* Algorithm with Spatial Index Structure
Algorithms such as RRT achieve the efficient exploration of high-dimensional spaces through random sampling and tree expansion. Their core advantage is feasible path generation without pre-modeling obstacles. However, the original RRT algorithm ensures only probabilistic completeness and often produces redundant path length [
11]. To address these limitations, the RRT* algorithm was developed, which introduced an asymptotic optimality mechanism in the path expansion process. By iteratively reconnecting neighboring nodes and optimizing parent node selection, RRT can progressively reduce overall path cost [
12]. Despite these improvements, RRT* still relies on global random sampling, which entails significant computational overhead for frequent neighbor searches and collision checks. Moreover, the probability of identifying globally optimal solutions remains relatively low in complex environments. To further enhance search efficiency and optimality, the Informed-RRT* algorithm was developed, which introduced a dynamically constrained search space [
13]. The dynamic search space adjustment mechanism consisted of elliptical sampling region constraints and a dynamic search radius attenuation strategy.
Specifically, Informed-RRT* restricts sampling to an elliptical region whose major axis is defined by the line between the initial point (q
start) and goal point (q
goal), and whose size is determined by the current best path length (c
best). By confining sampling to the ellipse, the algorithm focuses the search within zones with a greater likelihood of improvement. As the number of iterations increases and c
best converges towards the theoretical shortest path, the ellipse shrinks accordingly, further localizing the search. This iterative refinement of the sampling space is illustrated in
Figure 1.
In addition, Informed-RRT* employs a dynamic search radius attenuation strategy, as described by Equation (1), in which the search radius is exponentially reduced as the tree expands. This approach maintains global exploration in early iterations and suppresses redundant sampling oscillations in later stages, thereby improving both sampling efficiency and convergence speed.
where
rcurrent is the current search radius,
n is the number of nodes in the current tree, and
r is the radius of the next stage of the search.
Although Informed-RRT* demonstrates a higher probability of identifying globally optimal solutions, it still exhibits notable deficiencies. In particular, the algorithm relies on brute-force methods for neighbor node searches and collision detection, leading to a surge in computational time in urban environments with dense obstacles.
To overcome these challenges, this paper adopts Informed-RRT* as the foundational framework and enhances it through multi-level spatial index optimization. Specifically, we introduce KDTree (K-Dimensional Tree)-based neighbor search and STRTree (Sort-Tile-Recursive Tree)-based collision detection within the Informed-RRT* framework. This dual-index structure significantly improves both node retrieval and collision detection efficiency, thereby addressing the major efficiency bottlenecks of traditional brute-force methods in RRT-class algorithms.
The KDTree is essentially a spatial partitioning structure. During each construction process, all nodes are partitioned based on the dimension with the maximum variance (the axis along which the nodes are most widely dispersed). After sorting nodes by the selected dimension, the median node is chosen as the root of the current subtree, and the remaining nodes are divided into two subtrees. This recursive partitioning procedure continues for each subtree, each time along the axis of maximum variance, and at the median, until the number of nodes within a subspace falls below a predefined threshold [
42].
Figure 2 illustrates a simplified KDTree partitioning process.
During nearest neighbor querying, at each split node, the coordinate of the query point along the current splitting axis is compared with the node’s split value. If the query point coordinate is less, the search proceeds recursively to the left subtree; otherwise, it enters the right subtree. Once a candidate’s nearest node is found, the algorithm records the distance dmin to the query point and defines a circular search region (with dmin as the radius) centered at this node. The algorithm then checks whether the subspace intersects with the search circle to determine whether to perform backtracking. If an intersection exists, the algorithm explores the corresponding subtree to potentially find a closer node; if not, it prunes the search space to avoid redundant computations. After a new node is inserted, only the relevant path nodes need updating, which maintains an efficient lightweight index without global reconstruction. Compared to traditional brute-force nearest neighbor search which computes distances to all nodes, KDTree’s recursive partitioning confines searches to relevant branches. It also mitigates query errors via backtracking, thereby improving search efficiency.
STRTree is an efficient spatial index structure for collision detection. During preprocessing, each obstacle is assigned a minimum bounding rectangle (MBR). These MBRs are then grouped, sorted, partitioned by spatial proximity, and hierarchically aggregated from the bottom up. In STRTree, leaf nodes store actual obstacles and are located at the base of the tree. Non-leaf nodes store only collections of child node MBRs and pointers, not actual obstacle information, and are located exclusively in upper tree levels [
43]. STRTree minimizes overlap among non-leaf nodes at higher levels.
Figure 3 visualizes this storage hierarchy, where R8, R9, and R10 are leaf nodes; the remaining nodes are non-leaf aggregates.
For collision detection, when presented with a candidate path segment, STRTree first rapidly filters all MBRs intersecting the segment’s MBR, thus eliminating most irrelevant obstacles before detailed geometric collision checking. After integrating STRTree into the Informed-RRT* framework, collision detection is restricted only to spatially relevant obstacles. The algorithm recursively traverses only those branches whose MBRs intersect with the path segment, advancing to child nodes only as needed, and halts when actual obstacles are reached or no intersection remains. This focused traversal significantly expedites the path planning process.
3.2. UAV Distribution Center Location Model Construction Considering Real Paths
This section aims to solve the urban logistics “last kilometer” problem, using logistics UAVs for center-to-end-point deliveries to alleviate congested ground traffic.
We aim to determine distribution centers and assign service relationships from a set of potential locations without predefining the number of centers. Our model simultaneously optimizes two objectives, minimizing economic costs and maximizing customer satisfaction, while considering the service capacity limits of each center. In addition, to align with the development trends of China’s drone logistics industry, we first establish secure and reliable flight routes before determining the final site selection. Therefore, we use the Capacitated Facility Location Problem model [
25] as the basis and extend its cost functions and constraints to fit this application.
Distribution centers are chosen from existing logistics nodes. To achieve a robust spatial layout, the model incorporates both basic parameters (such as logistics point node coordinates, demand, and construction costs) and additional ones (such as center delivery capacity and service range). Furthermore, the modeling framework is tailored for the high-density and high-frequency characteristics of urban UAV logistics. These considerations collectively define our UAV distribution center location model.
To simplify the model, this paper has the following premise for its existence:
(1) Logistics UAVs perform “point-to-point” distribution. Our premise is that UAVs carry out only one single task at a time, and return immediately after completion of the distribution.
(2) We construct a distribution center–logistics point secondary site layout. A terminal logistics point can only be served by a distribution center, and there is no interconnection between end logistics points and distribution centers.
(3) The UAV is flying at a constant speed; the constant speed is 10 km/h in our model.
(4) We neglect the influence of environmental and unexpected factors such as temperature and humidity changes, human operational errors, and UAV collisions on the UAV flight process.
(5) The default UAV can take off and land vertically at all the logistics points selected.
(6) The UAVs used are of the same type, with the same range, payload, and power. Here we set 10 km as the range of flight in our model.
(7) The time for loading the goods, climbing, descending, and unloading the goods is not counted.
(8) In our model, all parameter settings are taken from the available existing UAV data sources, including SF (SF Express, a Chinese express delivery enterprise) and DJI (DJI-Innovations, a Chinese unmanned aerial vehicle manufacturer).
To facilitate the mathematical expression of the model, the parameters of the constructed model are replaced by symbols in the expression, and
Table 1 explains the symbols in the model.
Both economic cost and customer satisfaction are key factors in UAV logistics delivery. They determine whether this industry can develop in the long term. Hence, this section selects the total transportation cost and customer satisfaction as the dual objectives for optimization, and the objectives are introduced as follows:
(1) Total transportation costs
Transportation economic costs contain logistics transportation costs, distribution center establishment costs, and warehousing costs.
where
Cdel denotes the transportation cost of using UAVs for distribution,
Csto denotes the warehousing cost of the distribution center, and
Cde denotes the construction cost of the distribution center.
(2) Customer satisfaction
In this paper, a customer time satisfaction function is adopted to measure customer satisfaction. The segmented customer satisfaction function proposed in the literature [
9] is used to describe the level of customer satisfaction with the response time of UAV delivery.
where
S is the customer satisfaction,
tij is the time from the distribution center
i to its service logistics point
j using UAVs for distribution, k is the time sensitivity coefficient, and
tL and
tB are the node times needed, respectively, to separate the customer satisfaction into a three-segmented function. When
tij <
tL, the customer satisfaction is considered to be 1; when
tL <
tij <
tB, the customer satisfaction is calculated by
; and when
tij >
tB, customer satisfaction is considered to be 0.
Considering the constraints of distribution methods, delivery capability–demand balance, and the service range of distribution centers, we place the following constraints on the model:
(1) Distribution center quantity constraints
The number of logistics points selected as distribution centers is not greater than the total number of logistics points, i.e.,
(2) Delivery capability and demand balance constraints
Demand is met at each logistics point/delivery capability is greater than or equal to demand, i.e.,
(3) Distribution method constraints
Each logistics point can only be served by one distribution center, i.e.,
In the distribution center–logistics point secondary site layout, there is no transportation route between the logistics point and the logistics point not selected as a distribution center, i.e.,
(4) Distribution center service scope constraints
It is noteworthy that, in the actual operation of drone logistics, the straight-line distance often fails to accurately represent the flight path. Due to the presence of dense obstacles in urban environments, UAVs must frequently detour around obstacles. In this study, the Informed-RRT* algorithm with a spatial index structure is introduced for path planning, enabling the determination of the actual point-to-point flight distance (dij), which is subsequently utilized in a service coverage constraint assessment.
When the distance of a logistics point exceeds the service radius of a facility point, the facility point cannot provide service to that demand point, i.e.,
where d
ij is the real path length obtained from the planning of the Informed-RRT* algorithm with spatial index structure, rather than straight-line length, and R is taken as half of the maximum range of the UAV.
This approach allows the model to quantify the actual impact of obstacle avoidance detours on both logistics costs and service times, thereby significantly improving its practical applicability. Compared to traditional location models that rely solely on point-to-point straight-line distances, the proposed model incorporates the true flight paths, providing precise modeling of complex routes in high-density urban environments. As a result, the scientific rigor and practical relevance of facility location decisions are greatly enhanced.
(5) Distribution center service capacity constraints
A logistics point will be selected as a distribution center only when the number of demand points served by the logistics point is not less than
β, i.e.,
There is a service ceiling for distribution centers, and a distribution center can serve up to a fixed number of logistics points, i.e.,
3.3. Immune Genetic Algorithm
As two typical types of bio-inspired heuristic algorithms, genetic algorithm (GA) and immune algorithm (IA) exhibit complementary characteristics in solution space optimization.
GA can effectively handle complex, multi-modal, and high-dimensional search spaces. It simulates the biological evolution mechanisms—selection, crossover, and mutation—for global search and diversity preservation, thereby reducing the risk of convergence to local optima [
26]. However, GA often suffers from slow convergence and is prone to premature convergence due to the decline of population diversity.
IA emulates the antigen–antibody recognition process of the immune system. It uses a memory bank to retain historically high-quality solutions and applies antibody concentration control to inhibit population aggregation. These strategies enhance the solution space exploration efficiency, particularly for local search tasks [
27]. However, the high computational complexity of IA restricts its scalability in large-scale applications.
To address these limitations, this study proposes an immune genetic algorithm (IA-GA) that integrates the core mechanisms of GA and IA to achieve complementary effects. The algorithm retains GA’s evolutionary operators (crossover and mutation) to maintain global search capabilities, and introduces IA’s clonal selection and hypermutation mechanisms to accelerate local convergence.
Operationally, both GA and IA select high-fitness individuals to progress to the next generation. To further increase the probability of high-fitness individuals advancing, IA-GA employs a diversity dynamic regulation strategy, which consists of a memory bank elite retention mechanism and an antibody concentration feedback control mechanism. These strategies enable IA-GA to balance the entry of high-quality solutions into genetic operations and enable the maintenance of population diversity.
The memory bank elite retention strategy is based on an immune memory bank which stores historical Pareto-optimal solutions. This prevents random operations from losing good genes, enhancing convergence stability. The antibody concentration feedback control calculates the antibody similarity based on Equation (11), where
is the local density value of the antibody
;
is the distance radius that defines the neighborhood range and determines which antibodies are considered “close” to
; N is the total number of the antibody population; and
is the indicator function to determine whether antibody
is within the neighborhood of
.
Equation (11) dynamically adjusts the selection pressure to inhibit the aggregation of the population and maintain the diversity. In addition, IA-GA adopts a periodic memory reset strategy. This strategy updates the strategy after every specified number of iterations, balances the conflict between historical experience inheritance and new region exploration, and avoids the trap of local attraction domains.
Through these mechanisms, IA-GA guides the population to rapidly converge toward high-quality solution regions while suppressing excessive aggregation within the population. This enhances exploration capability and achieves a dynamic balance between exploration and exploitation, providing an efficient solution for the optimization model.
In addition, while retaining the aforementioned core mechanisms, the algorithm operations have been specifically modified to address the constraint that the same point cannot be selected more than once as a distribution center in the facility location problem. The proposed IA-GA employs both swap mutation and insertion mutation operations, with mutation probability adaptively decreasing as the number of iterations increases. In swap mutation, two genes are randomly selected and their distribution center assignments are exchanged. In insertion mutation, the insertion of a new gene is accompanied by an automatic adjustment of the order of subsequent genes. Both operations inherently prevent the duplication of distribution center selections at the mutation stage. Furthermore, to balance the retention of globally optimal solutions with the risk of population dominance by highly similar individuals, an elite retention strategy incorporating a similarity threshold is implemented in the memory bank. When the similarity between a candidate individual and any existing individual in the memory bank exceeds the threshold, the candidate is excluded. This ensures that the memory bank maintains elite individuals from diverse regions of the solution space.