Improved Ant Colony Algorithm for UAV Drone Trajectory Planning

Trajectory planning is one of the key technologies for autonomous flight of a UAV drone. It aims to generate an optimal or feasible flight path from a start point to a target point while satisfying various constraints such as obstacle avoidance, fuel consumption, power limitation, and time windows. UAV drones are widely used in logistics delivery, geological survey, agricultural spraying, disaster rescue, and power line inspection. However, complex environments with multiple threats and obstacles pose significant challenges to path planning algorithms. Classical algorithms like A*, artificial potential field, and Dijkstra are efficient for simple models but often fail in complex scenarios. Swarm intelligence algorithms such as the ant colony optimization (ACO) algorithm, particle swarm optimization, and grasshopper optimization are well-suited for non‑deterministic polynomial (NP) problems in complex environments, but they suffer from slow convergence and a tendency to fall into local optima.

In this study, we propose an improved ant colony algorithm for UAV drone trajectory planning. The improvements include: (1) adopting the artificial potential field method to initialize the pheromone distribution, reducing the blindness in the early search; (2) introducing an elite ant colony with larger movement ranges and more sensitive pheromone update rules; (3) enhancing the heuristic function by incorporating the distance from a feasible node to the target node, inspired by the A* algorithm; and (4) adaptively adjusting the pheromone volatility factor. Extensive simulations demonstrate that the proposed algorithm outperforms the traditional ACO algorithm in terms of path length, convergence speed, and trajectory smoothness.

1. Trajectory Optimization Model

1.1 Trajectory Length Cost

During the flight of a UAV drone, fuel consumption is proportional to the total flight distance. Therefore, we aim to minimize the path length. Assuming the complete trajectory consists of \(N\) waypoints, the length cost \(J_F\) is defined as:

$$
J_F = c \sum_{g=1}^{N-1} L_{\text{path},g}
$$

where \(L_{\text{path},g} = \sqrt{(x_{g+1} – x_g)^2 + (y_{g+1} – y_g)^2}\) is the Euclidean distance between consecutive waypoints, and \(c\) is a weight coefficient.

1.2 Radar Threat Cost

Radar threat assessment is a critical technique for evaluating the detection, tracking, and attack risk of enemy air‑defense radars against a UAV drone. We adopt the classical distance‑decay model. For a radar \(r\), the detection probability \(P_r(L)\) is given by:

$$
P_r(L) =
\begin{cases}
0, & L \le R_{r,\min} \\
1 – \left(\frac{R_{r,\max} – L}{R_{r,\max} – R_{r,\min}}\right)^4, & R_{r,\min} < L < R_{r,\max} \\
1, & L \ge R_{r,\max}
\end{cases}
$$

where \(L\) is the distance between the UAV drone and radar \(r\), \(R_{r,\max}\) is the maximum detection range, and \(R_{r,\min}\) is the reliable detection range. To avoid misjudgment from a single point, we sample five points on each path segment (the two endpoints and three equally spaced interior points). The threat cost of radar \(r\) over the whole trajectory is:

$$
J_r = \sum_{g=1}^{N} P_r(L_g)
$$

where \(L_g\) is the distance from the midpoint of the \(g\)-th segment to radar \(r\). The total radar threat cost is:

$$
J_R = \sum_{r=1}^{n_R} \alpha_r J_r
$$

where \(n_R\) is the number of radars and \(\alpha_r\) is the threat coefficient of the \(r\)-th radar.

1.3 Turning Cost

When a UAV drone executes a turning maneuver, energy is consumed to control the control surfaces. The turning cost at the \(z\)-th waypoint is:

$$
J(\theta_z) =
\begin{cases}
0, & \theta_z \le \theta_{\max} \\
\varepsilon \left( \frac{\theta_z}{\theta_{\max}} – 1 \right), & \theta_{\max} < \theta_z \le 2\theta_{\max}
\end{cases}
$$

where \(\theta_z\) is the turning angle at waypoint \(z\), \(\theta_{\max}\) is the maximum allowed turning angle, and \(\varepsilon\) is a penalty coefficient. The total turning cost over the entire trajectory is:

$$
J_\theta = \sum_{z=1}^{N-1} J(\theta_z)
$$

1.4 Comprehensive Cost Function

Considering all three cost components, the overall objective function to be minimized is:

$$
f = \omega_1 J_F + \omega_2 J_R + \omega_3 J_\theta
$$

where \(\omega_1, \omega_2, \omega_3\) are weight coefficients satisfying \(\omega_1 + \omega_2 + \omega_3 = 1\).

