## 3 Materials and Methods
### GWO-Based Path Planning  
In this paper, the path planning for autonomous agricultural robots was realized using the proposed method, inspired by Incremental Gray Wolf Optimization (I-GWO) and Expanded Gray Wolf Optimization (Ex-GWO) algorithms. These algorithms are inspired by gray wolves in nature. The natural behaviors of gray wolves such as encircling, hunting, and attacking prey have been modeled mathematically. Encircling in the I-GWO and Ex-GWO are calculated based on Equations (4) and (5). The hunting and attacking mechanism in the I-GWO can be obtained by Equations (9)-(11), and in the Ex-GWO, this is based on Equations (12)-(14). There are four types of wolves in each pack; alpha, beta, delta, and omega wolves. Each wolf has different responsibilities in the pack. Alpha, beta, and delta wolves are involved in encircling the prey, and omega wolves update their own positions based on them to attack the prey. The I-GWO algorithm is based on leader wolf's behavior. Other wolves in the pack update their own positions based on all the wolves selected before themselves. This may result in these wolves being present in similar regions. Thus, they only search for prey (solution) in a particular and similar area, which may be a missing point. The nth wolf in the pack updates its own position based on the \(n\)\(-\)\(1\) wolf before it. This algorithm is completely dependent on the alpha wolf. In the I-GWO algorithm, all relative operations are addressed according to Equations (4)-(11), where \(t\) indicates the current iteration, \(T\) demonstrates maximum iteration number, \(\overset{-}{X}\) indicates the position  
Figure 3: Land map (**a**), UAVs’ positions (**b**) and obstacles coordinates (**c**). vector of a wolf, and \(\vec{X}_{p}\) is the position vector of the prey. Additionally, \(D\) is a vector that depends on the location of the target. \[\vec{D}=\left|\vec{C}\cdot\vec{X}_{p}-\vec{X}_{t}\right| \tag{4}\]  
\[\vec{X}(t+1)=\vec{X}_{t}-\vec{A}\cdot\vec{D} \tag{5}\]  
\[\vec{A}=2\vec{a}\cdot\vec{r}_{1}-\vec{a} \tag{6}\]  
\[\vec{C}=2\cdot\vec{r}_{2} \tag{7}\]  
\[\vec{a}=2\left(1-\frac{t^{2}}{T^{2}}\right) \tag{8}\]  
\[\vec{D}_{\alpha}=\left|\vec{C}_{\alpha}\cdot\vec{X}_{\alpha}-\vec{X}\right| \tag{9}\]  
\[\vec{X}_{\alpha}=\vec{X}_{\alpha}-\vec{A}_{\alpha}\cdot\vec{D}_{\alpha} \tag{10}\]  
\[\vec{X}_{n}(t+1)=\frac{1}{n-1}\sum_{i=1}^{n-1}X_{i}(t);\;n=2,\;3,\;\ldots m \tag{11}\]  
Another metaheuristic algorithm (Ex-GWO) is based on the first three hierarchies of the wolves (alpha, beta, and delta) in a pack. The fourth level of the wolves in a pack update their positions based on the leading three wolves. Generally, the nth wolf updates its own position relative to the prey according to the previous and the first three wolves (Equations (12)-(14)). In the Ex-GWO algorithm, the attacking mechanism is used to avoid the prey from escaping. \[\vec{D}_{\alpha}=\left|\vec{C}_{1}\cdot\vec{X}_{\alpha}-\vec{X}\right|\vec{D }_{\beta}=\left|\vec{C}_{2}\cdot\vec{X}_{\beta}-\vec{X}\right|\vec{D}_{\beta} =\left|\vec{C}_{3}\cdot\vec{X}_{\delta}-\vec{X}\right| \tag{12}\]  
\[\vec{D}=\left|\vec{C}\cdot\vec{X}_{p}-\vec{X}_{t}\right| \tag{4}\]0  
\[\vec{D}=\left|\vec{C}\cdot\vec{X}_{p}-\vec{X}_{t}\right| \tag{4}\]1  
It is assumed that the coefficient vectors \(\vec{A}\) and \(\vec{C}\) lead to encircle the prey. The parameter \(\vec{a}\) decreases from 2 to 0 relative to the iteration number. It is used to improve the convergence speed of the algorithm. These parameters control the tradeoff between exploration and exploitation phases. It is used to get closer to the solution range. \(\vec{r}_{1}\) and \(\vec{r}_{2}\) are the random vectors in a range of \([0,1]\). In every algorithm, the leader encircles the prey, then hunts the prey, and finally attacks the prey based on the \(\vec{A}\) value. If \(\left|\vec{A}\right|<1\), the wolf is attacking the prey; otherwise, it is busy trying to find prey (solution). Figure 4 depicts the working of the proposed algorithms, considering exploration and exploitation phases.