# Livestock Management on Grazing Field: A FANET Based Approach
## 3 Methodology
 \tag{10}\]

\[\gamma_{N,\gamma_{ab}}(G)=\gamma^{|E|}(1-\gamma)^{|E_{N}|-|E|} \tag{11}\]

The variable \(E_{N}\) is the expected utility of the number of edges in the graph. The algorithm for the FANET node communication is presented in Algorithm 2. Using the algorithm presented, the UAVs in operation must be within the same transmission range for each node to communicate with each other. The range of transmission is dependent on the type of communication medium used. It is also essential to state the size of data captured before initiating UAV connections [26]. Based on this, the UAVs can connect within the Map coverage area for cooperation using the connectivity routing algorithm presented in Algorithm 2. Since the nodes move randomly within the coverage area, the UAV establishes a connection with the closest node. However, if the request to establish a connection is unsuccessful, the node requests again until a connection is established. ```
Input: UAV coverage Area, Transmission Range
1 Obtain coverage area from Map
2 Enter Transmission range
3 Enter packet size to be captured
4 Enter UAV speed
5 Get a neighbor set of UAVs (\(D(x,y)\))
6 If\(D(x,y)<\text{T}_{\text{min}}\)then
7 Establish a UAV connection
8 Exchange date
9 else
10 Transmission range not reachable
11 Return to 5
12 endif Output: Connection established
```

**Algorithm 2** Connectivity Routing AlgorithmThe parameters in Table 2 show the simulation parameters for the connectivity routing algorithm. The next subsection presents the result and discussion. ## 4 Results and Discussion

This subsection uses a series of simulations to demonstrate the proposed methodology. All simulations were run in MATLAB with an HP Pavilion 15 Intel Core i7 3.2 GHz processor and 8 GB of RAM specification. The YALMIP optimization toolbox was adopted to minimize the coverage time for the UAVs on the grazing fields. The simulation started by exploring the coverage time equation presented in Equation (4) using three UAVs. The setup time of 120 secs and a total flight time of 10 min correspond to the parameters presented in Table 1. The collected map was used as an input to the algorithm, as shown in Figure 6. In the diagram in Figure 7, the grazing field map was carved out and presented. The extracted path for the fight coverage during the mission was extracted and presented in Figure 8.

The carved-out region of the extracted map is depicted with a black spot, as shown in the diagram. The UAV's flight path is computed-based on the map's carved-out region. The obtained flight path is presented in Figure 8.

The green, red, and blue paths are the paths to be followed by the UAVs during the grazing field surveillance. The paths are interwoven because the UAVs move randomly. The time of operation of the UAVs as obtained are 23.3 min, 25.1 min, and 25.2 min, respectively, without determining the optimal route to be followed. This shows that the UAVs could perform their mission on the grazing field. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline T\({}_{\text{min}}\) & 100 m \\ Packet size & 10 \\ UAV speed & 20 m/s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Connectivity Routing Algorithm. Figure 6: Processing Map Region for Grazing Field. The longest distance of the lane to the grazing field was 149.14 m. This parameter was required in establishing the UAV connectivity routing algorithm. However, the UAV path can further be optimized to reduce the coverage time, allowing the UAVs to complete their mission faster to maximize energy. The initial coverage time of the three UAVs before the optimal route is determined is benchmarked against the coverage time when the optimal route is determined. This is presented in Figure 9.

Figure 8: Flight Path for the UAVs. Figure 7: Carved out Map Region for Grazing Field. As shown in the diagram in Figure 10, the UAV's coverage time is presented whereby the (1), (2), and (3) represent the first, second, and third UAVs, respectively, on the x-axis. The y-axis is the coverage time.