2. Traditional Ant Colony Algorithm

2.1 Basic Principle

The ant colony algorithm mimics the foraging behavior of real ants. Ants deposit pheromone on the paths they traverse; the amount of pheromone gradually evaporates over time. By probabilistically choosing paths with higher pheromone concentration, the colony discovers the shortest route between the nest and the food source. For a UAV drone trajectory planning problem, the search space is discretized into a grid, and each ant builds a path from the start node to the goal node.

2.2 Transition Probability and Pheromone Update

At iteration \(t\), the probability that ant \(k\) moves from node \(i\) to node \(j\) is:

$$
P_{ij}^k(t) =
\begin{cases}
\frac{[\tau_{ij}(t)]^\alpha \cdot [\eta_{ij}(t)]^\beta}{\sum_{s \in \text{allow}} [\tau_{is}(t)]^\alpha \cdot [\eta_{is}(t)]^\beta}, & j \in \text{allow} \\
0, & \text{otherwise}
\end{cases}
$$

Here, \(\tau_{ij}(t)\) is the pheromone concentration on edge \((i,j)\), \(\alpha\) is the pheromone factor, \(\eta_{ij}(t)\) is the heuristic information (usually the reciprocal of the distance between nodes), \(\beta\) is the heuristic factor, and allow is the set of feasible neighbor nodes.

After all ants complete one iteration, the global pheromone is updated as:

$$
\tau_{ij}(t+1) = (1-\rho) \cdot \tau_{ij}(t) + \Delta \tau_{ij}
$$
$$
\Delta \tau_{ij} = \sum_{k=1}^{m} \Delta \tau_{ij}^k
$$
$$
\Delta \tau_{ij}^k =
\begin{cases}
\frac{Q}{L_k}, & \text{if ant } k \text{ traversed } (i,j) \\
0, & \text{otherwise}
\end{cases}
$$

where \(\rho\) is the evaporation rate (\(0<\rho<1\)), \(m\) is the total number of ants, \(Q\) is the pheromone intensity, and \(L_k\) is the total length of the path found by ant \(k\).

3. Proposed Improved Ant Colony Algorithm

3.1 Differentiated Initial Pheromone Distribution

In the traditional ACO, the initial pheromone is uniformly distributed, leading to blind random search in early iterations. We borrow the idea of the artificial potential field method to set the initial pheromone. The goal point generates an attractive field, while obstacles and threat regions generate repulsive fields. The initial pheromone at grid node \(q\) is:

$$
U_{\text{att}}(q) = \frac{\xi}{2} d^2(q, q_{\text{goal}})
$$

where \(\xi\) is the attractive gain coefficient and \(d(q, q_{\text{goal}})\) is the Euclidean distance from node \(q\) to the goal. This gives nodes closer to the goal a higher initial pheromone value, guiding ants toward the target from the very beginning. Repulsive fields from obstacles are subtracted (or set to zero inside obstacles). The resulting initial pheromone map significantly reduces the blindness of the early search.

3.2 Elite Ant Colony Strategy

We divide the colony of \(m\) ants into two groups: elite ants and ordinary ants, with a ratio of 1:2. Ordinary ants have 8‑neighbor movement (Moore neighborhood). Elite ants are given a larger movement range of 24 neighbors (a 5×5 square centered on the current node, excluding the central cell). This allows elite ants to explore farther and discover potential shortcuts or detours that ordinary ants might miss. Furthermore, elite ants adopt a more sensitive pheromone update rule. While ordinary ants use the standard update described earlier, elite ants update pheromone with a higher weight and also deposit extra pheromone on the best‑so‑far path. This accelerates convergence without sacrificing diversity.

3.3 Improved Heuristic Function (A* Inspired)

The standard heuristic function \(\eta_{ij}(t) = 1/d_{ij}\) only considers the immediate distance between nodes. To better guide ants toward the goal, we incorporate the estimated distance from the next node \(j\) to the target, inspired by the A* algorithm. The improved heuristic is:

$$
\eta_{ij} = \lambda \cdot \frac{1}{d_{ij}} + (1-\lambda) \cdot \frac{1}{h(j)}
$$

or alternatively in a multiplicative form (commonly used in literature):

$$
\eta_{ij} = \frac{1}{d_{ij} + \lambda \cdot h(j)}
$$

where \(h(j) = \sqrt{(x_j – x_{\text{goal}})^2 + (y_j – y_{\text{goal}})^2}\) is the Euclidean distance from node \(j\) to the goal, and \(\lambda\) is a weight parameter. This modification strengthens the attractiveness of nodes that are both close and oriented toward the goal, improving convergence speed.

