In modern agriculture, the adoption of smart farming technologies has revolutionized crop management practices. Among these, crop spraying drones, also known as spraying UAVs, have emerged as pivotal tools for precision agriculture, enabling efficient pesticide application across diverse terrains. However, the challenge of optimizing task allocation for multiple dispersed plots remains significant, particularly when minimizing flight distance while accounting for operational constraints like payload capacity and battery life. This paper addresses the problem of scheduling spraying tasks for a crop spraying drone across numerous small, non-contiguous fields. We formulate a mathematical model aimed at minimizing the total flight mileage, incorporating critical constraints such as the drone’s maximum payload and endurance limits. To solve this optimization problem, we propose an enhanced version of the ant colony algorithm, which improves upon the standard approach by refining the heuristic function and dynamically adjusting the pheromone evaporation coefficient. These modifications enhance the algorithm’s ability to avoid local optima and converge more efficiently to near-optimal solutions. Through extensive simulations, we demonstrate that our improved ant colony algorithm significantly reduces total flight distance compared to traditional methods, thereby promoting resource efficiency and reducing environmental impact. The integration of these advancements supports the broader goals of sustainable agriculture by optimizing the operational efficiency of spraying UAVs in real-world scenarios.
The proliferation of crop spraying drones in agricultural operations has highlighted the need for advanced path-planning strategies. Unlike single-field coverage, multi-plot task allocation involves sequencing visits to discrete locations, each with specific pesticide demands and time requirements. This complexity is compounded by the limited battery life and payload capacity of typical spraying UAVs, necessitating periodic returns to a central depot for replenishment. In this context, we develop a comprehensive model that frames the task allocation problem as a variant of the vehicle routing problem with additional constraints. The objective is to determine an optimal sequence of plot visits that minimizes the total distance traveled by the crop spraying drone, while ensuring that all operational limits are adhered to. Our approach leverages the collective intelligence of swarm-based algorithms, specifically the ant colony optimization, which mimics the foraging behavior of ants to find shortest paths. By introducing tailored improvements to this algorithm, we enhance its applicability to the unique challenges of agricultural drone operations, resulting in more practical and efficient scheduling for spraying UAVs.
To formalize the problem, consider a set of plots labeled from 1 to L, and a central workstation denoted as node 0. The crop spraying drone starts and ends its mission at the workstation, visiting each plot exactly once to perform spraying tasks. Each plot has known coordinates, a required pesticide quantity, and an estimated spraying duration. The drone has a maximum payload capacity G and a battery endurance that limits its total operation time to T_max. The primary goal is to minimize the total flight distance, which directly influences energy consumption and operational costs. The mathematical model is constructed with decision variables x_ij indicating whether the drone travels from location i to j, and constraints that enforce feasibility, such as ensuring each plot is visited once and that the drone’s payload and battery limits are not exceeded during any segment of the route.
The objective function to minimize total flight distance is expressed as:
$$ \min s = \sum_{i \in P_0} \sum_{j \in P_0} x_{ij} d_{ij} $$
where P_0 represents the set including all plots and the workstation (i.e., {0, 1, 2, …, L}), d_ij is the Euclidean distance between locations i and j, and x_ij is a binary variable that equals 1 if the drone moves from i to j, and 0 otherwise. The constraints are defined as follows:
First, each plot must be visited exactly once, which is enforced by:
$$ \sum_{i \in P_0} x_{ij} = 1 \quad \forall j \in P $$
where P is the set of plots excluding the workstation (i.e., {1, 2, …, L}). Second, the drone must depart from and return to the workstation:
$$ \sum_{j \in P} x_{0j} = \sum_{i \in P} x_{i0} = 1 $$
Third, the total pesticide carried at any time cannot exceed the drone’s payload capacity G. This is captured by:
$$ \sum_{i \in P} \sum_{j \in P_0} x_{ij} q_i \leq G $$
where q_i is the pesticide demand at plot i. Fourth, the drone’s battery endurance constraint ensures that the total time spent flying and spraying does not exceed T_max:
$$ \sum_{i \in P} \sum_{j \in P_0} x_{ij} t_{ij} + st_j \leq T_s $$
Here, t_ij is the travel time between i and j, st_j is the spraying time at plot j, and T_s is the maximum allowed operation time per battery cycle. Additionally, temporal consistency is maintained by ensuring that the arrival time at plot j is after the completion at plot i plus travel time:
$$ T_i + st_i + t_{ij} + K(x_{ij} – 1) \leq T_j $$
where T_i and T_j are the arrival times at plots i and j, respectively, and K is a large constant to deactivate the constraint when x_ij = 0. Finally, the decision variables are binary:
$$ x_{ij} \in \{0, 1\}, \quad \forall i,j \in P_0 $$
This model provides a foundation for applying optimization algorithms to derive efficient task sequences for crop spraying drones.
The ant colony algorithm is a metaheuristic inspired by the foraging behavior of ants, which deposit pheromones on paths to communicate route quality. In the standard algorithm, artificial ants construct solutions probabilistically based on pheromone trails and heuristic information. For a spraying UAV, the algorithm iteratively builds paths by selecting the next plot to visit based on a combination of pheromone intensity and a heuristic function, typically inversely related to distance. The probability that ant k moves from plot i to plot j at iteration t is given by:
$$ P_{ij}^k(t) = \frac{ [\tau_{ij}(t)]^\alpha \times [\eta_{ij}(t)]^\beta }{ \sum_{p \in \text{Allowed}_k} [\tau_{ip}(t)]^\alpha \times [\eta_{ip}(t)]^\beta } $$
where τ_ij(t) is the pheromone concentration on the path between i and j, η_ij(t) is the heuristic function, α and β are parameters controlling the influence of pheromones and heuristics, and Allowed_k is the set of plots not yet visited by ant k. After all ants complete their paths, the pheromones are updated to reflect the quality of the solutions:
$$ \tau_{ij}(t+1) = (1-\rho) \tau_{ij}(t) + \Delta \tau_{ij}(t) $$
where ρ is the evaporation coefficient, and Δτ_ij(t) is the total pheromone deposited by all ants that used the path from i to j, calculated as:
$$ \Delta \tau_{ij}(t) = \sum_{k=1}^{m} \Delta \tau_{ij}^k(t) $$
with Δτ_ij^k(t) = Q / L_k if ant k traversed the path, and 0 otherwise. Here, Q is a constant, and L_k is the total path length of ant k.
However, the standard ant colony algorithm has limitations when applied to crop spraying drone task allocation, such as slow convergence and susceptibility to local optima. To address these, we introduce two key improvements. First, the heuristic function is enhanced to incorporate operational constraints specific to spraying UAVs. Instead of relying solely on distance, the new heuristic function integrates the pesticide demand and battery-related factors of the target plot. The improved heuristic function is defined as:
$$ \eta_{ij}(t) = \frac{1}{ d_{ij} \cdot (1 + w_j + f_j) } $$
where w_j represents the pesticide demand at plot j, and f_j denotes a factor related to the battery consumption or operational time at j. This adjustment ensures that the algorithm prioritizes plots with lower resource demands, leading to more feasible and efficient paths for the crop spraying drone.
Second, the evaporation coefficient ρ is made dynamic to balance exploration and exploitation. In the standard algorithm, ρ is fixed, which can lead to premature convergence or excessive randomness. Our improved version adjusts ρ based on the iteration count:
$$ \rho(n+1) = \begin{cases} \rho_{\min}, & n \geq 0.7N \\ \frac{N-n}{N} \cdot \frac{1}{e^{1-\rho(n)}}, & n < 0.7N \end{cases} $$
where n is the current iteration, N is the maximum number of iterations, and ρ_min is a lower bound for the evaporation coefficient. This dynamic update allows for higher exploration in early iterations by increasing ρ, and finer tuning in later stages by reducing it, thus avoiding local optima while accelerating convergence. The lower bound ρ_min prevents the pheromone trails from becoming too stagnant, ensuring continued diversity in path selection.
The steps of the improved ant colony algorithm for task allocation in crop spraying drones are as follows:
- Initialize parameters, including the number of ants m, maximum iterations N, α, β, initial ρ, Q, and ρ_min. Set iteration counter n=0 and compute the improved heuristic function η_ij(t) for all pairs.
- Each ant starts from the workstation (node 0).
- For each ant, select the next plot j from the allowed set based on the probability P_ij^k(t), update the taboo list to avoid revisits.
- If an ant has visited all plots and returned to the workstation, increment the ant counter; otherwise, repeat step 3.
- After all m ants have constructed paths, update the pheromone trails using the dynamic ρ(n+1).
- If n < N, increment n and return to step 2; otherwise, output the best path and convergence data.
This iterative process continues until the termination criteria are met, yielding an optimized task sequence for the spraying UAV.
To validate the effectiveness of our improved ant colony algorithm, we conducted simulations using MATLAB. The scenario includes one workstation and 25 discrete plots, each with specific coordinates, pesticide demands, and spraying times. The crop spraying drone is configured with a flight speed of 3 m/s, a maximum payload of 13 kg, and a battery endurance of 20 minutes. The parameters for the algorithm are set as shown in Table 1.
| Parameter | Symbol | Value |
|---|---|---|
| Number of Ants | m | 50 |
| Maximum Iterations | N | 100 |
| Pheromone Influence Factor | α | 1 |
| Heuristic Influence Factor | β | 2 |
| Initial Evaporation Coefficient | ρ | 0.9 |
| Pheromone Constant | Q | 100 |
| Minimum Evaporation Coefficient | ρ_min | 0.3 |
The plot information, including locations, spraying times, and pesticide demands, is summarized in Table 2. Note that the workstation is at coordinates (350, 380), with zero time and demand.
| Plot ID | Coordinates (m) | Spraying Time (min) | Pesticide Demand (kg) |
|---|---|---|---|
| 0 | (350, 380) | 0.0 | 0.0 |
| 1 | (400, 500) | 1.3 | 2.9 |
| 2 | (300, 450) | 1.5 | 3.2 |
| 3 | (250, 400) | 1.8 | 3.5 |
| 4 | (200, 350) | 2.0 | 3.8 |
| 5 | (150, 300) | 1.2 | 2.5 |
| 6 | (100, 250) | 1.7 | 3.1 |
| 7 | (50, 200) | 1.9 | 3.4 |
| 8 | (400, 300) | 1.4 | 2.8 |
| 9 | (350, 250) | 1.6 | 3.0 |
| 10 | (300, 200) | 1.1 | 2.4 |
| 11 | (250, 150) | 1.3 | 2.7 |
| 12 | (200, 100) | 1.5 | 2.9 |
| 13 | (150, 50) | 1.8 | 3.3 |
| 14 | (100, 400) | 2.1 | 4.0 |
| 15 | (50, 350) | 1.7 | 3.2 |
| 16 | (400, 150) | 1.2 | 2.6 |
| 17 | (350, 100) | 1.4 | 2.8 |
| 18 | (300, 50) | 1.6 | 3.1 |
| 19 | (250, 500) | 2.2 | 4.2 |
| 20 | (200, 450) | 1.9 | 3.7 |
| 21 | (150, 400) | 1.5 | 3.0 |
| 22 | (100, 350) | 1.8 | 3.4 |
| 23 | (50, 300) | 2.0 | 3.9 |
| 24 | (230, 510) | 2.4 | 4.3 |
| 25 | (340, 190) | 1.1 | 2.6 |
We compared the performance of the standard ant colony algorithm with our improved version over 100 iterations. The convergence behavior of both algorithms is illustrated in the following analysis. The standard algorithm achieved a total flight distance of 5642.38 meters, while the improved algorithm reduced this to 5292.82 meters, a reduction of 6.2%. This demonstrates the efficacy of our modifications in enhancing path optimization for crop spraying drones. The improved algorithm also exhibited faster convergence, reaching a stable solution in fewer iterations, which is crucial for real-time applications of spraying UAVs.
The optimized task sequences generated by the algorithms highlight the impact of the constraints. For instance, the standard algorithm frequently required the drone to return to the workstation for replenishment, leading to a fragmented route: 0→13→15→1→0→14→22→0→6→5→0→21→17→0→7→8→0→10→12→0→16→18→9→0→19→25→4→0→23→24→0→3→11→0→2→20→0. In contrast, the improved algorithm produced a more consolidated sequence: 0→10→12→0→7→8→0→14→17→21→0→9→5→18→0→16→2→20→0→19→25→4→0→23→24→0→3→15→0→11→1→13→0→22→6→0. This sequence minimizes unnecessary returns to the depot, thereby reducing total distance and improving operational efficiency for the crop spraying drone.
Further analysis of the pheromone update process reveals that the dynamic evaporation coefficient contributed significantly to avoiding local optima. In early iterations, the higher ρ value promoted exploration of diverse paths, while the gradual reduction allowed the algorithm to exploit the best-found solutions. The improved heuristic function, by incorporating pesticide demand and battery factors, guided the ants toward plots that could be serviced with fewer interruptions, aligning with the practical needs of spraying UAVs. These enhancements make the algorithm particularly suitable for large-scale agricultural operations where multiple crop spraying drones may be deployed simultaneously.
In conclusion, our improved ant colony algorithm offers a robust solution for task allocation in crop spraying drones, effectively addressing the challenges of multi-plot scheduling under payload and endurance constraints. The proposed modifications—refining the heuristic function and implementing a dynamic evaporation coefficient—significantly enhance performance, as evidenced by the 6.2% reduction in total flight distance compared to the standard approach. This optimization not only conserves energy and resources but also supports sustainable farming practices by minimizing the environmental footprint of pesticide applications. Future work could extend this approach to multi-drone coordination or integrate real-time data for adaptive path planning. The continued advancement of such algorithms will play a critical role in maximizing the potential of spraying UAVs in precision agriculture.
For additional resources on drone path optimization, refer to nan.
