# Routing Enhancement in MANET Using Particle Swarm Algorithm
## 3 The Proposed Method
The algorithm takes another random node from the neighbors, takes node 10, and checks if it has reached the destination node. Node 10 is not the destination. It will take node 2 from the neighboring list and reach the destination. Table 1 explains the path selection steps. The path obtained by the first particle is [8, 3, 4, 1, 7, 2] and its fitness value is 703.39. The global best is the path with the minimum fitness value. After the particle initialization, updating takes place. Equations (1) and (2) will update the position and velocity, respectively. The second particle tries to find its route path; it selects [8, 6, 5, 10, 2], and its fitness value is 457.02. The third particle tries to find a new route with a minimum fitness. It will obtain [8, 5, 10, 2], and its fitness value is 457.02; Table 2 shows the path evaluation. The next step is to evaluate the selected path. The PSO algorithm calculates the fitness value for each path and attempts to select the global best that achieves the minimum fitness. Therefore, the best path obtained is [8, 5, 10, 2] since it achieves the minimum fitness value. Figure 2 shows the network after the third particle is updated. Figure 1: Demo network. Figure 2: Network after the third particle is updated. ## 4 Evaluation Metrics

To evaluate the performance of the EPSO algorithm, we used the throughput, packet delivery ratio, end-to-end delay, and number of valid paths. 1. Packet Delivery Ratio (PDR) This is the ratio between data packets successfully reaching a destination and the total number of packets sent by the source. A higher PDR demonstrates the reliability and performance of the protocols, suggesting most packets reach the destination without being lost. In contrast, a lower PDR indicates potential issues in the network causing packet loss. PDR is determined using the formula below: \[PDR=\frac{number\ of\ packets\ received}{number\ of\ packets\ sent}*100\] (5)
2. Throughput Throughput refers to the actual data packets that can be processed over time. Throughput reflects the actual performance of the routing mechanism; it assesses the ability of the routing protocol to successfully transmit the data over the network. Throughput is calculated using the following formula: \[Throughput=\frac{number\ of\ packets\ received}{Time\ period}\] (6)
3. Number of Valid Paths The number of valid paths refers to the number of active, usable routes that connect a source node and destination node. It is a critical factor in the routing protocol that affects its performance. More paths help in load balancing and fault tolerance. 4. End-to-End (E2E) delay End-to-end (E2E) delay refers to the number of hops involved in a routing path. \[E2E\ delay=M\] (7) where \(M\) is the total number of hops in the selected path. ## 5 Simulation Results

The performance of the proposed algorithm is tested in a MANET simulation environment using the MATLAB 2021a programming tool on a system with 8 GB random access memory, an i7 intel core processor, and the Windows 10 operating system. First, the MANET was used to set the simulation environment including the network size and node number. Secondly, we implemented the algorithm using MATLAB software. In addition, the proposed PSO algorithm performance was analyzed by evaluating its results with the other algorithms. The performance was analyzed by varying the node size \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Nodes** & **Neighbors** & **Next Node** & **Current Path** & **Destination Reached?** \\ \hline
8 & 3, 5, 6 & 5 & [8, 5] & No \\
5 & 6, 8, 10, 2 & 10 & [8, 5, 10] & No \\
10 & 2, 5 & 2 & [8, 5, 10, 2] & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Path selection.