3.4 Improved Volatility Factor

In the traditional ACO, the evaporation rate \(\rho\) is constant. A fixed \(\rho\) leads to either too rapid pheromone loss (poor accumulation) or too little difference between paths (slow convergence). For elite ants, we adopt a dynamic evaporation rate that follows an exponential distribution:

$$
\rho_e(x) = \frac{1}{R} e^{-x/\lambda}
$$

where \(x\) is the iteration number, and \(R = 1/\lambda\) is a regulation coefficient. To prevent extremes, we clamp \(\rho_e(x)\) within [0.2, 0.6]. This allows elite ants to have a higher evaporation rate at the beginning (encouraging exploration) and a lower rate later (preserving good paths). Ordinary ants still use a constant \(\rho = 0.4\).

4. Simulation and Results

The simulations are conducted on a Windows 10 system with an Intel Core i7 CPU (2.6 GHz) and 16 GB RAM, using Python. The planning space is a 2D grid of size 50×50. The same parameters are used for both the traditional ACO and the improved ACO unless otherwise stated. Table I lists the common simulation parameters.

Table I: Simulation Parameters
Parameter Value
Start point (5,5)
Goal point (45,45)
Radar center (25,25)
Radar max detection range 10
Obstacle 1 center (20,16)
Obstacle 2 center (35,32)
Obstacle radius 5
Pheromone factor \(\alpha\) 1
Heuristic factor \(\beta\) 2
Pheromone intensity \(Q\) 1
Number of ants \(m\) 30
Evaporation rate \(\rho\) (ordinary) 0.4
Elite ratio 1:2 (elite:ordinary)

4.1 Simple Environment

In the simple environment, there is one radar threat and two obstacle zones. We run each algorithm 10 times and select the run with the smallest path cost. The resulting trajectories and convergence curves are compared. As shown in the figure below, the improved ACO produces a smoother path with fewer sharp turns and avoids the threat more effectively.

The convergence performance is summarized in Table II. The improved ACO achieves a best path cost of 58.66, while the traditional ACO yields 67.25, representing a 12.7% improvement. Moreover, the improved algorithm converges to the optimum at iteration 51, compared to iteration 61 for the traditional version, a 16.3% reduction in convergence steps.

Table II: Comparison in Simple Environment
Algorithm Total Iterations Optimal Iteration Path Cost
Improved ACO 100 51 58.66
Traditional ACO 100 61 67.25

4.2 Complex Environment

To further validate the robustness, we enlarge the grid to 100×100 and increase the number of radars and obstacles. Two radar threats and three obstacle zones are placed. Again, 10 independent runs are performed. Table III shows the best results. The improved ACO finds a path with a cost of 185.72, whereas the traditional ACO reaches 231.08, an improvement of 19.6%. The optimal iteration also shifts from 91 to 83.

Table III: Comparison in Complex Environment
Algorithm Total Iterations Optimal Iteration Path Cost
Improved ACO 200 83 185.72
Traditional ACO 200 91 231.08

The convergence curves clearly show that the improved algorithm not only starts with a lower initial cost (thanks to the differentiated initial pheromone) but also converges faster in the middle and later stages. The elite ant strategy and improved heuristic function effectively prevent the algorithm from being trapped in local optima.

4.3 Discussion

The experimental results confirm that each improvement contributes to the overall performance. The artificial potential field initialization provides better early guidance. The elite ants with larger search scopes enhance exploration. The A*-inspired heuristic accelerates convergence, and the adaptive volatility factor balances exploration and exploitation. Compared with the traditional ACO, the improved algorithm consistently yields shorter, smoother, and safer paths for UAV drone missions. The computational overhead is slightly increased due to the elite ant processing, but the gain in path quality and convergence speed justifies the trade‑off.

5. Conclusion

We have presented an improved ant colony algorithm tailored for UAV drone trajectory planning in environments with radar threats and obstacles. The key modifications—differentiated initial pheromone distribution, elite ant colony, improved heuristic function, and dynamic evaporation rate—address the common drawbacks of the traditional ACO: slow convergence, many turning points, and local optima. Simulation results in both simple and complex settings demonstrate that the proposed algorithm reduces path cost by up to 19.6% and accelerates convergence by up to 16.3% compared to the standard ACO. The resulting trajectories are smoother and more suitable for real UAV drone operations. Future work will extend this approach to three‑dimensional space and multi‑drone cooperative path planning.

Scroll to Top